diff options
author | Jacques Lucke <jacques@blender.org> | 2021-01-12 14:55:14 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-01-12 14:55:14 +0300 |
commit | 3b77bd48f9c63aebd5c8bc4a126d496f503c75a7 (patch) | |
tree | 0b45925a0b6ef0aa963732ec4dacf6fce16803bc /source/blender/editors | |
parent | 3a254b93fd8597c47fc4fe55fa0417d1f9fa85fc (diff) |
Geometry Nodes: new Align Rotation to Vector node
This adds a new Align Rotation to Vector node based on the mockup
in T83669.
Reviewers: HooglyBoogly, simonthommes
Differential Revision: https://developer.blender.org/D10081
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 74ce0d713bf..0933efb1577 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3319,6 +3319,16 @@ static void node_geometry_buts_rotate_points(uiLayout *layout, } } +static void node_geometry_buts_align_rotation_to_vector(uiLayout *layout, + bContext *UNUSED(C), + PointerRNA *ptr) +{ + uiItemR(layout, ptr, "axis", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, NULL, ICON_NONE); + uiLayout *col = uiLayoutColumn(layout, false); + 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_set_butfunc(bNodeType *ntype) { switch (ntype->type) { @@ -3361,6 +3371,9 @@ static void node_geometry_set_butfunc(bNodeType *ntype) case GEO_NODE_ROTATE_POINTS: ntype->draw_buttons = node_geometry_buts_rotate_points; break; + case GEO_NODE_ALIGN_ROTATION_TO_VECTOR: + ntype->draw_buttons = node_geometry_buts_align_rotation_to_vector; + break; } } |