Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-19 13:15:10 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-19 15:03:23 +0300
commit54e6b262a14b23160fdecfec68f3e22dcf70bb3e (patch)
tree8f689a1cb894bf75f4f96d25214e93a6d5c96908 /source/blender/editors/object/object_transform.c
parent4dc71367c7001a6d5395780e5493076d5d700300 (diff)
Cleanup: Pass explicit dependency graph
Avoids hash lookup on per-object basis when applying transform.
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r--source/blender/editors/object/object_transform.c11
1 files changed, 5 insertions, 6 deletions
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;