From 14208b6dfad10982947c59660b89f92c19202cc0 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Thu, 12 Sep 2024 15:42:39 +0200 Subject: [PATCH] UI: Compositor: Show Parent button when available The Parent Node Tree operator button to go up a level in nested node trees is always visible in the header, regardless if we are currently in a nested tree or not. Only show the button when it is actually possible to go a level up. This frees up space in the header when at the top level. --- scripts/startup/bl_ui/space_node.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/startup/bl_ui/space_node.py b/scripts/startup/bl_ui/space_node.py index 90e1492658b..420c03a0c15 100644 --- a/scripts/startup/bl_ui/space_node.py +++ b/scripts/startup/bl_ui/space_node.py @@ -197,7 +197,8 @@ class NODE_HT_header(Header): if is_compositor: layout.prop(snode, "pin", text="", emboss=False) - layout.operator("node.tree_path_parent", text="", icon='FILE_PARENT') + if len(snode.path) > 1: + layout.operator("node.tree_path_parent", text="", icon='FILE_PARENT') # Backdrop if is_compositor: