Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
dd0dffef
Commit
dd0dffef
authored
6 years ago
by
Julien Duroure
Browse files
Options
Downloads
Patches
Plain Diff
glTF importer: avoid rotation issue when active collection is disabled
parent
c715490c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_scene_gltf2/blender/imp/gltf2_blender_scene.py
+12
-0
12 additions, 0 deletions
io_scene_gltf2/blender/imp/gltf2_blender_scene.py
with
12 additions
and
0 deletions
io_scene_gltf2/blender/imp/gltf2_blender_scene.py
+
12
−
0
View file @
dd0dffef
...
@@ -121,6 +121,13 @@ class BlenderScene():
...
@@ -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
:
for
node_idx
in
list_nodes
:
if
node_idx
in
exclude_nodes
:
if
node_idx
in
exclude_nodes
:
...
@@ -143,6 +150,11 @@ class BlenderScene():
...
@@ -143,6 +150,11 @@ class BlenderScene():
#bpy.context.scene.collection.objects.unlink(obj_rotation)
#bpy.context.scene.collection.objects.unlink(obj_rotation)
bpy
.
data
.
objects
.
remove
(
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
@staticmethod
def
get_root_nodes
(
gltf
):
def
get_root_nodes
(
gltf
):
if
gltf
.
data
.
nodes
is
None
:
if
gltf
.
data
.
nodes
is
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment