AnimationTree and AnimationPlayer with imported .glb file

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By spinland

I’m trying to make it so that I can reimport my player model every time I add new animations easily. I think the way to do that is to NOT make a new scene from my .glb file but to just ‘link’ the glb inside my Player scene. Below shows “Arms” which is my player .glb which has an AnimationPlayer inside it.

How can I link the Player’s AnimationTree to that ‘inner’ AnimationPlayer located inside my .glb scene? Or is there a way to put an AnimationTree inside my “Arms” scene (the imported .glb file) but make it so that when I update/reimport “Arms” it doesn’t remove the AnimationTree but updates all changes to internal animations and model changes?

Any help would be great! Thanks!

:bust_in_silhouette: Reply From: Inces

Try to right click parent of your linked .glb asset and choose “Editable Children”. If I remember correctly this should not disturb connection between .glb and scene on eventual reimport. It is used mainly for connecting signals and picking references, so connecting to AnimationTree this way should be good idea.

I don;t know if this helps in this partciular example, but You can also choose to import animations as separate files, instead of them being built in to mesh.

:bust_in_silhouette: Reply From: spinland

Thanks, Inces, but I was able to get it working by doing this:

  • Make multiple animation actions in Blender
  • Tell Godot to import .anim files (so that it imports the animations separately)
  • Made a new AnimationPlayer under my KinematicBody and loaded each animation
  • Linked the new AnimationPlayer to my Arms root
  • Linked the AnimationTree to AnimationPlayer

This allows for the animation stuff to be decoupled from the actual .glb file which means I have to reimport for changes and if I have new animations, I have to add them in the AnimationPlayer but the Arms are updated correctly and everything stays good and the new animations/changes are added/updated.

ehm ok, but ins’t it basically what I told You in second paragraph of my answer ? :wink:

Inces | 2021-12-03 18:15

Oh. I didn’t see that part. I had already gotten it working before the Q/A posted my question (I guess they check post before making them public) so when I saw yours, I only skimmed and the first paragraph kinda confused me. But yes, the multiple animations was the way! Thanks :slight_smile:

I am now struggling on getting the move_and_slide() to STOP ON A SLOPE lol it’s killing me, that problem.

Godot is fun, tho. I like it better than Unity and Unreal.

spinland | 2021-12-03 20:25