From 1f4c1c5fc73423f87b69621f0f6131b02d014a9f Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 13 Jan 2021 10:30:42 -0600 Subject: 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 --- source/blender/editors/space_node/drawnode.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/editors/space_node/drawnode.c') 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; } } -- cgit v1.2.3