diff options
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc b/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc index 720ca9731a8..d1b71d6f2ba 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_align_rotation_to_vector.cc @@ -51,6 +51,28 @@ static void geo_node_align_rotation_to_vector_layout(uiLayout *layout, namespace blender::nodes { +static void geo_node_align_rotation_to_vector_init(bNodeTree *UNUSED(ntree), bNode *node) +{ + NodeGeometryAlignRotationToVector *node_storage = (NodeGeometryAlignRotationToVector *) + MEM_callocN(sizeof(NodeGeometryAlignRotationToVector), __func__); + + node_storage->axis = GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_X; + node_storage->input_type_factor = GEO_NODE_ATTRIBUTE_INPUT_FLOAT; + node_storage->input_type_vector = GEO_NODE_ATTRIBUTE_INPUT_VECTOR; + + node->storage = node_storage; +} + +static void geo_node_align_rotation_to_vector_update(bNodeTree *UNUSED(ntree), bNode *node) +{ + NodeGeometryAlignRotationToVector *node_storage = (NodeGeometryAlignRotationToVector *) + node->storage; + update_attribute_input_socket_availabilities( + *node, "Factor", (GeometryNodeAttributeInputMode)node_storage->input_type_factor); + update_attribute_input_socket_availabilities( + *node, "Vector", (GeometryNodeAttributeInputMode)node_storage->input_type_vector); +} + static void align_rotations_auto_pivot(const VArray<float3> &vectors, const VArray<float> &factors, const float3 local_main_axis, @@ -195,28 +217,6 @@ static void geo_node_align_rotation_to_vector_exec(GeoNodeExecParams params) params.set_output("Geometry", geometry_set); } -static void geo_node_align_rotation_to_vector_init(bNodeTree *UNUSED(ntree), bNode *node) -{ - NodeGeometryAlignRotationToVector *node_storage = (NodeGeometryAlignRotationToVector *) - MEM_callocN(sizeof(NodeGeometryAlignRotationToVector), __func__); - - node_storage->axis = GEO_NODE_ALIGN_ROTATION_TO_VECTOR_AXIS_X; - node_storage->input_type_factor = GEO_NODE_ATTRIBUTE_INPUT_FLOAT; - node_storage->input_type_vector = GEO_NODE_ATTRIBUTE_INPUT_VECTOR; - - node->storage = node_storage; -} - -static void geo_node_align_rotation_to_vector_update(bNodeTree *UNUSED(ntree), bNode *node) -{ - NodeGeometryAlignRotationToVector *node_storage = (NodeGeometryAlignRotationToVector *) - node->storage; - update_attribute_input_socket_availabilities( - *node, "Factor", (GeometryNodeAttributeInputMode)node_storage->input_type_factor); - update_attribute_input_socket_availabilities( - *node, "Vector", (GeometryNodeAttributeInputMode)node_storage->input_type_vector); -} - } // namespace blender::nodes void register_node_type_geo_align_rotation_to_vector() |