[Bf-blender-cvs] [d86991ef378] master: Fix T60580: depsgraph object instance 'matrix_world' always returns identity matrix.

Bastien Montagne noreply at git.blender.org
Thu Jan 17 12:36:36 CET 2019


Commit: d86991ef378cb9220dfb8e9e6cbbd734e81de052
Author: Bastien Montagne
Date:   Thu Jan 17 12:28:50 2019 +0100
Branches: master
https://developer.blender.org/rBd86991ef378cb9220dfb8e9e6cbbd734e81de052

Fix T60580: depsgraph object instance 'matrix_world' always returns identity matrix.

While form a strict consistency point of view it could make sense to
return identity matrix for non-instance items, it can be very handy to
get that info (common to both instances and regular objects) directly in
all cases.

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

M	source/blender/makesrna/intern/rna_depsgraph.c

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

diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c
index 843c53d5fd3..1c505d757ff 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -151,7 +151,10 @@ static void rna_DepsgraphObjectInstance_matrix_world_get(PointerRNA *ptr, float
 		copy_m4_m4((float(*)[4])mat, deg_iter->dupli_object_current->mat);
 	}
 	else {
-		unit_m4((float(*)[4])mat);
+		/* We can return actual object's matrix here, no reason to return identity matrix
+		 * when this is not actually an instance... */
+		Object *ob = (Object *)iterator->current;
+		copy_m4_m4((float(*)[4])mat, ob->obmat);
 	}
 }



More information about the Bf-blender-cvs mailing list