Now let's have a look at how you can export an animation so that you can use it in Atoms Crowd.
The animated skeleton joints will need to have all the tags we set up when we exported our Agent Type files to export your animation correctly. The joints need also to have the "bind pose attributes" set correctly.
For this reason, we are going to start this task by opening the scene you saved when exporting the Agent Type files. You can also open the AtomsRobot.ma scene as it has all the attributes already set correctly.
Once you've loaded the file, we are going to import the atomsRobot_walk.fbx file from the data folder.
注意 |
---|
Please make sure:
|
注意 |
---|
Scale compensating is not supported (as in Maya). If you scale a joint all its children will be scaled. |
The Animation Exporter Tool
You can open the skeleton and animation exporter tool using the shelf button or the menu. You can also open it via the Atoms menu: Atoms > Export > Skeleton/Animation Exporter
The Skeleton Exporter GUI will pop up. Make sure to select the "Animation" tab at the top of the GUI.
The workflow here is pretty similar to exporting skeleton and mesh definitions.
You'll have to select your "Root Joint", the "Hip" joint.
Then select the file type for your animation. Currently Atoms supports fbx and atomsclip. While FBX are more portable, atomsclip is more optimized to work with Atoms.
Then select a file path.
Now the "ground height". Atoms needs to know when the feet of your clip are touching the ground. The "ground height" field tells the exporter what is the height of the virtual plane your clip is walking on.
If your clip has the feet travelling just above the XZ plane and a value of 0 for the ground height is acceptable.
In our case unfortunately it is not. The robot feet are constantly moving below the XZ plane.
We are going to find the right ground height for the RightToeBase joint. First we need to find a frame where the foot is down, any frame between 22 and 34 will be fine (scene should be set to 30fps).
Then you can create a locator or a plane and move it from the front camera until it approximately matches the foot tip of your right leg, the RightToeBase joint. The value you're looking for is the Y axis translation of your locator/plane. In this case a value of -76 will be fine.
The "foot threshold" is the error approximation value for your ground height. In this case a value of 0.5 will be fine.
We will come back to the "Data from scene" later in this page.
Finally the "Images" section. You can export a thumbnail preview with you clip. This is extremely useful later on when setting up your animation clips. If you decide not to export a thumbnail preview just uncheck "Export images".
Please place the "source camera" in a way it can record the entire animation. You could even point constrain it to the "Hip" joint.
When "Export images" is on a tar file containing the the preview images will appear in the same folder of your clip file.
注意 |
---|
The exporter will use your time slider start and end frame as frame range. For this example you should set it to 0-55. |
注意 |
---|
By adding a vector type attribute called "atomsClipDirection" on your root pelvis joint you can set a clip direction before exporting. The direction will stored in your animation clip file (i.e. fbx) and you can then use it later by setting your animation clip direction type to "Clip" in the Atoms UI. |
Checking your clip
Now let's import the fbx we just exported on our scene, select our RightToeBase joint and open the graph editor.
By selecting the "Atoms Foot On Ground" attribute, you should see something like in the first picture.
This attribute holds the data that represents our "foot down" state for this foot. If you scrub the time slider while checking this animation curve and the robot animation, you'll see the curve key frames reflect pretty well the down state for the foot.
In cases like in the second picture, you can see that there is a spike between frame 60 and 80. In this case you can set the value for that key frame manually, then reopen the Skeleton Animation Exporter and tick the "data from scene" checkbox. After exporting with the GUI, if you check your clip again, the foot on ground attribute should be fine.
注意 |
---|
Please don't export manually the FBX after editing the foot down curves. Some other values (cached at export time) are re-evaluated every time you export. Exporting the FBX manually could lead to unpredictable results. |
注意 |
---|
It is not currently possible to import an atomsclip file directly in maya. Atomsclip files should only be used with Atoms. |
Add custom data
If you want add some custom data to some joints please check the Adding custom metadata section