提交 1dadcc88 编写于 作者: P Peter Ehrlich

Add error for invalid skinIndices or skinWeights import data lengths. Fixes #4421

上级 5364f0e4
......@@ -452,6 +452,14 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) {
}
geometry.bones = json.bones;
if ( (geometry.bones.length > 0) && (
(geometry.skinWeights.length != geometry.skinIndices.length) ||
(geometry.skinWeights.length != geometry.vertices.length) ) ) {
console.warn('When skinning, number of vertices (' + geometry.vertices.length + '), skinIndices (' +
geometry.skinIndices.length + '), and skinWeights (' + geometry.skinWeights.length + ') should match.');
}
// could change this to json.animations[0] or remove completely
geometry.animation = json.animation;
geometry.animations = json.animations;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册