gpt4 book ai didi

javascript - Threejs : PropertyBinding: Cannot parse trackName: . 骨头[].position

转载 作者:行者123 更新时间:2023-12-03 02:24:01 24 4
gpt4 key购买 nike

版本:THREE.WebGLRenderer 91dev

我正在尝试为胸部打开制作一个简单的动画,以便在 Three.js 中工作,但在尝试创建操作时不断收到以下错误。

PropertyBinding: Cannot parse trackName: .bones[].position

动画 JSON 对象的完整版本位于 Pastebin 上:Full JSON String 。简短摘要如下:

{
"name": null,
"fps": 30,
"length": 0.5333333333333333,
"hierarchy": [{
"parent": -1,
"keys": [{
"time": 0,
"rot": [
0,
0,
0,
1
],
"scl": [
1,
1,
1
],
"pos": [
0,
0,
0
]
},

我使用以下命令创建一个动画剪辑。

    var clip = THREE.AnimationClip.parseAnimation(animation, armSkeleton.bones);
geometry.animations.push(clip);

clip的值如下:

duration: 0.6
name: "default"
tracks: […]
0: Object {
name: ".bones[].position",
times: […],
values: […],

}
1: Object {
name: ".bones[].quaternion",
times: […],
values: […],

}
2: Object {
name: ".bones[].scale",
times: […],
values: […],

}
3: Object {
name: ".bones[].position",
times: […],
values: […],

}
4: Object {
name: ".bones[].quaternion",
times: […],
values: […],

}
5: Object {
name: ".bones[].scale",
times: […],
values: […],

}
length: 6
__proto__: Array[]
uuid: "3E37E10B-74D0-4421-92AF-7A366CF3804F"

问题是当我尝试使用剪辑时:

mixer = new THREE.AnimationMixer(mesh);
mixer.clipAction(mesh.geometry.animations[0]).play();

我收到错误,认为 Threejs 无法解析轨道名称“.bones.position”,即使这是 parseAnimation 函数返回的名称?我非常困惑,如果有人能指出我正在做的一些愚蠢的事情,我将不胜感激。

最佳答案

在解决了这个问题之后,我发现错误的原因是因为 AnimationClip 期望骨骼被命名。因此,只需在将每个骨骼传递给 THREE.AnimationClip.parseAnimation 之前给每个骨骼一个唯一的名称,就可以设法消除此错误。

关于javascript - Threejs : PropertyBinding: Cannot parse trackName: . 骨头[].position,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49033022/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com