diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-01-03 00:43:32 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-01-03 00:43:32 +0300 |
commit | 8e2f670bc2fe42b98f4c425ee8a5839f0227f2cc (patch) | |
tree | 91feb92fa4f914b59158e609a9e6cb2d1ea95611 /io_scene_gltf2/blender/exp/gltf2_blender_extract.py | |
parent | 06d30213f0cc2246acea9d80073e8105f3ba6685 (diff) |
glTF exporter: various fixes/enhancements:
* enhancement for vertex weights export
* export animation only if checkbox is ticked
* use unsigned short or unsigned int for indices
* Fix T60012 metallic and roughness image export (channels not in same image)
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_extract.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_extract.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py index 87c9d426..0add794a 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py @@ -662,12 +662,16 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp # - vertex_group_index = group_element.group - vertex_group_name = blender_vertex_groups[vertex_group_index].name + joint_weight = group_element.weight + if joint_weight <= 0.0: + continue # - joint_index = 0 + vertex_group_index = group_element.group + vertex_group_name = blender_vertex_groups[vertex_group_index].name + + joint_index = None if modifiers is not None: modifiers_dict = {m.type: m for m in modifiers} @@ -677,12 +681,12 @@ def extract_primitives(glTF, blender_mesh, blender_vertex_groups, modifiers, exp for index, j in enumerate(skin.joints): if j.name == vertex_group_name: joint_index = index - - joint_weight = group_element.weight + break # - joint.append(joint_index) - weight.append(joint_weight) + if joint_index is not None: + joint.append(joint_index) + weight.append(joint_weight) if len(joint) > 0: bone_count += 1 |