smix8 / GodotAnimationRetargeting

Animation Retargeting module for Godot Game Engine
MIT License
129 stars 9 forks source link

Animations with No Skeletons #25

Closed stryker313 closed 3 years ago

stryker313 commented 3 years ago

I'm attempting to bring over certain Unity animations, and wanted your input. Basically, here are some animations.

Paired_PushShove_Att.zip

If you import it into godot, you wont be able to see anything, but if you play the animation player, the keyframes still contain all the rotation scale and position data: its just that there is no skeleton. The data is correct. For a better representation, import it to blender.

My thought is that since each node corresponds to a bone, and since the bones and nodes use the same rot,pos,and scale, that it would be possible to copy these values into a new animation that corresponds to bones instead of nodes (Basically, instead of retargeting from skeleton to skeleton, it would be "extracting" the data from the node keyframes, and putting them into an a new animation) We would probably need a dictionary with custom mapping of the node/bone names, but I think its feasible.

My question is how doable do you think it would be to make a tool that could copy the data from these keyframes into a skeleton? Is it something that can be incorporated with this tool, or should it be its own thing?

I'm thinking of potentially building my own tool in GDscript using your addon as a basis for this idea, but I wanted your input. You've worked with godot animations more extensively than I have. Take a look and tell me what you think.

smix8 commented 3 years ago

In theory it is possible to convert any Transform animationtrack to a Skeleton Bone Transform animationtrack.

Godot's Transform animationtracks don't care if it is a Node3D or a Bone that you are trying to move as long as the animationtrackpath points to the correct target.

Converting all transform data so the transforms work relative for skeleton and bones will be a lot of work, don't know how feasible that is, I wouldn't want to do it and rather import to Blender and back to Godot in a proper Skeleton format to avoid this step.

Also without a skeleton model designed for the animation bone movement you are missing the correct weightpainting for you meshes so just the animationdata will create very odd looking deformations even with technical correct keyframes.

stryker313 commented 3 years ago

I agree. For these particular anims, how would you go about applying a skeleton? That would circumvent the need for said tool.

smix8 commented 3 years ago

Imported into Blender the fbx file is just a bunch of empties with trackpositions that can't be exported in a better format or used in most retargeting addons. In this situation I personally wouldn't invest any time trying to fix these animations as it would required to much time while still being stuck with an incompatible skeleton and meshes.

stryker313 commented 3 years ago

Gotcha. I am considering contacting the author and seeing if he can port them instead.