Nodes: Make context path breadcrumbs interactive
Make it possible to navigate in/out node groups through the breacrumbs context path overlay. See PR for details and screenshots. Pull Request: https://projects.blender.org/blender/blender/pulls/141292
This commit is contained in:
committed by
Pablo Vazquez
parent
8b9e667eab
commit
7a01f736a5
@@ -328,6 +328,12 @@ class NODE_OT_tree_path_parent(Operator):
|
||||
bl_label = "Parent Node Tree"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
parent_tree_index: IntProperty(
|
||||
name="Parent Index",
|
||||
description="Parent index in context path",
|
||||
default=0,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
space = context.space_data
|
||||
@@ -337,7 +343,9 @@ class NODE_OT_tree_path_parent(Operator):
|
||||
def execute(self, context):
|
||||
space = context.space_data
|
||||
|
||||
space.path.pop()
|
||||
parent_number_to_pop = len(space.path) - 1 - self.parent_tree_index
|
||||
for _ in range(parent_number_to_pop):
|
||||
space.path.pop()
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
@@ -193,7 +193,8 @@ class NODE_HT_header(Header):
|
||||
layout.separator_spacer()
|
||||
|
||||
if len(snode.path) > 1:
|
||||
layout.operator("node.tree_path_parent", text="", icon='FILE_PARENT')
|
||||
op = layout.operator("node.tree_path_parent", text="", icon='FILE_PARENT')
|
||||
op.parent_tree_index = len(snode.path) - 2
|
||||
|
||||
# Backdrop
|
||||
if is_compositor:
|
||||
|
||||
Reference in New Issue
Block a user