atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.24k stars 251 forks source link

glb动画设置成Mecanim时 无法循环播放 #291

Closed qq3600605 closed 2 years ago

qq3600605 commented 2 years ago

glb动画设置成Mecanim时 无法循环播放 直接在unity里设置glb的Animtion为Mecanim时,glb里面的动画的Loop Time也未勾选 运行时设置AnimationClip的wrapMode为loop也不行

atteneder commented 2 years ago

@qq3600605 Thanks for the report.

Paraphrasing via Google Translate:

When glb animation is set to Mecanim, it cannot be played in a loop. When the animation of glb is set to Mecanim directly in unity, the Loop Time of the animation in glb is also unchecked. Setting the wrapMode of AnimationClip to loop during runtime is also not working

I'll try to have a look soon

atteneder commented 2 years ago

Quick Fix: You can duplicate the (read-only) imported AnimationClip and edit the copy to be looped

atteneder commented 2 years ago

I have now hard-coded glTFast to set the Loop Time to true.

The glTF specification does not contain a definition for using or looping clips, but at least now it's consistent with legacy clips (where WrapMode.Loop is set hard coded as well).

The better solution would be providing a proper Inspector GUI to customize each and every AnimationClip, but that's a larger endeavor in the context of Editor Import improvements I'll note down.

hth