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
This commit is contained in:
Hans Goudey 2021-03-13 16:00:56 -05:00
parent 03490618a2
commit 2c216413d5
Notes: blender-bot 2023-02-14 07:47:59 +01:00
Referenced by issue #86276, Geometry Nodes: Can't seem to re-add group input and output nodes.
1 changed files with 5 additions and 6 deletions

View File

@ -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"),