diff options
Diffstat (limited to 'release/scripts/startup/nodeitems_builtins.py')
-rw-r--r-- | release/scripts/startup/nodeitems_builtins.py | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index f63e41b0c28..40afcc69bd2 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -180,6 +180,29 @@ def geometry_input_node_items(context): yield NodeItem("GeometryNodeInputPosition") yield NodeItem("GeometryNodeInputRadius") +# Custom Menu for Material Node Input Nodes +def geometry_material_node_items(context): + if context is None: + return + space = context.space_data + if not space: + return + if not space.edit_tree: + return + + if geometry_nodes_legacy_poll(context): + yield NodeItem("GeometryNodeLegacyMaterialAssign") + yield NodeItem("GeometryNodeLegacySelectByMaterial") + yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + + yield NodeItem("GeometryNodeMaterialReplace") + yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + yield NodeItem("GeometryNodeInputMaterialIndex") + yield NodeItem("GeometryNodeMaterialSelection") + yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + yield NodeItem("GeometryNodeSetMaterial") + yield NodeItem("GeometryNodeSetMaterialIndex") + # Custom Menu for Geometry Node Curves def point_node_items(context): if context is None: @@ -662,14 +685,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeRealizeInstances"), ]), GeometryNodeCategory("GEO_INPUT", "Input", items=geometry_input_node_items), - GeometryNodeCategory("GEO_MATERIAL", "Material", items=[ - NodeItem("GeometryNodeLegacyMaterialAssign", poll=geometry_nodes_legacy_poll), - NodeItem("GeometryNodeLegacySelectByMaterial", poll=geometry_nodes_legacy_poll), - - NodeItem("GeometryNodeMaterialAssign"), - NodeItem("GeometryNodeMaterialSelection"), - NodeItem("GeometryNodeMaterialReplace"), - ]), + GeometryNodeCategory("GEO_MATERIAL", "Material", items=geometry_material_node_items), GeometryNodeCategory("GEO_MESH", "Mesh", items=mesh_node_items), GeometryNodeCategory("GEO_PRIMITIVES_MESH", "Mesh Primitives", items=[ NodeItem("GeometryNodeMeshCircle"), |