From 2c216413d5f0de6b4b35e0736964654206b72a02 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sat, 13 Mar 2021 16:00:56 -0500 Subject: Nodes: Move group input and output to a consistent menu location Currently (in geometry nodes) you can delete the group input or group output nodes with no way to get them back without copy and paste. This adds them to the "Group" submenu of the add menu so at least there is a way to add them back. Additionally, these nodes are moved to the "Group" submenu for all node editors. This makes sense since they are not like the other input or output nodes, they really just relate to how groups are organized. Differential Revision: https://developer.blender.org/D10241 --- release/scripts/startup/nodeitems_builtins.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index c6565f1b578..e6e2c25e383 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -94,6 +94,11 @@ def node_group_items(context): yield NodeItemCustom(draw=group_tools_draw) + yield NodeItem("NodeGroupInput", poll=group_input_output_item_poll) + yield NodeItem("NodeGroupOutput", poll=group_input_output_item_poll) + + yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + def contains_group(nodetree, group): if nodetree == group: return True @@ -200,7 +205,6 @@ shader_node_categories = [ NodeItem("ShaderNodeUVMap"), NodeItem("ShaderNodeVertexColor"), NodeItem("ShaderNodeUVAlongStroke", poll=line_style_shader_nodes_poll), - NodeItem("NodeGroupInput", poll=group_input_output_item_poll), ]), ShaderNodeCategory("SH_NEW_OUTPUT", "Output", items=[ NodeItem("ShaderNodeOutputMaterial", poll=object_eevee_cycles_shader_nodes_poll), @@ -208,7 +212,6 @@ shader_node_categories = [ NodeItem("ShaderNodeOutputAOV"), NodeItem("ShaderNodeOutputWorld", poll=world_shader_nodes_poll), NodeItem("ShaderNodeOutputLineStyle", poll=line_style_shader_nodes_poll), - NodeItem("NodeGroupOutput", poll=group_input_output_item_poll), ]), ShaderNodeCategory("SH_NEW_SHADER", "Shader", items=[ NodeItem("ShaderNodeMixShader", poll=eevee_cycles_shader_nodes_poll), @@ -310,7 +313,6 @@ compositor_node_categories = [ NodeItem("CompositorNodeBokehImage"), NodeItem("CompositorNodeTime"), NodeItem("CompositorNodeTrackPos"), - NodeItem("NodeGroupInput", poll=group_input_output_item_poll), ]), CompositorNodeCategory("CMP_OUTPUT", "Output", items=[ NodeItem("CompositorNodeComposite"), @@ -318,7 +320,6 @@ compositor_node_categories = [ NodeItem("CompositorNodeSplitViewer"), NodeItem("CompositorNodeOutputFile"), NodeItem("CompositorNodeLevels"), - NodeItem("NodeGroupOutput", poll=group_input_output_item_poll), ]), CompositorNodeCategory("CMP_OP_COLOR", "Color", items=[ NodeItem("CompositorNodeMixRGB"), @@ -420,12 +421,10 @@ texture_node_categories = [ NodeItem("TextureNodeCoordinates"), NodeItem("TextureNodeTexture"), NodeItem("TextureNodeImage"), - NodeItem("NodeGroupInput", poll=group_input_output_item_poll), ]), TextureNodeCategory("TEX_OUTPUT", "Output", items=[ NodeItem("TextureNodeOutput"), NodeItem("TextureNodeViewer"), - NodeItem("NodeGroupOutput", poll=group_input_output_item_poll), ]), TextureNodeCategory("TEX_OP_COLOR", "Color", items=[ NodeItem("TextureNodeMixRGB"), -- cgit v1.2.3