Commit: c1402712de1f1ff3d28950af875d26d1abc89887
Author: Jacques Lucke
Date: Tue Nov 10 17:36:35 2020 +0100
Branches: temp-modifiers-instancing
https://developer.blender.org/rBc1402712de1f1ff3d28950af875d26d1abc89887
add rotation and scale output
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_object_info.cc
===================================================================
diff --git a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
index 628cff97913..7c05468eebc 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
@@ -23,6 +23,8 @@ static bNodeSocketTemplate geo_node_object_info_in[] = {
static bNodeSocketTemplate geo_node_object_info_out[] = {
{SOCK_VECTOR, N_("Location")},
+ {SOCK_VECTOR, N_("Rotation")},
+ {SOCK_VECTOR, N_("Scale")},
{-1, ""},
};
@@ -34,12 +36,18 @@ static void geo_object_info_exec(bNode *UNUSED(node),
GeoNodeInputs inputs, GeoN
Object *object = inputs.handle_map().lookup(object_handle);
float3 location = {0, 0, 0};
+ float3 rotation = {0, 0, 0};
+ float3 scale = {0, 0, 0};
if (object != nullptr) {
- location = object->obmat[3];
+ float quaternion[4];
+ mat4_decompose(location, quaternion, scale, object->obmat);
+ quat_to_eul(rotation, quaternion);
}
outputs.set("Location", location);
+ outputs.set("Rotation", rotation);
+ outputs.set("Scale", scale);
}
} // namespace blender::nodes
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs