Skip to content
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

Animation adding/pasting results in wrong animation of AnimationTree #60038

Closed
Dadaskis opened this issue Apr 8, 2022 · 7 comments
Closed

Animation adding/pasting results in wrong animation of AnimationTree #60038

Dadaskis opened this issue Apr 8, 2022 · 7 comments

Comments

@Dadaskis
Copy link

Dadaskis commented Apr 8, 2022

Godot version

3.4.4.stable

System information

Windows 7 x64, GLES3, Nvidia Geforce GT1030

Issue description

Hi! That's the first issue i post at Github :)

I'm trying to make life of animator easier by combining walking and weapon animations from different models. We don't want to make a big animation tree which has all the weapon animations we will use. Instead we want to replace such animations. Sadly our attempt to do that went a bit wrong.

So we are sure that

  1. Skeletons are exact same
  2. Even the models can be exact same, but have different animations

What's wrong? It's easier to show that. This is what we got...
WRONG

And this is what we want to get:
RIGHT

As you see, positioning of arms is completely different. This is exact same models, but one of them has different animation which will be added to the another one.

And this issue is possible to reproduce not only using any code. You can just copy-paste it by hand and it will result like that.

This problem was reproduced at MacOS and Windows 10, by other teammates, so it's not really connected to specific build of Godot.

It was tested at v3.4.2. and there was the same problem

Steps to reproduce

  1. Open the project
  2. Open "res://reproducing.tscn" scene
  3. Run this scene

There is actually one more way to do that, without code.

  1. Open the project
  2. Open "res://assets/pistol_anim/pistol_0_test_anim.glb" model (choose "Open Anyway")
  3. Pick "AnimationPlayer" node
  4. In animations window pick the "weapon_idle" animation
  5. Copy it
  6. Open "res://assets/base/human_anims.glb" model (choose "Open Anyway")
  7. Pick "AnimationPlayer" node
  8. Paste animation

As result it pastes the animation wrong.

Minimal reproduction project

Animation Combine Problem.zip

@Dadaskis Dadaskis changed the title Animation replacement results in wrong animation of AnimationTree Animation adding/pasting results in wrong animation of AnimationTree Apr 8, 2022
@Calinou
Copy link
Member

Calinou commented Apr 8, 2022

@Dadaskis The minimal reproduction project didn't upload (likely because you clicked away from the text field while it was still uploading). Try editing your post and upload it again.

@Calinou Calinou added this to the 3.x milestone Apr 8, 2022
@Dadaskis
Copy link
Author

Dadaskis commented Apr 8, 2022

@Calinou i've updated the reproduction project

@Dadaskis
Copy link
Author

For those who have the same problem and want to replace animations... There is workaround for you, which can be limiting, but sadly for now we have to pick this way since it's working. You can store each animation in one model and replace animations like that. Luckily we can use LFS

@TokageItLab
Copy link
Member

TokageItLab commented Apr 27, 2022

Is bone rest the same? 3.x uses rest relative values for animations.
The model rest may differ depending on the order of the animations in the model being imported and it might makes different animations.

@Dadaskis
Copy link
Author

@TokageItLab i don't really know how to check that. How to do that?

And just in case also asking a question, how to make it valid if it's not the same?

@TokageItLab
Copy link
Member

TokageItLab commented Apr 27, 2022

@Dadaskis For 3.x, there is a Bone Rest Matrix field in the Skeleton inspector near the Bone Pose Matrix. Or, you can make all Bone Poses Transform(Quaternion(0,0,0,1),Vector3(0,0,0)) and see if there is any difference.

It is possible to copy and paste all Bone Rest Matrixes, but if it is tedious, make sure that the model you are importing has an animation with no animation (e.g. T-pose) imported first; The first animation imported will be different depending on the order of the list of animations in Blender.

@Dadaskis
Copy link
Author

Dadaskis commented Jul 23, 2022

image

After some time i decided to return to this problem. Why? Blender GLTF export takes TOO MUCH time to export all animations. So keeping it as one file only is not an option.

@TokageItLab thank you a lot for your help.

As you all see on the image, this character has T-pose. It doesn't really matter which pose it has, you must follow these steps:

  1. Make sure ALL modifiers have no effect on bone positions. Just disable inverse kinematics and other stuff.
  2. Make sure all of your files exported with the same current action and pose, like i show in the image (all of the files have "_init_pose")

Again, @TokageItLab, thank you. All of the stuff i reported is not a bug. Still, i would like to ask for some sort of warning if rest poses are not the same, probably this can help people.

Also, just a bit of offtopic stuff which is yet connected to this problem. If you work with such stuff, i highly suggest you to make Blender plugin to export character with "_init_pose" action selected automatically

Closing since this is not a bug.

@Calinou Calinou added archived and removed bug labels Jul 23, 2022
@Calinou Calinou removed this from the 3.x milestone Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants