[Bf-blender-cvs] [ddc19819f33] master: Fix T60971: Apply visual transform not working

Pelle Johnsen noreply at git.blender.org
Tue Jun 4 15:24:46 CEST 2019


Commit: ddc19819f33a434997c6670b1eb2ba7f9c4c5b4d
Author: Pelle Johnsen
Date:   Tue Jun 4 15:17:23 2019 +0200
Branches: master
https://developer.blender.org/rBddc19819f33a434997c6670b1eb2ba7f9c4c5b4d

Fix T60971: Apply visual transform not working

Fix issue with 'apply visual transfrom' not working.
Based on fix for https://developer.blender.org/T55494

Reviewers: campbellbarton, sergey

Maniphest Tasks: T60971

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

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

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 263cd5bbda0..86144937844 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -813,13 +813,14 @@ static int apply_objects_internal(bContext *C,
 static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
 {
   Scene *scene = CTX_data_scene(C);
-  Depsgraph *depsgraph = CTX_data_depsgraph(C);
+  Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C);
   bool changed = false;
 
   CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) {
-    BKE_object_where_is_calc(depsgraph, scene, ob);
-    BKE_object_apply_mat4(ob, ob->obmat, true, true);
-    BKE_object_where_is_calc(depsgraph, scene, ob);
+    Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
+    BKE_object_where_is_calc(depsgraph, scene, ob_eval);
+    BKE_object_apply_mat4(ob_eval, ob_eval->obmat, true, true);
+    BKE_object_transform_copy(ob, ob_eval);
 
     /* update for any children that may get moved */
     DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);



More information about the Bf-blender-cvs mailing list