Urho3D-Blender icon indicating copy to clipboard operation
Urho3D-Blender copied to clipboard

Export Node animations

Open pax7 opened this issue 7 years ago • 7 comments

Hello -

I was wondering if you wouldn't mind adding the ability to export node animations as described in Node animations at the bottom of https://urho3d.github.io/documentation/1.4/_skeletal_animation.html .

There is also a discussion on this topic here: https://discourse.urho3d.io/t/export-animated-node-transforms-to-urho3d/1067/6

pax7 avatar Sep 29 '17 14:09 pax7

Hello, I've briefly looked into it. It is possible, but the code will be a mess (an armature which becomes an object, the objects are is a different space than the bone space, the missing rest position for objects...), so I '''would''' mind a little. Anyway give me some time. Another problem are the 'origin' of the objects and animations: global or local? Say you have a physic simulation and you bake it into an animation, then I think the best choice is to have a local origin for the object (so it has no translation and no rotation) and a global one for the animation (so you have locations and rotations in world space). Is this your use case? Another idea is to use the first frame of the animation as the rest pose and then you can get a local animation... I don't know if it makes sense.

reattiva avatar Oct 13 '17 12:10 reattiva

Would it simplify the process if it worked just like exporting a prefab on a per scene basis with transform = true?

Also, I am not sure I am following the first phrase, are you thinking to automatically add an armature and bones to replicate the object animation with an armature? I have a feeling something like that may be overkill. I know the AssetImporter.exe can process a .fbx which has these animations into a .ani that is supposed to work - only I haven't yet gotten around to looking at the .ani format to see what it is and how to create something from scratch. Also those exported animations have weird names and there is more than one and at least for me, they are not really working consistently.

pax7 avatar Oct 13 '17 14:10 pax7

Ah no, rest assured, I don't want to do that. Time is short, memory is foggy, I'm lazy, so I wanted to reuse the armature code, so where there was an armature or a bone now you'll find a simple object, it's rather ugly. Anyway, just grumbling by myself, don't worry.

reattiva avatar Oct 14 '17 15:10 reattiva

Check the objanim branch. Select Animations but not Skeletons, set Origin=Local. If you have selected multiple objects with animations and you export the Timeline, then only one animation is created with an object per track.

reattiva avatar Oct 22 '17 22:10 reattiva

Thanks! I'll give it a shot and let you know.

pax7 avatar Oct 23 '17 00:10 pax7

The Timeline works only with 2 objects, easy to fix. There is still work to do.

reattiva avatar Oct 23 '17 06:10 reattiva

Merged. @Mike3D sorry, this will mess up your work.

reattiva avatar Nov 05 '17 17:11 reattiva