[Bf-blender-cvs] [beb5863ed4c] master: Geometry Nodes: transform Object Info outputs to local space

Jacques Lucke noreply at git.blender.org
Mon Jan 11 15:00:37 CET 2021


Commit: beb5863ed4c0a2961e3fa7baafa2293a77dfad17
Author: Jacques Lucke
Date:   Mon Jan 11 15:00:29 2021 +0100
Branches: master
https://developer.blender.org/rBbeb5863ed4c0a2961e3fa7baafa2293a77dfad17

Geometry Nodes: transform Object Info outputs to local space

Ref T83670.

Differential Revision: https://developer.blender.org/D10071

===================================================================

M	source/blender/modifiers/intern/MOD_nodes.cc
M	source/blender/nodes/geometry/nodes/node_geo_object_info.cc

===================================================================

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>();



More information about the Bf-blender-cvs mailing list