Last updated July 5th, 2019
gl Transmission Format, or glTF, is a free specification by KhronosGroup for the efficient transmission and loading of 3D scenes and models by applications which makes it great for RealTime Graphics. The Cinema 4D glTF Exporter exports the c4d scene to *.gltf/*.glb formats, ready to be used across all platforms supporting glTF.
July 5th release features:
- Added: Baking of Skin Animation
- Added: Material Sharing
- Added: Material Names
- Bug Fix: Crash when exporting joint hierarchies containing Nulls
- Bug Fix: Scale option misbehaviour
Additions and modifications to the documentation are underlined or
To Export the scene in glTF format go to File->Export->GLTF (*.gltf), select a destination and click Save. An Options window will pop up with the following options:
- Export Normals: Deselect to get Flat Shading.
- Export UV Coordinates: Self explanatory.
- Scale: Define the scale of the exported scene.
- Export Textures: Self explanatory.
- Double Sided: Select to prevent Back-face Culling.
- Export TRS Animations: Export TRS animation tracks.
- Export Morph Animations: Export either Pose Morph animation or PLA animation.
- Export Skin Animations: Export TRS animation tracks of joints.
- Bake Animations: Bake every frame of animation.
- Substeps: Number of substeps to sample between each two frames.
- Export Frame: Export state of document at current frame or at another specified frame .
- Export Frame Number: specify which frame to export .
- Export Cameras
- Flip Z: Switch from Left Handed to Right Handed System.
- Export as Binary(.glb): Export glTF file in its binary form.
You can convert the units of the scene at export. I’ll provide a few examples to explain how it works:
C4D value > Scale option > Exported value
100 cm > 1 Centimeter > 100
1 cm > 1 Meter > 0.01
1 m > 1 Centimeter > 100
1 m > 1 Meter > 1
glTF takes the PBR approach to describe Materials, which translates pretty well to Cinema’s Reflection Channel, but is limited in some aspects. One of those is the lack for multilayered material support. And so, to get a similar looking result on export, we recommend working with a single Reflection/Specular layer in the Reflection Channel.
(*) Supported fields are Highlighted in blue
PBR Metallic Roughness
glTF’s PBR Material’s information is encoded into three main parameters:
- Base Color: set by Layer Color’s Color selection or by Color selection in Color Channel.
- Metallic Value: set by main reflection layer’s Reflection Strength value.
- Roughness Value: set by main reflection layer’s Roughness value.
Texture maps to the aforementioned parameters are also supported:
- Base Color Texture: set Bitmap Texture in Layer Color or in Color Channel.
- Metallic Texture: set Grey-scale Bitmap Texture under Reflection Strength.
- Roughness Texture: set Grey-scale Bitmap Texture under Roughness Strength.
Normal Maps can also be set in the main Reflection/Specular layer, under Bump Strength, set Mode to “Custom Normal Map” and set the Bitmap in Custom Texture.Can also be set in the Normal Channel and the Bump Channel.
(*) Supported fields are Highlighted in blue
Occlusion Map is set in the Diffusion Channel.
Emissive Factor and Map
Emissive Factor(Color) and Map are set in the Luminance Channel.
Alpha Map is set in the Alpha Channel.
Pose Morph Animations
The current glTF standard supports morph targets which are added, with differnet weights, to the original mesh. The weights can also be animated.
In Cinema 4D, Morph targets are called Poses, and the weights are Strengths.
Setting a Target overrides the internal poses defined in the tag.
PLA isn’t technically supported in the current glTF standard, but I was able to achieve this by considering the object at different keyframes to be differnt morph targets.
Skin animation is described as the deformation of a mesh according to TRS tracks of joints that are bound to it and assign weights to its vertices.
Visibility of the object can be turned off by setting the Editor Mode to Red. Technically there’s no support for a visibility boolean in the current standard, this is achieved by setting the material’s alpha to 0.
The Texture Mode of the gltf file is defined by the Texture Mode option in Preferences>OpenGL, select between Nearest, Linear and Mipmaps.
Notes and Limitations
- Reflection Strength vs. Metallic Value: Reflection Strength translates very closely to glTF’s Metallic Value, but there’s a difference… In Cinema 4D, Reflection Strength describes how much light is reflected off the surface, whereas Metallic Value describes how much the reflective behavior of the surface resembles that of a metal. 0% Reflection Strength means that the surface doesn’t reflect any light, meaning it’s black. But that is not true for 0% Metallic Value.
- Texture Baking: As of now, the automatic baking of Texture Shaders is not yet implemented. If you do use Shaders, please manually Bake them using the Bake Texture tag and re-set them as Bitmaps.
- Metallic-Roughness coupling: In glTF, the Metallic and Roughness Maps are actually single Bitmap where the values are incorporated into the Green and Blue Channels. So when setting a Reflection Strength and Roughness maps, please make sure they are the same dimensions. If they are not, then the Reflection Strength map will be scaled to match the Roughness map.
- Color-Alpha coupling: Same goes for the Color Texture and Alpha Map, as they will be merged into a single RGBA Bitmap.
- Mix Strength: glTF mixes between the Main Color and the Texture by component-wise multiplication of the RGB values. This required an adjustment method of the Color value or the Texture pixels at Export to achieve the same mix as in Cinema 4D. It’s still WIP and artifacts may appear in the result.
- Normal map strength: When setting the Normal map in the Reflection Channel… The strength, or “scale”, of the Normal Map is defined by the product of Bump Strength and Strength.
- Error Messages: Proper Error Descriptions are yet to be included, if you run into an error, it will most likely say “Out of Memory…” but it’s very rarely so.
- Polygon Selection: Polygon Selection is not yet supported, please manually Split the object and apply the different materials accordingly.
- Color properties priorities: If Color Channel is enabled, its properties override the Layer Color properties set in the Reflection Channel(i.e. Color, Brightness, Texture and Mix Strength)
- Normal map priorities: If Normal maps are set in the Reflection Channel, Normal Channel and Bump Channel. Then the Normal map and its Strength are retrieved from the Reflection Channel first, Normal Channel second, and Bump Channel last.
- Instances: not supported yet. instances will be baked into a new polygon object.
- Cubic Spline animation curves: in Cinema 4D, two coefficients define the tangent of every key: “value” and “time”. In glTF, a tangent is defined only by “value”. If your exported animation doesn’t look the same, consider baking the animation.
- Linear/Step curves: An animation property(Translation/Rotation/Scale) will be exported as Step Interpolation only if all its keys interpolations(in the x,y,z curves) are set to Step, otherwise it will be exported as Cubic Spline.
- Pose Morph OR PLA: It’s not possible to export PLA and Pose Morph animations together.
- Pose Morph global Strength: The global Strength value and its curve in the Pose Morph tag cannot be exported, it is multiplied by the other strength values.
- Pose Morph Animation curve type and global Strength: Same as the two notes about curves above, the animation curves of a Pose Morph tag are exported as Linear/Step only if all their keys are set to Linear/Step interpolation. If the global strength curve is set to Spline interpolation while the rest are Linear/Step, the interpolation type will be Spline, even though the global strength isn’t exported.
Skin Animation Joints Structure: When using the Joint Tool in Cinema 4D, null objects might be created automatically. Please remove them from the hierarchy prior to exporting.
- Skin Animation Weights: in glTF 2.0, a vertex may be assigned up to 4 weights by 4 joints only! If more than 4 joints influence a vertex, the 4 that assign the largest weights will be exported as the influencers of that vertex.
- All limitations and notes that apply to TRS animations apply also to Skin animations.
- If your exported skin animation doesn’t look right, you can now try baking it, enable Export Skin Animation
and Bake Animation together and specify number of substeps if needed
glTF_Exporter1.000x283854 (1.5 MiB)
glTF_Exporter1.000x279707 (1.5 MiB)
glTF_Exporter1.000x279138 (1.3 MiB)
glTF_Exporter1.000x276286 (1.2 MiB)
glTF_Exporter1.000x271322 (940.5 KiB)
Cinema 4D R20
Simply unzip the downloaded archive into the “plugins” folder.
Provide your bug reports, test scenes or ideas by writing an email to labs-at-maxon-dot-net