Last updated April 10th, 2019
In this release
- Morph Animations support added
- Scaling option added
- Editor mode support added
- asset.generator string added
- Single animation object
- Mipmaps support
- Bug Fix: animation curves weren’t sampled correctly when baked
- Bug Fix: Flip Z produced wrong orientation
- Bug Fix: animation curve with only 2 keyframes wasn’t getting baked
- Bug Fix: Linear interpolated curves exported as spline
- Bug Fix: Exporting TRS/Pose Morph Animation where first/last frame’s time is a number with more than 3 decimals after the point, and a curve is missing in the animation editor, resulted in an error when baking option is enabled
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.
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.
- Bake Animations: Bake every frame of animation.
- Substeps: Number of substeps to sample between each two frames.
- Flip Z: Switch from Left Handed to Right Handed System.
- Export as Binary(.glb): Export glTF file in its binary form.
The Texture Mode of the gltf file is defined by the Texture Mode option in Preferences>OpenGL, select between Nearest, Linear and Mipmaps.
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.
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.
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.
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.
Cinema 4D R20 and higher.
glTF_Exporter1.000x276286 (1.2 MiB)
Last updated April 10th, 2019
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