[Bf-extensions-cvs] [69d4daee] master: glTF exporter: fix bug when apply modifier + disable skinning
Julien Duroure
noreply at git.blender.org
Fri Mar 27 18:57:09 CET 2020
Commit: 69d4daee6ffe02ecc0bd53b34595d6e3ecad3a9b
Author: Julien Duroure
Date: Fri Mar 27 18:56:21 2020 +0100
Branches: master
https://developer.blender.org/rBA69d4daee6ffe02ecc0bd53b34595d6e3ecad3a9b
glTF exporter: fix bug when apply modifier + disable skinning
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/blender/exp/gltf2_blender_extract.py
===================================================================
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index af0610c1..55725ca8 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 2, 54),
+ "version": (1, 2, 55),
'blender': (2, 82, 7),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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))
More information about the Bf-extensions-cvs
mailing list