[Bf-blender-cvs] [d6ebd04bb30] master: Fix T66525: Wrong apply scale for children chain

Sergey Sharybin noreply at git.blender.org
Mon Jul 8 12:24:21 CEST 2019


Commit: d6ebd04bb308c7bea8414ed911bc3d7e0bb2d2ea
Author: Sergey Sharybin
Date:   Mon Jul 8 12:23:24 2019 +0200
Branches: master
https://developer.blender.org/rBd6ebd04bb308c7bea8414ed911bc3d7e0bb2d2ea

Fix T66525: Wrong apply scale for children chain

The operator did not behave correct when there was a chain of parents
longer than 1.

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

M	source/blender/editors/object/object_transform.c

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

diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 4101dc3b87a..dce4e6cfd44 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -465,6 +465,7 @@ static void ignore_parent_tx(Main *bmain, Depsgraph *depsgraph, Scene *scene, Ob
 {
   Object workob;
   Object *ob_child;
+  Scene *scene_eval = DEG_get_evaluated_scene(depsgraph);
 
   /* a change was made, adjust the children to compensate */
   for (ob_child = bmain->objects.first; ob_child; ob_child = ob_child->id.next) {
@@ -475,6 +476,10 @@ static void ignore_parent_tx(Main *bmain, Depsgraph *depsgraph, Scene *scene, Ob
       invert_m4_m4(ob_child->parentinv, workob.obmat);
       /* Copy result of BKE_object_apply_mat4(). */
       BKE_object_transform_copy(ob_child, ob_child_eval);
+      /* Make sure evaluated object is in a consistent state with the original one.
+       * It might be needed for applying transform on its children. */
+      copy_m4_m4(ob_child_eval->parentinv, ob_child->parentinv);
+      BKE_object_eval_transform_all(depsgraph, scene_eval, ob_child_eval);
       /* Tag for update.
        * This is because parent matrix did change, so in theory the child object might now be
        * evaluated to a different location in another editing context. */



More information about the Bf-blender-cvs mailing list