diff options
author | Hans Goudey <h.goudey@me.com> | 2021-10-26 23:40:57 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-26 23:40:57 +0300 |
commit | 7d3d09b69c0af677bd363cc009f37fdd1e4a7185 (patch) | |
tree | 4aba7d488037399f3ac9756da1a2aa23b58d38f2 /release | |
parent | b37caa3f06440c3dd36c749950e50becfbddf2e8 (diff) |
Geometry Nodes: Get and set nodes for ID attribute
These nodes allow accessing and changing the stable/random ID used
for motion blur with instances and stable randomness.
Since rB40c3b8836b7a, the stable ID is a built-in attribute, so to be
consistent and allow changing it in the node tree like other built-in
attributes, it has get and set nodes.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/nodeitems_builtins.py | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 22fae8111fd..d822ed9599f 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -157,6 +157,34 @@ def mesh_node_items(context): yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) yield NodeItem("GeometryNodeSetShadeSmooth") +# Custom Menu for Geometry Nodes "Geometry" category +def geometry_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("GeometryNodeLegacyDeleteGeometry", poll=geometry_nodes_legacy_poll) + yield NodeItem("GeometryNodeLegacyRaycast", poll=geometry_nodes_legacy_poll) + yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + + yield NodeItem("GeometryNodeBoundBox") + yield NodeItem("GeometryNodeConvexHull") + yield NodeItem("GeometryNodeDeleteGeometry") + yield NodeItem("GeometryNodeProximity") + yield NodeItem("GeometryNodeJoinGeometry") + yield NodeItem("GeometryNodeRaycast") + yield NodeItem("GeometryNodeSeparateComponents") + yield NodeItem("GeometryNodeSeparateGeometry") + yield NodeItem("GeometryNodeTransform") + yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + yield NodeItem("GeometryNodeSetID") + yield NodeItem("GeometryNodeSetPosition") + # Custom Menu for Geometry Node Input Nodes def geometry_input_node_items(context): if context is None: @@ -182,6 +210,7 @@ def geometry_input_node_items(context): yield NodeItem("ShaderNodeValue") yield NodeItem("FunctionNodeInputVector") yield NodeItemCustom(draw=lambda self, layout, context: layout.separator()) + yield NodeItem("GeometryNodeInputID") yield NodeItem("GeometryNodeInputIndex") yield NodeItem("GeometryNodeInputNormal") yield NodeItem("GeometryNodeInputPosition") @@ -677,21 +706,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeCurvePrimitiveQuadrilateral"), NodeItem("GeometryNodeCurvePrimitiveBezierSegment"), ]), - GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=[ - NodeItem("GeometryNodeLegacyDeleteGeometry", poll=geometry_nodes_legacy_poll), - NodeItem("GeometryNodeLegacyRaycast", poll=geometry_nodes_legacy_poll), - - NodeItem("GeometryNodeRaycast"), - NodeItem("GeometryNodeProximity"), - NodeItem("GeometryNodeBoundBox"), - NodeItem("GeometryNodeConvexHull"), - NodeItem("GeometryNodeDeleteGeometry"), - NodeItem("GeometryNodeTransform"), - NodeItem("GeometryNodeJoinGeometry"), - NodeItem("GeometryNodeSeparateComponents"), - NodeItem("GeometryNodeSeparateGeometry"), - NodeItem("GeometryNodeSetPosition"), - ]), + GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=geometry_node_items), GeometryNodeCategory("GEO_INPUT", "Input", items=geometry_input_node_items), GeometryNodeCategory("GEO_INSTANCE", "Instances", items=[ NodeItem("GeometryNodeInstanceOnPoints"), |