[Bf-blender-cvs] [54e6b262a14] master: Cleanup: Pass explicit dependency graph

Sergey Sharybin noreply at git.blender.org
Wed Jun 19 14:03:42 CEST 2019


Commit: 54e6b262a14b23160fdecfec68f3e22dcf70bb3e
Author: Sergey Sharybin
Date:   Wed Jun 19 12:15:10 2019 +0200
Branches: master
https://developer.blender.org/rB54e6b262a14b23160fdecfec68f3e22dcf70bb3e

Cleanup: Pass explicit dependency graph

Avoids hash lookup on per-object basis when applying transform.

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

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 86144937844..841a3bbed7d 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -460,11 +460,10 @@ void OBJECT_OT_origin_clear(wmOperatorType *ot)
 
 /* use this when the loc/size/rot of the parent has changed but the children
  * should stay in the same place, e.g. for apply-size-rot or object center */
-static void ignore_parent_tx(const bContext *C, Main *bmain, Scene *scene, Object *ob)
+static void ignore_parent_tx(Main *bmain, Depsgraph *depsgraph, Scene *scene, Object *ob)
 {
   Object workob;
   Object *ob_child;
-  Depsgraph *depsgraph = CTX_data_depsgraph(C);
 
   /* a change was made, adjust the children to compensate */
   for (ob_child = bmain->objects.first; ob_child; ob_child = ob_child->id.next) {
@@ -793,7 +792,7 @@ static int apply_objects_internal(bContext *C,
       BKE_pose_where_is(depsgraph, scene, ob_eval);
     }
 
-    ignore_parent_tx(C, bmain, scene, ob);
+    ignore_parent_tx(bmain, depsgraph, scene, ob);
 
     DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
 
@@ -1166,7 +1165,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
           BKE_object_where_is_calc(depsgraph, scene, ob);
           BKE_pose_where_is(depsgraph, scene, ob); /* needed for bone parents */
 
-          ignore_parent_tx(C, bmain, scene, ob);
+          ignore_parent_tx(bmain, depsgraph, scene, ob);
 
           if (obedit) {
             break;
@@ -1305,7 +1304,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
           BKE_pose_where_is(depsgraph, scene, ob); /* needed for bone parents */
         }
 
-        ignore_parent_tx(C, bmain, scene, ob);
+        ignore_parent_tx(bmain, depsgraph, scene, ob);
 
         /* other users? */
         // CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects)
@@ -1331,7 +1330,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
               /* needed for bone parents */
               BKE_pose_where_is(depsgraph, scene, ob_other);
             }
-            ignore_parent_tx(C, bmain, scene, ob_other);
+            ignore_parent_tx(bmain, depsgraph, scene, ob_other);
           }
         }
         // CTX_DATA_END;



More information about the Bf-blender-cvs mailing list