Merge branch 'blender-v4.0-release'
This commit is contained in:
commit
36b88bc041
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include "BLI_math_matrix.hh"
|
||||
|
||||
#include "BKE_scene.h"
|
||||
|
||||
#include "node_geometry_util.hh"
|
||||
|
||||
namespace blender::nodes::node_geo_tool_3d_cursor_cc {
|
||||
|
@ -26,11 +28,15 @@ static void node_geo_exec(GeoNodeExecParams params)
|
|||
if (!check_tool_context_and_error(params)) {
|
||||
return;
|
||||
}
|
||||
const float4x4 world_to_object(params.user_data()->operator_data->self_object->world_to_object);
|
||||
const View3DCursor &cursor = params.user_data()->operator_data->scene->cursor;
|
||||
|
||||
const float4x4 world_to_object(params.user_data()->operator_data->self_object->world_to_object);
|
||||
|
||||
const float3 location_global(cursor.location);
|
||||
const math::Quaternion rotation_global(float4(cursor.rotation_quaternion));
|
||||
params.set_output("Location", math::transform_point(world_to_object, location_global));
|
||||
|
||||
math::Quaternion rotation_global;
|
||||
BKE_scene_cursor_rot_to_quat(&cursor, &rotation_global.w);
|
||||
params.set_output("Rotation", math::to_quaternion(world_to_object) * rotation_global);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue