-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement AnimationLibrary resource and respective importer #4296
Comments
For me the most important aspect of the design would be the ability to transfer (import or update existing) single animations between a 3d app and Godot, without the need to transfer all of the model's animations each time. Use case: a player character model could have hundreds of animations, and the transfer process can include the baking of animations from a control rig to a game rig in the 3d app, or just exporting DAE,GLTF,FBX with hundreds of animations can be slow, making the process of updating the animation in the 3d app to seeing it in-game slow as well. |
@PLyczkowski It sounds like this is something that would need to be figured out on the 3D app side. Still, with this at least you could divide them into groups (like walk, run, attack), work them out in separate files and export them separately. |
Oh, wouldn't this allow for doing composite animations? ie dishonored style executions? |
@reduz I agree that the animation files make it possible to handle it as a stand-alone file. However, I do not quite understand what the AnimationLibrary is all about. At least with the current Godot, it is possible to handle animations separately as In a previous discussion with you, you said that an animation must always have a set of skeletons from which the animation is created, does the AnimationLibrary always have skeletons? I disagree with that since Humanoid animations in Unity and VMD in MMD (3D motion software) are supposed to handle pure animation and mapping only, almost independent of the original Skeleton. I expect/need the following things from an AnimationLibrary:
|
As someone who has recently worked with animation in Godot 4, this is needed. There is currently an arcane process of pushing all available animation tracks from Blender into the NLA editor in proper order, hoping your tracks are stowed correctly, then exporting to glTF file in the hope that it will all work correctly on the other side. Blender's animation data system (data blocks and fake users, etc) adds a level of complexity and obfuscation to this as well, meaning sometimes you will get animations that are overlapping and on the wrong tracks. It's a mess, and adds time to an already arduous process. Then, you have other DCC tools like Maya that have a variety of proprietary solutions (bone weighting, etc) that never import correctly in .FBX format. Having spent 20-30 hours importing various animations from other places and trying to make them Godot compatible, I can suggest some things:
Character <----- Skeleton <---- AnimationLibrary<--- Multiple or Individual animation tracks from different files. So, I can have multiple animation libraries for different characters built on the same skeleton. An example of a workflow would be something like this: https://nilooy.github.io/character-animation-combiner/ - Importing a .glb or .fbx works regardless of how many animations are in the file, as long as bones / skinning are the same. Also, granular control for importing / tweaking one animation would be helpful. I know it's planned for Godot to be able to animate within the editor, but most of us still use DCC tools. |
I agree vehemently. And that is one of the things we have been experimenting with lately, and we already know that it is possible by recording as animation the pre-calculated values using the bone rests of the model. |
The problem is two fold:
In practice, there is not much of a point in managing imported animations as single files, and there are not really popular file formats that one can import standalone animations. |
There are two levels in which we are trying to make this happen:
|
When I get animations from mixamo, or extracted from another engine's asset store, I usually get the mesh and multiple LODs in one FBX file, and all of the animations in many separate FBX files. These are quite common. What I currently do is:
We have to go through much of this process every time we make a new iteration of models, and take careful steps to avoid broken animations in Godot due to its inflexibility. It's time consuming. Our player model has over 200 animations right now. Anything to make this process smoother would be great. I'd like to be able to directly import a single or many animated armature FBX files without mesh data and apply them to a model that has already been imported and set up, without requiring importing the whole package again. E.g. I have an animated character already set up, then I download 10 more animations from mixamo with the same rig, and just add them in Godot without a hassle. Or I bring in an FBX dump from an asset kit I bought, which contains a model and 30 animations as separate FBX files. And they are easily combined together. In blender its done automatically on load for the same rig. One the animation data is loaded, you can click your rig, then any animation and play it. |
@reduz Personally I think you should work on reusing animations on similar/same skeleton models before you work on a complete retargeting solution. There are many available (and sometimes free) tools that can do retargeting . It would be nice to be able to automatically retarget like UE4, but from a workflow perspective (and code complexity / corner case management perspective, I would think) the former is much more valuable at the moment. @tinmanjuggernaut This is exactly what I was doing in my use case scenario, PushDownAll was a godsend (This is a Blender problem, not a Godot problem). The ability to import multiple one-take files is probably the most valuable workflow related development. |
Retargeting across different rigs has been super unreliable in every software tool I've tried, except for UE4. It's nice to have in Godot, but only if it works reliably and universally. I wouldn't hold up 4.0 for it. If you are going to spend any time on it, I would study the UE4 workflow (eg cc3->ue4) and only do it if it will support any skeleton to any skeleton, plus universal and individual bone transformation options for troubleshooting and a debugging tool. I get animations from Mixamo, UE market place, Unity market place, Character Creator 3 Actor Core, sketchfab, or custom made in Blender or Maya by me or my team. They all come on different rigs. It is acceptable to me to dump it all in UE4 and retarget there as they have the most robust, battle tested tool. Retargeting aside, this proposal is definitely needed. I'm hoping to add real world context. In summary that is the ability to import, (re)connect, modify, and export animations on the same rig easily: I should be able to remove Blender entirely from my workflow above. Meaning I can import either:
and then combine into one model, and move the animations all around in Godot like I can with meshes once they're imported. No matter how I get the animations and meshes into Godot, I can mix and match and move around, edit, duplicate, reconnect to other rigs and other meshes, import additional animations or meshes later, and gltf export, as long as it all has an identical rig. |
This is something that has bugged me a lot..and slows down my workflow considerably... When you end up with a complex node setup for your player and realize you've forgotten an animation, or one is corrupted...you need to re-import and do the setup all over...even worse if you set variables in the individual animations. |
This is interesting, I already worked a hackish solution to have separate mesh from animation data, it works, by exporting the rig with all animations as one gltf, and the assets without any animation as another gltf, but with the same rig and later save then as a separate mesh file .res My problem was how to work with separate character parts to a single rig in godot, while allowing each part to be changed at runtime. From blender I exported the rig with a basemesh as gltf with all the animation data, later I skimped the import of the mesh, keeping only the skeleton with all animation data, The character assets I exported as another gltf with no animation data, only the skeleton, skinning and the assets mesh, then on godot I splitted the mesh from the assets to .res files, Later it was a matter of simplying assign the skeleton to the mesh in Godot inspector, I had now assets without animation data following a common rig, |
This sounds like a welcome improvement. I've been using a EditorScenePostImport script to convert an imported GLTF file into a single node AnimationPlayer scene to use as a reusable animation pool. The script is also key and important to be able to rename the tracks paths to remove the old scene paths and point directly to the Skeleton node or parent. |
Implemented by godotengine/godot#59980. |
Not fully implemented yet! |
Added the ability to import scenes as AnimationLibrary * Completes implementation of godotengine/godot-proposals#4296 * Helps if you want to export animations to a separate file (say a GLTF) to avoid re-importing/exporting them every time the model changes. * Helps if you simply want to have animations using a dummy model, which can be shared across multiple models. Creates a secondary scene importer used only for animations. **NOTE**: A new flag for scene importer: EditorSceneFormatImporter.IMPORT_DISCARD_MESHES_AND_MATERIALS has been added, to hint importers that they should skip meshes and animations (and hence make importing faster). It is not implemented in any importer yet, this should be done in a separate PR.
Added the ability to import scenes as AnimationLibrary * Completes implementation of godotengine/godot-proposals#4296 * Helps if you want to export animations to a separate file (say a GLTF) to avoid re-importing/exporting them every time the model changes. * Helps if you simply want to have animations using a dummy model, which can be shared across multiple models. Creates a secondary scene importer used only for animations. **NOTE**: A new flag for scene importer: EditorSceneFormatImporter.IMPORT_DISCARD_MESHES_AND_MATERIALS has been added, to hint importers that they should skip meshes and animations (and hence make importing faster). It is not implemented in any importer yet, this should be done in a separate PR.
A very small thing that just might not be implemented yet: it is pretty important imo to be able to select multiple animations to import into a library. Currently only 1 can be selected at a time. edit: sorry missed discussion elsewhere. |
@tinmanjuggernaut what are the challenges of exporting CC3 or CC4 and then importing into godot? |
@GeorgeS2019 Going from cc3->blender->Godot is fine with pushdownall and gltf, and other notes from my process above. |
@tinmanjuggernaut Just joined your discord. Do you have plan for blendshape facial animation in your game. I just PM u in your discord |
Was this part implemented? I can't find it. The ergonomics of using AnimationLibrary with AnimationTree are not great without this, I basically have to create a fake AnimationPlayer as a workaround |
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
Importing and reusing animations has always been hit or miss in Godot. Currently, animations are only imported when they come bundled in a 3D scene. It is not possible to import animations as a stand-alone mode to reuse between models.
Some improvements happened in 4.0 to improve animation compatibility, and more remain (such as re-targeting implementation), but if animations can't be imported as stand-alone, none of this really matters.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
3D scene container formats such as FBX, GLTF2 and DAE not only contain animations, but they can contain multiple animations. They are the most common and standard way to share animations nowadays and export them from 3D DCCs such as Blender, Maya, etc.
As such, I believe if we are aiming for animation reuse, we are making a mistake assuming that a 3D scene should import single animations to AnimationPlayer (and AnimationTree). Instead, animations should first be imported to an AnimationLibrary, and then this library set into the respective players.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This proposal mainly covers some changes to how animation importing and playback happens in Godot:
On a side note, we should also consider implementing this proposal. This would allow better animation reuse, by allowing nodepaths to animations to refer skeletons directly by having a @skeleton path.
If this enhancement will not be used often, can it be worked around with a few lines of script?
N/A
Is there a reason why this should be core and not an add-on in the asset library?
N/A
The text was updated successfully, but these errors were encountered: