1
$\begingroup$

I understand how to create animations, but can't seem to find a good tutorial on how to create, name, and export multiple animations into Wavefront OBJ. Do you know of any or can you please explain?

This going to be exported and loaded using jMonkeyEngine3 and Wavefront OBJ as file type.

I tried using the DopeSheet in Action Editor mode, but it doesn't seem to export even though I had two actions and used the Action.use_fake_user.

I am trying to create an Idle, Walk, and Wave_Arm animations just for testing and learning.

Also, is there a way in Blender to check if animations were exported?

$\endgroup$
0
$\begingroup$

Wavefront OBJ is a widely supported file format for 3D models. It can store vertex coordinates, UVs, vertex normals, face definitions and texture vertices (plus additional, but not standard-compliant data in some softwares).

Animations are not supported. The export option Animation in the OBj exporter does not really export an animation, but an OBJ for every frame in your scene. So it's really a series of OBJ models. Some engines may support this for animations.

As said, the addon uses the scene, so the current timeline. Every object can reference not more than a single action. Therefore, only that one action is exported. Batch export of all actions is not supported.

It would be trivial to do code-wise, but we lack an essential information: which action belongs to which object? All actions are stored globally (bpy.data.actions in python). For which objects an action works, is not stored. You can "run" an action on any object, e.g. matching bones in another, different armature will be animated too.

Thus, you need to switch actions on your animated object, change start and end frame on your timeline and export them one by one. Or adapt the export addon to batch-export all actions for the active object (you may use Action.frame_range to determine the keyframed boundaries).

You can check the export by either inspecting the output folder, or by checking the system console (on Windows, it's as easy as Window > Toggle System Console):

OBJ Export path: 'C:\\Users\\CoDEmanX\\Desktop\\untitled_000249.obj'
OBJ Export time: 0.00
OBJ Export path: 'C:\\Users\\CoDEmanX\\Desktop\\untitled_000250.obj'
OBJ Export time: 0.00
$\endgroup$
  • $\begingroup$ That makes a lot of sense. Well I guess I will have to make the OGRE exporter work... - On a side note, so then how am I suppose to have multiple actions exporter? (OGRE of course) With the way you say it... it seems like one would have to multiple copies of the same model in order to access different actions. $\endgroup$ – user290831 Feb 9 '14 at 16:27
  • $\begingroup$ An export script could change the active object's action (Object.animation_data.action = ...), basically iterating over all actions and export every frame in the keyframed boundary (either exporting single OBJs and Scene.frame_set(), or change Scene.frame_start and Scene.frame_end and use Animation options ot export the entire timeline with a single call to bpy.ops.export_scene.obj()). An additional function could check the actions' data_path properties and try to figure out, if an action works for the object you want to export. $\endgroup$ – CoDEmanX Feb 9 '14 at 18:42
  • $\begingroup$ I am not talking about OBJs... I am talking about OGRE... .mesh.xml. W/e ill accept since you basically pointed me in right direction. $\endgroup$ – user290831 Feb 9 '14 at 23:48
  • $\begingroup$ My bad. Exporting single models using frame_set() to advance should work with all exporters, just change the bpy.ops call. $\endgroup$ – CoDEmanX Feb 10 '14 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.