Fix T75074: Select Hierarchy error, when object is not on view layer

This commit is contained in:
Campbell Barton 2020-06-20 12:43:51 +10:00
parent 874af5301c
commit 92c5b12df6
Notes: blender-bot 2023-02-13 23:04:46 +01:00
Referenced by issue #75074, Select Hierarchy (Child) error, when object is not on view layer
1 changed files with 3 additions and 2 deletions

View File

@ -194,7 +194,7 @@ class SelectHierarchy(Operator):
for obj in selected_objects:
parent = obj.parent
if parent:
if parent and parent.visible_get():
if obj_act == obj:
act_new = parent
@ -202,12 +202,13 @@ class SelectHierarchy(Operator):
else:
for obj in selected_objects:
select_new.extend(obj.children)
select_new.extend([child for child in obj.children if child.visible_get()])
if select_new:
select_new.sort(key=lambda obj_iter: obj_iter.name)
act_new = select_new[0]
# don't edit any object settings above this
if select_new:
if not self.extend: