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/makesrna | |
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/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 26e11ed047b..41034830390 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -8774,6 +8774,47 @@ static void def_geo_rotate_points(StructRNA *srna) RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); } +static void def_geo_align_rotation_to_vector(StructRNA *srna) +{ + static const EnumPropertyItem axis_items[] = { + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_X, + "X", + ICON_NONE, + "X", + "Align the X axis with the vector"}, + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_Y, + "Y", + ICON_NONE, + "Y", + "Align the Y axis with the vector"}, + {GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_Z, + "Z", + ICON_NONE, + "Z", + "Align the Z axis with the vector"}, + {0, NULL, 0, NULL, NULL}, + }; + + PropertyRNA *prop; + + RNA_def_struct_sdna_from(srna, "NodeGeometryAlignRotationToVector", "storage"); + + prop = RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, axis_items); + 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, "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", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); + + prop = RNA_def_property(srna, "input_type_vector", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items_vector); + RNA_def_property_ui_text(prop, "Input Type Vector", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); +} + /* -------------------------------------------------------------------------- */ static void rna_def_shader_node(BlenderRNA *brna) |