In this section we will focus on the basics of how to export assets. You should be aware that when we are describing broad terms which are interchangeable with 3DS Max and Maya we simply refer to all three as Digital Content Creation tools or in short, "DCC".
This article assumes that the user knows the basic functions of digital content creation (DCC) tools. It is not intended to teach the user the basics of their DCC tools, but rather the exporter basics with our tools and plugins.
Exported File Types
Crytek Geometry Files (.CGF)
- Select the static asset node (poly geometry) that you wish to export and add it to the Object Export list.
- From the drop-down list of file types, select CGF.
- Save the 3ds Max scene to your CRYENGINE build directory like:
- In the Object Export panel in the Exporter UI, click Export Nodes.
The Merge All Nodes option is supported for CGFs.
Crytek Skinned Character Files (.CHR)
- Select the skinned node that you wish to export. The skinned node should be weighted to a bone hierarchy by using CrySkin modifier.
- Save the 3ds Max scene to your CRYENGINE build directory like:
- In the Object Export panel in the exporter UI, click Add Selected (if the object list is not empty, click Clear to empty it).
- Check that the root bone of the skeleton is displayed in the Bone list inside the Bone Export panel in the exporter UI.
- In the Object Export panel in the exporter UI, click Export Nodes.
The Merge All Nodes option is not supported for CHRs.
In 3ds Max you can use any node to be a bone in the Engine. We implemented a Ignore Dummies function which you can turn on and off for the export. It is a good way to exclude some of the bones that you maybe just use in 3ds Max but do not want to export to the Engine.
A common mistake is that a dummy used to be the main root of the hierarchy with the Ignore Dummies function turned on while exporting and it will not export the asset since it is the root of the structure and will break before export. Just make sure for each asset if you use a dummy and it is part of your structure that you do not tick the checkbox Ignore Dummies.
This cylinder has 5 bones and all are linked in a hierarchy starting from the root bone. We are using our CrySkin modifier to make sure that we got the same preview of the skinned geometry in 3ds Max and the Engine.
If you use the Skin modifier you will notice differences in the animated skinned geometry so make sure to use CrySkin instead.
The geometry itself is not linked to the hierarchy of the bones, it will just be connected with the skinning information to each bone.
To export the .chr file just make sure to save your 3ds Max scene to a directory in your build structure like:
Under the Utilities tab you can add our CRYENGINE Exporter to get access to the exporter plugin.
Now add the cylinder geometry to the Object Exporter list and switch the asset type to .chr file.
In our case we named the character "Cylinder" so we want to hold that name without overwriting it. We basically check the tickbox to Export File per Node and do not use a custom file name, this will provide the same name of the node from 3ds Max and later on in the Engine. If you want to overwrite the name and use a custom one just check the box and set a destination directory for the final export.
Next to the Object Export list you can also see the Bone Export list. It will always show the root bone from your hierarchy by default which will be the bone named root in our case. Press the blue Export Nodes button and the .chr file will be exported to the directory of the 3ds Max scene or the custom changed destination.
Crytek Animated Geometry Files (.CGA)
Try to setup a 3 box chain, for example:
The first thing you need to do is change all the motion interpolation splines to TCB.
Manually Changing the Motion Curves to TCB: Select the object and click thewheel motion from the menu on the right.
Next, locate the Assign Controller option box pictured above. Click the Position channel, and then click the info button above it. This will bring up the interpolation options for the animation curves that you have selected.
You will need to convert all the motion curves to TCB.
For Maya Users:
Setting TCB rotation is not necessary in Maya as the tools handle it automatically if needed.
You will need to open the info for all the three channels, and then click Make Default, which displays the Assign Controller dialogue box.
Click Yes and repeat the process for every channel of every object that you are going to be exporting. You need to change all the motion interpolation splines to TCB.
You can apply now a basic animation to each of the boxes, the animation will be exported within the .cga and will be called "default".
If you want to export more then just the default animation refer to the description of Animation files (.anm) files.
A quick way to test your .cga asset will be to load up the editor and pick the Entity -> Physics -> AnimObject from the RollupBar drag it into a level and change the model type to your fresh exported .cga
Under the animation tab of the AnimObject entity properties you will see the features for the entity. Make sure to set these values to play the default animation for your .cga:
- Animation = default (the default animation is stored in your .cga file)
- Loop = true
- Playing = true
Animation Files (.anm)
- Select one or more of the moving objects from the CGA set that you just exported and click Add Selected.
- Make sure that the Export To drop-down list is set to Animation for cga (.anm) and again click Export Nodes.
- Repeat the process for every animated part of the CGA set.
Character Animation Files (.CAF)
- In the Bone Export panel, select Bip01 and ensure that the Ignore dummies check box has been deselected.
- Now, click Export Bones and a dialogue box will be displayed, which will prompt you to specify where to export the file.
Material Files (.mtl)
The .mtl file will be exported from the DCC tool using our Crytek shader which comes with the exporter plugin. 3ds Max uses an ID based system, that means you can change IDs on each face for your asset and assign a sub material with the same ID number.
The default material name will be stored in the exported asset. This is important, the material with the name that you assigned to the asset will be the default material name that the asset is looking for in the Engine. You will notice that the cube has the name Box01 and the material which is assigned to the asset is called "Material_explain". The exporter will use the assigned name of the material while exporting the asset. While exporting the .mtl file make sure that you copy your assigned material name and paste it into the save dialogue of the exported .mtl file to make sure that you avoid any spelling mistakes.
Crytek UI in 3ds Max
See CRYENGINE Exporter in 3dsMax for more information.
Crytek UI in Maya
See CRYENGINE User Interface in Maya for more information.