作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
版本: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/
版本:THREE.WebGLRenderer 91dev 我正在尝试为胸部打开制作一个简单的动画,以便在 Three.js 中工作,但在尝试创建操作时不断收到以下错误。 PropertyBinding
我是一名优秀的程序员,十分优秀!