What do these Animation objects in Outliner represent? I want to export a model as DirectX .x format and retain the armature and animations. It's partially/sometimes working but not consistently. I have the checkboxes in the exporter checked to export animations, export separate AnimationSets, export unused animations, and the "export selected objects only" unchecked. My animations are separate Actions within Blender under dope sheets.

My model has 2 animations. Sometimes the exported file has 2 AnimationSets (which are what the animations are called in the .x format) and sometimes 3. One of them always has only 1 Animation sub-section that contains {Armature} (the name I gave to the blender object containing the armature and mesh). The others are the animations I want to export and contain Animation sections for each bone (sometimes there is only one of these AnimationSets.)

I think this has something to do with the following screenshot of the outliner:



There is an Animation on the main section of the object and another on the mesh. These get out of sync, and I'm not even sure the correct way of setting one or the other or what each of them are. I also notice that changing one of them sometimes doesn't change what animation is played in Blender. What are each of these supposed to represent and how do you set each of them? If I knew what they were I could probably figure out how to consistently export all animations.

In the screenshot, Sphere is the mesh and Armature is the mesh parented to the bones (sorry for poor naming, right now I'm just trying to get it to work.)

I'm using Blender 2.77a.
Blender records animation data into an action. Each object can have one active action which receives the keyframes when you use insert keyframe for a property or group of properties like LocRotScale when inserting keyframes in the 3DView.

When the dopesheet is in the Action Editor mode, the active action is visible and this action name is the first item visible under Animation in the outliner. You can change the active action and create more actions here.

While only one action can be active, which is the one being edited, we can create multiple actions for each object and use the NLA Editor to merge them into a larger animation. The tracks and actions added to the NLA Editor are then listed below the active action in the outliner. The combination of actions in the NLA is what you see in the 3D viewport. Note that actions can be muted in the NLA as well as individual channels in the dopesheet and graph editor, also the active action may not exist in the NLA but will be added to the animation in the viewport.



It's isn't too hard to get mixed up when using the NLA. Let's say you create an action that contains animation from frame 1 to 20. When you place the action in the NLA you can re-position it so that it plays from 50 to 70. If you then re-select the action so it is the active action again, as the active action it will play back from frames 1 to 20 and will not play from frame 50 as set in the NLA. This would be the cause of the out of sync animation while exporting. To fix this, select your mesh and remove the active action from the action editor.

With just a quick look at the export_x script, it changes the frame and exports the location/rotation as read from each object at that frame, this should match what you see in the 3D viewport when playing the animation.

I would expect the best results will be achieved if you remove the active action and only use NLA when exporting.