glTFast icon indicating copy to clipboard operation
glTFast copied to clipboard

Animation clips get assigned to all scenes

Open atteneder opened this issue 2 years ago • 1 comments

Problem Description

A glTF that contains multiple scenes and animations potentially creates problems :)

All animations are assigned to every scene instance. Assuming the node hierarchy of scenes is different, animation clips from other scenes don't make sense and worse: will not work.

Will post demo files soon.

Expected behavior

Ideally each scene instance contains only the animation clips that affect its nodes.

In glTF animations are assigned to nodes directly, so we have to figure out animation clips' scene some way, which is tedious.

Desktop (please complete the following information):

  • glTFast version 5.x (upcoming)

Issue was found while developing #320

atteneder avatar Jun 30 '22 13:06 atteneder

Hi. @atteneder If you have two or more animations in one scene only one will be played after loading that scene. gltfast makes one animation component on scene root and adds all animation clips to it, but because of animation component has one clip slot it plays only one clip. I tried to disable "Group by NLA Track" option from blender export options, but because animation paths are fixed (AnimationUtils.CreateAnimationPath) Unity doesn't plays animation in this way too. Is this fixable or is there correct way to export (from blender) animations ?

artyomabgaryan avatar Nov 01 '22 09:11 artyomabgaryan

@artyomabgaryan You mean you're missing a way to pick a particular animation to play (after loading)?

In the upcoming 5.0.0 release you'll have access to the Animation component via the SceneInstance. You should be able to query all animations and play the one you desire. See the upgrade guide

atteneder avatar Nov 01 '22 12:11 atteneder