After completing this tutorial, users will understand the various types of animation data available in CryENGINE, and will be able to create their own animations.
An overview of the types of files and their functions can be found in the Art Asset File Types document. There are some specific things about the file types to keep in mind for exporting animations.
As a compiler compiles source codes into a machine-optimized format, the RC compiles raw animation data into an optimized format.
You can find the example asset which is used for this tutorial here: Windmill Example File
1. Firstly you should create some geometry optionally with physics proxies.
6. Create a new animation by clicking the 'New' button in the animation section
To export an ANM file do the following:
1. Animate your groups by creating key frames on the timeline bar where required.
5. Create a new animation by clicking the 'New' button in the animation section
An example Maya scene with an advanced character and locomotive animation setup can be downloaded here: Chr_Animation.ma
In your 3D application, create a few primitives in the scene.
Change the controller types for position and rotation to TCB.
Create an animation for the objects in the scene.
Next, select all the objects and add them to the Object Export list by clicking add selected.
The “Export File per Node” option, located just below the Export Nodes button in the group “Geometry Export Options” allows you to either bundle these three objects together in one CGA file or, when the option is checked, export three files separately. For now uncheck this option in order to only export one file.
Next make sure that the CGA file type is selected in the Export To drop down box.
Press the Export Nodes button. This will export the objects to the same folder that the source file is located in (which should be located somewhere in your game directory).
The file will assume the source file's name unless you uncheck “Export File per Node” and check “Custom Filename”. This will allow you to select a unique name for the file by pressing the 3 dots (…) and typing in the name. This is not, however, available for exporting multiple objects at once using the export file per node option.
To view the asset you need to open your the CryENGINE Sandbox Editor. At the top right of the screen you will see a green icon of a human. This opens the Character Editor.
At the top left of the floating window is the file drop down menu. Click File -> Open and navigate to the folder you exported your .cga file to. After opening the file you should see the object(s) in the 3D view.
Each CGA file contains a default animation that is available from the animation list. Click the name Default to play the animation.
If you have an existing CGA file that you wish to add animations to, or have just completed the example above, this section will explain how to add those additional animations.
Start by creating a second animation for your object within your 3D program.
Navigate to the object export section of the exporter and click Custom Filename.
Click the button below with three dots (…) and type in a filename, using the name of the .cga object you are adding it to as a prefix in the name.
As an example, the test.cga file contains the object you are animating, plus the default animation. In this case you need to name your .anm file test_[?].anm, where the question mark is what you want to call the additional animation.
Press the export nodes button. If the ANM file is located in the same folder as the CGA object, the animation will now be visible in the Character Editor animation list.
Preview the object using the guidelines in the CGA export tutorial above.
A CAF file is a skeletal based animation file that requires a mesh with bones and a weighting modifier applied.
First create a mesh, a skeleton to deform that mesh and apply weights to it with a modifier such as Skin or Physique.
Image shows basic mesh and underlying skeleton:
Now create an animation for the skeleton. Make sure you store your default pose either as a keyed pose at frame 0 or using functions like Set Skin Pose in 3ds Max for example. Clicking the Export Bones button will create the CAF file.
Once this is done you are ready to export an animation. You can either export the entire skeleton or a part of the skeleton by selecting different bones as the root(s) to export from. Start by exporting a full body animation.
Make sure Add related bones and Add whole skeleton boxes are checked on. These functions check for the root of the character and automatically add it to the Bones export list. Select the mesh of your object and click Add Selected in the Object Export section of the exporter.
After doing this you will see the root of your hierarchy automatically added to the Export Bones list. This list only needs to store the root(s) of the chain of bones you wish to export.
Scroll down to the Bone Export area of the exporter. Notice the root bone is listed in the bone export list. Press the Export Bones button and choose a location for the animation. This should be within a path in your game folder so that the animation will successfully pass through the resource compiler. This will make sure that any compression settings you define in the CBA file (Crytek Batch Animation) are used for batch processing files.
A CAF file is a skeletal based animation file that requires a mesh with bones skinned to it.
First create a mesh, a skeleton to deform that mesh then bind them together with a Smooth Bind. Be sure that there are no more than 4 influences used.
Now create an animation for the skeleton. Make sure you store your default pose either as a keyed pose at frame 0.
Click the export button on the `Crytek` toolbar to open the 'Crytek Export' dialog. Then click the 'Add Attributes' button (this adds CryENGINE related information to the assets as needed).
Next you will want to create a new animation by clicking the 'New' button in the animation section.
Click the 'Use Current' button to file out the name and frame information. From there you can use the 'Browse' button and select an export path for your animation file.
Click the 'Add' button.
Finish the process by clicking the `Export Anim` button on the 'Crytek Export' dialog.
Exporting an upperbody animation is much the same as exporting a fullbody animation. You need to select a root of a hierarchy in the skeleton and add that to the Export Bones list manually.
Select the Bip01 Spine bone; click Clear List in the Bone Export options and then Add Selected. This will add the bone “Bip01 Spine” to the node list. You are now ready to export the animation from the Bip01 Spine bone and all of its children in the hierarchy.
Once exported, the animation will only contain the tracks for the Spine and its descendants.
In order to preview the animation you will need to add it to a CAL file (Crytek Animation List). This simple text file defines the animations that your character will use and their location. Below is a basic example:
The #filepath command points this particular file to a folder used only for male animations.
The $Include allows your character to read from multiple cal files. In this example the cinematic animations were separated in a list that is only loaded on demand (so these animations are loaded and unloaded from memory.
The last line is defining the name of the animation and its location in a subfolder of animations\human\male called combat. The name given on the left is what will be seen in the editor and does not have to match the actual animation’s file name.
For the SDK character this example cal file has been added.
Create an example that is similar to the above and replace the name with the name of the animation you created. The cal file must be located in the same folder as your character and have the same name as this CHR file, except with the cal file extension.
When starting the editor using the above example the animation list will display one animation called run or if you replaced the names should show the name you gave the animation. Click to play it.
Repeat the steps above by adding the upperbody animation to the CAL file. Once this is added to the list, start the Editor and open the Character Editor.
Start by first clicking on the fullbody animation in the animation list. You will see the animation looping in the 3d view. Below the Choose Base Character button you will see a dropdown box defining which layer is currently playing.
It should say “Primary”. If not, press the “Stop All” button, select the primary layer and start the animation again.
Next, select the Secondary.1 layer and click on the upperbody animation you exported earlier in the animation list. This will begin to play the animation using the tracks that were exported from the Spine down through its hierarchy. You should still see the legs moving in the same way as the fullbody animation, with the upperbody completely overwritten by the second animation.
This section is detailed in the Facial Editor Reference.