diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-02-22 21:04:37 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-02-22 21:04:37 +0300 |
commit | 80ad5c85bd7b8818ec21f7019241a8f8409aa30d (patch) | |
tree | 94dc2b394a97e7f0d18decb8526aa047cde64055 | |
parent | 641db2198b572aa268012370c1ac8c4b3e62db60 (diff) |
glTF importer: fix morph targets using specific indices list
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_mesh.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py b/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py index b4263e34..3f69a5a2 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py @@ -132,7 +132,16 @@ class BlenderMesh(): shape_layer = bm.verts.layers.shape[current_shapekey_index] gltf.shapekeys[i] = current_shapekey_index - pos = BinaryData.get_data_from_accessor(gltf, prim.targets[i]['POSITION']) + original_pos = BinaryData.get_data_from_accessor(gltf, prim.targets[i]['POSITION']) + + tmp_indices = {} + tmp_idx = 0 + pos = [] + for i in prim.tmp_indices: + if i[0] not in tmp_indices.keys(): + tmp_indices[i[0]] = tmp_idx + tmp_idx += 1 + pos.append(original_pos[i[0]]) for vert in bm.verts: if vert.index not in range(offset_idx, offset_idx + prim.vertices_length): |