Fixed bug that resulted in vertices being weigthed to the wrong bones.

This commit is contained in:
Daan Vanden Bosch 2019-07-03 11:35:57 +02:00
parent 7da5505124
commit d982c6b1c9

View File

@ -158,7 +158,7 @@ class Object3DCreator {
bone = parent_bone; bone = parent_bone;
} else { } else {
bone = new Bone(); bone = new Bone();
bone.name = (this.bone_id++).toString(); bone.name = this.bone_id.toString();
bone.position.set(position.x, position.y, position.z); bone.position.set(position.x, position.y, position.z);
bone.setRotationFromEuler(euler); bone.setRotationFromEuler(euler);
@ -175,6 +175,8 @@ class Object3DCreator {
this.model_to_geometry(object.model, matrix); this.model_to_geometry(object.model, matrix);
} }
this.bone_id++;
if (!break_child_trace) { if (!break_child_trace) {
for (const child of object.children) { for (const child of object.children) {
this.object_to_geometry(child, bone, matrix); this.object_to_geometry(child, bone, matrix);