Made GLTF importer consistent with FBX importer and implemented proper support for root motion. #877
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.

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

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