diff options
author | Johnny Matthews <guitargeek> | 2021-10-11 19:03:57 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-11 19:03:57 +0300 |
commit | c1b4abf527f102ca20114e8179eca511d90784b3 (patch) | |
tree | ef5c074ada59fc25acf11034cd9e3d5daf1ae4e6 /source/blender/modifiers/intern/MOD_nodes_evaluator.cc | |
parent | 83f87d9f21fada613a70e7296120752e1e876dc3 (diff) |
Geometry Nodes: Add Nodes to Get/Set Built-in Attributes
This commit implements T91780, adding nodes to get and set builtin
attributes. Individual set nodes are used so that the values can be
exposed for direct editing, which is useful for attributes like shade
smooth and spline resolution. Individual input nodes are used to allow
reusing nodes for multiple components, and to allow grouping multiple
outputs conceptually in the same node in the future.
Input Nodes
- Radius
- Curve Tilt
- Curve Handle Positions
- Is Shade Smooth
- Spline Resolution
- Is Spline Cyclic
'Set' Nodes
- Curve Radius
- Point Radius
- Curve Tilt
- Curve Handle Positions
- Is Shade Smooth
- Spline Resolution
- Is Spline Cyclic
Using hardcoded categories is necessary to add separators to the node
menu.
Differential Revision: https://developer.blender.org/D12687
Diffstat (limited to 'source/blender/modifiers/intern/MOD_nodes_evaluator.cc')
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes_evaluator.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc index c5213dc304b..8209d46ec24 100644 --- a/source/blender/modifiers/intern/MOD_nodes_evaluator.cc +++ b/source/blender/modifiers/intern/MOD_nodes_evaluator.cc @@ -337,6 +337,14 @@ static void get_socket_value(const SocketRef &socket, void *r_value) new (r_value) Field<float3>(bke::AttributeFieldInput::Create<float3>("position")); return; } + if (bnode.type == GEO_NODE_SET_CURVE_HANDLES) { + StringRef side = ((NodeGeometrySetCurveHandlePositions *)bnode.storage)->mode == + GEO_NODE_CURVE_HANDLE_LEFT ? + "handle_left" : + "handle_right"; + new (r_value) Field<float3>(bke::AttributeFieldInput::Create<float3>(side)); + return; + } } else if (bsocket.type == SOCK_INT) { if (ELEM(bnode.type, FN_NODE_RANDOM_VALUE, GEO_NODE_INSTANCE_ON_POINTS)) { |