Nodes: remove dead code that was used for node menus

Blender does not use this code anymore and a global search on Github
suggests that this was not used by anyone.

Pull Request: https://projects.blender.org/blender/blender/pulls/132019
This commit is contained in:
Jacques Lucke
2024-12-17 15:30:21 +01:00
parent 97fe1387ae
commit ee2f2f00bd

View File

@@ -35,13 +35,6 @@ class ShaderNodeCategory(SortedNodeCategory):
context.space_data.tree_type == 'ShaderNodeTree')
# Menu entry for node group tools.
def group_tools_draw(_self, layout, _context):
layout.operator("node.group_make")
layout.operator("node.group_ungroup")
layout.separator()
# Maps node tree type to group node type.
node_tree_group_type = {
'CompositorNodeTree': 'CompositorNodeGroup',
@@ -49,59 +42,3 @@ node_tree_group_type = {
'TextureNodeTree': 'TextureNodeGroup',
'GeometryNodeTree': 'GeometryNodeGroup',
}
# Generic node group items generator for shader, compositor, geometry and texture node groups.
def node_group_items(context):
if context is None:
return
space = context.space_data
if not space:
return
yield NodeItemCustom(draw=group_tools_draw)
if group_input_output_item_poll(context):
yield NodeItem("NodeGroupInput")
yield NodeItem("NodeGroupOutput")
ntree = space.edit_tree
if not ntree:
return
yield NodeItemCustom(draw=lambda self, layout, context: layout.separator())
for group in context.blend_data.node_groups:
if group.bl_idname != ntree.bl_idname:
continue
# Filter out recursive groups.
if group.contains_tree(ntree):
continue
# Filter out hidden node-trees.
if group.name.startswith('.'):
continue
yield NodeItem(
node_tree_group_type[group.bl_idname],
label=group.name,
settings={"node_tree": "bpy.data.node_groups[{!r}]".format(group.name)},
)
# only show input/output nodes inside node groups
def group_input_output_item_poll(context):
space = context.space_data
if space.edit_tree in bpy.data.node_groups.values():
return True
return False
def register():
pass
def unregister():
pass
if __name__ == "__main__":
register()