diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-02-09 00:09:27 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-02-09 00:09:27 +0300 |
commit | dd594a9d72df3366de49ad691a904eb6744a0523 (patch) | |
tree | eedbca53c343219ea650ee922cd00c95a6d2da25 /io_scene_gltf2 | |
parent | d290273a7016899f0a8114682c4d93b553a542ca (diff) |
glTF exporter: Disable armature modifier when applying modifiers and exporting skins
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py index 04953c63..97bb3642 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_nodes.py @@ -162,9 +162,22 @@ def __gather_mesh(blender_object, export_settings): edge_split.split_angle = blender_object.data.auto_smooth_angle edge_split.use_edge_angle = not blender_object.data.has_custom_normals + armature_modifiers = {} + if export_settings[gltf2_blender_export_keys.SKINS]: + # temprorary disable Armature modifiers if exporting skins + for idx, modifier in enumerate(blender_object.modifiers): + if modifier.type == 'ARMATURE': + armature_modifiers[idx] = modifier.show_viewport + modifier.show_viewport = False + blender_mesh = blender_object.to_mesh(bpy.context.depsgraph, True) skip_filter = True + if export_settings[gltf2_blender_export_keys.SKINS]: + # restore Armature modifiers + for idx, show_viewport in armature_modifiers.items(): + blender_object.modifiers[idx].show_viewport = show_viewport + if auto_smooth: bpy.data.objects.remove(blender_object) else: |