diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-03-27 20:56:21 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-03-27 20:56:21 +0300 |
commit | 69d4daee6ffe02ecc0bd53b34595d6e3ecad3a9b (patch) | |
tree | b0c382fbf589590826519085e2e6d24520c15fd0 /io_scene_gltf2/blender/exp/gltf2_blender_extract.py | |
parent | fd6bfbb44af49a97db2ad35ba4f54d83ffec26a4 (diff) |
glTF exporter: fix bug when apply modifier + disable skinning
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_extract.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_extract.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py index 955c5d13..3db571fb 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_extract.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_extract.py @@ -66,7 +66,7 @@ class ShapeKey: def convert_swizzle_normal(loc, armature, blender_object, export_settings): """Convert a normal data from Blender coordinate system to glTF coordinate system.""" - if not armature: + if (not armature) or (not blender_object): # Classic case. Mesh is not skined, no need to apply armature transfoms on vertices / normals / tangents if export_settings[gltf2_blender_export_keys.YUP]: return Vector((loc[0], loc[2], -loc[1])) @@ -85,7 +85,7 @@ def convert_swizzle_normal(loc, armature, blender_object, export_settings): def convert_swizzle_location(loc, armature, blender_object, export_settings): """Convert a location from Blender coordinate system to glTF coordinate system.""" - if not armature: + if (not armature) or (not blender_object): # Classic case. Mesh is not skined, no need to apply armature transfoms on vertices / normals / tangents if export_settings[gltf2_blender_export_keys.YUP]: return Vector((loc[0], loc[2], -loc[1])) @@ -107,7 +107,7 @@ def convert_swizzle_tangent(tan, armature, blender_object, export_settings): if tan[0] == 0.0 and tan[1] == 0.0 and tan[2] == 0.0: print_console('WARNING', 'Tangent has zero length.') - if not armature: + if (not armature) or (not blender_object): # Classic case. Mesh is not skined, no need to apply armature transfoms on vertices / normals / tangents if export_settings[gltf2_blender_export_keys.YUP]: return Vector((tan[0], tan[2], -tan[1], 1.0)) |