diff options
author | Hans Goudey <h.goudey@me.com> | 2020-12-01 23:35:26 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-12-02 17:38:47 +0300 |
commit | b1d1a58c77fb165855c3ff8c13fdebe3d4297db8 (patch) | |
tree | da81346973867d60f605470f3f973cc67961946e /release/scripts/startup/bl_ui | |
parent | 600fb28b629598af2537c542e7f3f76ba0e94389 (diff) |
Geometry Nodes: improve operators for node editor header
This allows users to create new modifiers directly from the
Geometry Nodes Editor.
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 4cd38831cdf..9ad454d49e1 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -154,7 +154,20 @@ class NODE_HT_header(Header): elif snode.tree_type == 'GeometryNodeTree': NODE_MT_editor_menus.draw_collapsible(context, layout) layout.separator_spacer() - layout.template_ID(snode, "node_tree", new="node.new_geometry_node_tree") + + ob = context.object + + row = layout.row() + if snode.pin: + row.enabled = False + row.template_ID(snode, "node_tree", new="node.new_geometry_node_group_assign") + elif ob: + active_modifier = ob.modifiers.active + if active_modifier and active_modifier.type == "NODES": + row.template_ID(active_modifier, "node_group", new="node.new_geometry_node_group_assign") + else: + row.template_ID(snode, "node_tree", new="node.new_geometry_node_modifier") + else: # Custom node tree is edited as independent ID block |