Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-01-11 17:00:29 +0300
committerJacques Lucke <jacques@blender.org>2021-01-11 17:00:29 +0300
commitbeb5863ed4c0a2961e3fa7baafa2293a77dfad17 (patch)
treebc9af28e7393466f694d31ad843eb7499eeb9f99
parentc0833989210714bc6974b77f40e59edc47d0cc68 (diff)
Geometry Nodes: transform Object Info outputs to local space
Ref T83670. Differential Revision: https://developer.blender.org/D10071
-rw-r--r--source/blender/modifiers/intern/MOD_nodes.cc1
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_object_info.cc7
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index edd7cb9cfd1..b8729a51df8 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -134,6 +134,7 @@ static void findUsedIds(const bNodeTree &tree, Set<ID *> &ids)
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
NodesModifierData *nmd = reinterpret_cast<NodesModifierData *>(md);
+ DEG_add_modifier_to_transform_relation(ctx->node, "Nodes Modifier");
if (nmd->node_group != nullptr) {
DEG_add_node_tree_relation(ctx->node, nmd->node_group, "Nodes Modifier");
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 f7db1db0dd2..07d6858369d 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_object_info.cc
@@ -50,8 +50,11 @@ static void geo_node_object_info_exec(GeoNodeExecParams params)
const Object *self_object = params.self_object();
if (object != nullptr) {
+ float transform[4][4];
+ mul_m4_m4m4(transform, self_object->imat, object->obmat);
+
float quaternion[4];
- mat4_decompose(location, quaternion, scale, object->obmat);
+ mat4_decompose(location, quaternion, scale, transform);
quat_to_eul(rotation, quaternion);
if (object != self_object) {
@@ -64,8 +67,6 @@ static void geo_node_object_info_exec(GeoNodeExecParams params)
Mesh *copied_mesh = BKE_mesh_copy_for_eval(mesh, false);
/* Transform into the local space of the object that is being modified. */
- float transform[4][4];
- mul_m4_m4m4(transform, self_object->imat, object->obmat);
BKE_mesh_transform(copied_mesh, transform, true);
MeshComponent &mesh_component = geometry_set.get_component_for_write<MeshComponent>();