diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-13 19:30:42 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-13 19:32:06 +0300 |
commit | 1f4c1c5fc73423f87b69621f0f6131b02d014a9f (patch) | |
tree | 6efee48cd919103c86ba0b1b2402b64d2e187a4a /source/blender/editors/space_node/drawnode.c | |
parent | bae4d00e2a33e255b33b59dbd273d56f3d796f0f (diff) |
Geometry Nodes: Add "Point Translate" and "Point Scale" nodes
The translate node moves every point in the geometry, and the scale
node multiplies the "scale" attribute of the input geometry by its input.
While these operations are already possible with the "Attribute" nodes,
these new nodes fit nicely with the nodes specifically for changing the
"rotation" attribute that already exist, and they provide a simpler way
to do the same thing.
Differential Revision: https://developer.blender.org/D10100
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 72f3a085ae1..fa71561b2f5 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3272,6 +3272,17 @@ static void node_geometry_buts_align_rotation_to_vector(uiLayout *layout, uiItemR(col, ptr, "input_type_factor", DEFAULT_FLAGS, IFACE_("Factor"), ICON_NONE); uiItemR(col, ptr, "input_type_vector", DEFAULT_FLAGS, IFACE_("Vector"), ICON_NONE); } +static void node_geometry_buts_point_translate(uiLayout *layout, + bContext *UNUSED(C), + PointerRNA *ptr) +{ + uiItemR(layout, ptr, "input_type", DEFAULT_FLAGS, IFACE_("Type"), ICON_NONE); +} + +static void node_geometry_buts_point_scale(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "input_type", DEFAULT_FLAGS, IFACE_("Type"), ICON_NONE); +} static void node_geometry_set_butfunc(bNodeType *ntype) { @@ -3318,6 +3329,12 @@ static void node_geometry_set_butfunc(bNodeType *ntype) case GEO_NODE_ALIGN_ROTATION_TO_VECTOR: ntype->draw_buttons = node_geometry_buts_align_rotation_to_vector; break; + case GEO_NODE_POINT_TRANSLATE: + ntype->draw_buttons = node_geometry_buts_point_translate; + break; + case GEO_NODE_POINT_SCALE: + ntype->draw_buttons = node_geometry_buts_point_scale; + break; } } |