diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-08 13:23:24 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-08 13:23:24 +0300 |
commit | d6ebd04bb308c7bea8414ed911bc3d7e0bb2d2ea (patch) | |
tree | afb6225160fca522333b90977e0035c0981dcbe5 /source | |
parent | 118a0df7a7e3cdc34c4a3c1e70b993c2dd9db4b5 (diff) |
Fix T66525: Wrong apply scale for children chain
The operator did not behave correct when there was a chain of parents
longer than 1.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 5 |
1 files changed, 5 insertions, 0 deletions
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. */ |