Skip to content

Conversation

@XtroTheArctic
Copy link
Contributor

This PR fixes the issues #869 and #872 by making GLTF importer consistent with FBX importer (by adding animator creation with applyRootMotion = true for non-humanoid models) and by implementing proper root motion support for the imported avatar (by adding root node selection).

As I mentioned here #872 (comment), unfortunately we can't create AnimationClip with proper mecanim animations (muscle movements) as FBX importer does so, this PR doesn't provide any solution for importing root motion animations. This PR is only for setting up the non-humanoid model and its avatar for root motion support so the user can apply their root motion animations via different ways (My personal way is about importing the animations as FBX then applying them to GLTF model).

With this PR, now the user can specify a root node name for non-humanoid models.
image

When a valid root node is specified by the user, the importer adds an Animator to non-humanoid model with applyRootMotion set to true.
image

This PR also makes sures that an Avatar gets created for non-humanoid models which is essential for root motion.

@robertdorn83
Copy link
Collaborator

hey, thanks for your work!!
do you have a working example to test with?

@XtroTheArctic
Copy link
Contributor Author

Here is the horse model. When you properly import this by entering the valid root name "CG"...

  1. You can see the created "HorseAvatar" sub-asset inside of Horse asset.
  2. Read-only Animator component on the Horse asset will have its Avatar property set correctly and Apply Root Motion property will be checked.

These are crucial for root motion animations to be played on the non-humanoid GLTF models correctly.

Horse.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants