From d8dc4c5b32b4cb08e2d438d76f6a02e732d23220 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 23 Dec 2020 16:37:47 +0100 Subject: Geometry Nodes: new Rotate Points node This node updates the "rotation" attribute on points. Multiple ways to specify the rotation are supported. Differential Revision: https://developer.blender.org/D9883 Ref T83668. --- source/blender/editors/space_node/drawnode.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 0ce31707204..409327b0d1c 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3260,6 +3260,25 @@ static void node_geometry_buts_attribute_color_ramp(uiLayout *layout, uiTemplateColorRamp(layout, ptr, "color_ramp", 0); } +static void node_geometry_buts_rotate_points(uiLayout *layout, + bContext *UNUSED(C), + PointerRNA *ptr) +{ + NodeGeometryRotatePoints *storage = (NodeGeometryRotatePoints *)((bNode *)ptr->data)->storage; + + uiItemR(layout, ptr, "type", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiItemR(layout, ptr, "space", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, NULL, ICON_NONE); + + uiLayout *col = uiLayoutColumn(layout, false); + if (storage->type == GEO_NODE_ROTATE_POINTS_TYPE_AXIS_ANGLE) { + uiItemR(col, ptr, "input_type_axis", DEFAULT_FLAGS, IFACE_("Axis"), ICON_NONE); + uiItemR(col, ptr, "input_type_angle", DEFAULT_FLAGS, IFACE_("Angle"), ICON_NONE); + } + else { + uiItemR(col, ptr, "input_type_rotation", DEFAULT_FLAGS, IFACE_("Rotation"), ICON_NONE); + } +} + static void node_geometry_set_butfunc(bNodeType *ntype) { switch (ntype->type) { @@ -3296,6 +3315,9 @@ static void node_geometry_set_butfunc(bNodeType *ntype) case GEO_NODE_ATTRIBUTE_COLOR_RAMP: ntype->draw_buttons = node_geometry_buts_attribute_color_ramp; break; + case GEO_NODE_ROTATE_POINTS: + ntype->draw_buttons = node_geometry_buts_rotate_points; + break; } } -- cgit v1.2.3