diff options
author | Jacques Lucke <jacques@blender.org> | 2021-02-05 18:10:54 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-02-05 18:10:54 +0300 |
commit | 46e0efb462cb92e9ade39588b51391820491aed8 (patch) | |
tree | 7b109ecbe04d9a1f0c7f35b44a83558a76818a55 /source/blender/makesrna/intern | |
parent | 56903024dccd0e5ae4fae40925348416f989144b (diff) |
Geometry Nodes: support fixed pivot axis in Align Rotation to Vector node
When the pivot axis is not set to auto, the node will try to align the rotation
to vector as best as possible, given the selected rotation axis.
Ref T85211.
Differential Revision: https://developer.blender.org/D10292
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 7f66d5ff70f..77334f10cd0 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -8793,6 +8793,30 @@ static void def_geo_align_rotation_to_vector(StructRNA *srna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem pivot_axis_items[] = { + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_PIVOT_AXIS_AUTO, + "AUTO", + ICON_NONE, + "Auto", + "Automatically detect the best rotation axis to rotate towards the vector"}, + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_PIVOT_AXIS_X, + "X", + ICON_NONE, + "X", + "Rotate around the local X axis"}, + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_PIVOT_AXIS_Y, + "Y", + ICON_NONE, + "Y", + "Rotate around the local Y axis"}, + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_PIVOT_AXIS_Z, + "Z", + ICON_NONE, + "Z", + "Rotate around the local Z axis"}, + {0, NULL, 0, NULL, NULL}, + }; + PropertyRNA *prop; RNA_def_struct_sdna_from(srna, "NodeGeometryAlignRotationToVector", "storage"); @@ -8802,6 +8826,11 @@ static void def_geo_align_rotation_to_vector(StructRNA *srna) RNA_def_property_ui_text(prop, "Axis", "Axis to align to the vector"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "pivot_axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, pivot_axis_items); + RNA_def_property_ui_text(prop, "Pivot Axis", "Axis to rotate around"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "input_type_factor", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_float); RNA_def_property_ui_text(prop, "Input Type Factor", ""); |