我正在尝试加载此GBL文件并播放动画。此代码返回以下错误:
TypeError:无法读取Function.CreateFromMorphTargetSequence上未定义的属性“ length”
Combinations
0 (a, f, e)
1 (a, d, f)
2 (b, c, d)
3 (a, a, d)
4 (f, b, c)
5 (e, b, b)
6 (e, e, d)
7 (c, f, f)
8 (f, e, b)
9 (d, c, e)
如何解决此错误并在播放动画时加载模型?
答案 0 :(得分:2)
const morphClip = THREE.AnimationClip.CreateFromMorphTargetSequence('RingsRising',model.morphTargets);
Object3D
的实例没有morphTargets
属性。
从glTF资产播放动画应如下所示:
const animations = gltf.animations;
const mixer = new THREE.AnimationMixer( model );
mixer.clipAction( animations[ 0 ] ).setDuration( 1 ).play();