diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-09-05 23:12:53 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-09-05 23:12:53 +0300 |
commit | d8e78e3cdcd2adba905b1729c859753df90a9632 (patch) | |
tree | 922ef0b35c02e6e4c3418cb8b2265cc4805142fb /io_scene_gltf2/blender/exp | |
parent | 19819fb1ce7e3a3a603a32e6eac7f548cfbcf866 (diff) |
glTF importer & exporter: fix texture transform after recent API change
Diffstat (limited to 'io_scene_gltf2/blender/exp')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_get.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_get.py b/io_scene_gltf2/blender/exp/gltf2_blender_get.py index 4916d5af..a16811d8 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_get.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_get.py @@ -133,7 +133,9 @@ def get_texture_transform_from_texture_node(texture_node): ) return None - if mapping_node.rotation[0] or mapping_node.rotation[1]: + + rotation_0, rotation_1 = mapping_node.inputs['Rotation'].default_value[0], mapping_node.inputs['Rotation'].default_value[1] + if rotation_0 or rotation_1: # TODO: can we handle this? gltf2_io_debug.print_console("WARNING", "Skipping exporting texture transform because it had non-zero " @@ -142,9 +144,9 @@ def get_texture_transform_from_texture_node(texture_node): return None mapping_transform = {} - mapping_transform["offset"] = [mapping_node.translation[0], mapping_node.translation[1]] - mapping_transform["rotation"] = mapping_node.rotation[2] - mapping_transform["scale"] = [mapping_node.scale[0], mapping_node.scale[1]] + mapping_transform["offset"] = [mapping_node.inputs['Location'].default_value[0], mapping_node.inputs['Location'].default_value[1]] + mapping_transform["rotation"] = mapping_node.inputs['Rotation'].default_value[2] + mapping_transform["scale"] = [mapping_node.inputs['Scale'].default_value[0], mapping_node.inputs['Scale'].default_value[1]] if mapping_node.vector_type == "TEXTURE": # This means use the inverse of the TRS transform. |