Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2019-03-01 00:03:54 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-03-01 00:03:54 +0300
commitdd0dffef42ae64d1bf16e879e3f1470ce3bf5cad (patch)
tree62fea3347a6094f8abec8bd2163916a2d5d516b6
parentc715490c5ee1d221ba114c219337f1df8a0cb653 (diff)
glTF importer: avoid rotation issue when active collection is disabled
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_scene.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
index d21cdf33..f935eb02 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py
@@ -121,6 +121,13 @@ class BlenderScene():
+
+ # Avoid rotation bug if collection is hidden or disabled
+ if gltf.blender_active_collection is not None:
+ gltf.collection_hide_viewport = bpy.data.collections[gltf.blender_active_collection].hide_viewport
+ bpy.data.collections[gltf.blender_active_collection].hide_viewport = False
+ # TODO for visibility ... but seems not exposed on bpy for now
+
for node_idx in list_nodes:
if node_idx in exclude_nodes:
@@ -143,6 +150,11 @@ class BlenderScene():
#bpy.context.scene.collection.objects.unlink(obj_rotation)
bpy.data.objects.remove(obj_rotation)
+ # Restore collection hiden / disabled values
+ if gltf.blender_active_collection is not None:
+ bpy.data.collections[gltf.blender_active_collection].hide_viewport = gltf.collection_hide_viewport
+ # TODO restore visibility when expose in bpy
+
@staticmethod
def get_root_nodes(gltf):
if gltf.data.nodes is None: