diff options
Diffstat (limited to 'source/blender/editors/space_clip/tracking_ops_orient.c')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops_orient.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops_orient.c b/source/blender/editors/space_clip/tracking_ops_orient.c index d3fffaa3254..76421cde8f8 100644 --- a/source/blender/editors/space_clip/tracking_ops_orient.c +++ b/source/blender/editors/space_clip/tracking_ops_orient.c @@ -145,8 +145,7 @@ static int count_selected_bundles(bContext *C) return tot; } -static void object_solver_inverted_matrix(Depsgraph *depsgraph, - Scene *scene, +static void object_solver_inverted_matrix(Scene *scene, Object *ob, float invmat[4][4]) { @@ -163,7 +162,7 @@ static void object_solver_inverted_matrix(Depsgraph *depsgraph, bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data; if (!found) { Object *cam = data->camera ? data->camera : scene->camera; - BKE_object_where_is_calc_mat4(depsgraph, scene, cam, invmat); + BKE_object_where_is_calc_mat4(cam, invmat); } mul_m4_m4m4(invmat, invmat, data->invmat); found = true; @@ -201,7 +200,6 @@ static int set_origin_exec(bContext *C, wmOperator *op) MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; Scene *scene = CTX_data_scene(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); Object *camera = get_camera_with_movieclip(scene, clip); int selected_count = count_selected_bundles(C); @@ -238,14 +236,14 @@ static int set_origin_exec(bContext *C, wmOperator *op) mul_v3_fl(median, 1.0f / selected_count); float mat[4][4], vec[3]; - BKE_tracking_get_camera_object_matrix(depsgraph, scene, camera, mat); + BKE_tracking_get_camera_object_matrix(scene, camera, mat); mul_v3_m4v3(vec, mat, median); if (tracking_object->flag & TRACKING_OBJECT_CAMERA) { sub_v3_v3(object->loc, vec); } else { - object_solver_inverted_matrix(depsgraph, scene, object, mat); + object_solver_inverted_matrix(scene, object, mat); mul_v3_m4v3(vec, mat, vec); copy_v3_v3(object->loc, vec); } @@ -280,8 +278,7 @@ void CLIP_OT_set_origin(wmOperatorType *ot) /********************** set floor operator *********************/ -static void set_axis(Depsgraph *depsgraph, - Scene *scene, +static void set_axis(Scene *scene, Object *ob, MovieClip *clip, MovieTrackingObject *tracking_object, @@ -295,14 +292,14 @@ static void set_axis(Depsgraph *depsgraph, BKE_object_to_mat4(ob, obmat); - BKE_tracking_get_camera_object_matrix(depsgraph, scene, camera, mat); + BKE_tracking_get_camera_object_matrix(scene, camera, mat); mul_v3_m4v3(vec, mat, track->bundle_pos); copy_v3_v3(dvec, vec); if (!is_camera) { float imat[4][4]; - object_solver_inverted_matrix(depsgraph, scene, ob, imat); + object_solver_inverted_matrix(scene, ob, imat); mul_v3_m4v3(vec, imat, vec); invert_m4_m4(imat, obmat); @@ -433,7 +430,7 @@ static int set_plane_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - BKE_tracking_get_camera_object_matrix(depsgraph, scene, camera, mat); + BKE_tracking_get_camera_object_matrix(scene, camera, mat); /* Get 3 bundles to use as reference. */ track = tracksbase->first; @@ -496,7 +493,7 @@ static int set_plane_exec(bContext *C, wmOperator *op) } BKE_object_where_is_calc(depsgraph, scene, object); - set_axis(depsgraph, scene, object, clip, tracking_object, axis_track, 'X'); + set_axis(scene, object, clip, tracking_object, axis_track, 'X'); DEG_id_tag_update(&clip->id, 0); DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM); @@ -542,7 +539,6 @@ static int set_axis_exec(bContext *C, wmOperator *op) MovieTracking *tracking = &clip->tracking; MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); Scene *scene = CTX_data_scene(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); Object *object; int axis = RNA_enum_get(op->ptr, "axis"); @@ -571,7 +567,7 @@ static int set_axis_exec(bContext *C, wmOperator *op) track = track->next; } - set_axis(depsgraph, scene, object, clip, tracking_object, track, axis == 0 ? 'X' : 'Y'); + set_axis(scene, object, clip, tracking_object, track, axis == 0 ? 'X' : 'Y'); DEG_id_tag_update(&clip->id, 0); DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM); @@ -622,7 +618,6 @@ static int do_set_scale(bContext *C, MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); MovieTrackingTrack *track; Scene *scene = CTX_data_scene(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); Object *object = NULL; Object *camera = get_camera_with_movieclip(scene, clip); ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); @@ -647,7 +642,7 @@ static int do_set_scale(bContext *C, } } - BKE_tracking_get_camera_object_matrix(depsgraph, scene, camera, mat); + BKE_tracking_get_camera_object_matrix(scene, camera, mat); track = tracksbase->first; while (track) { |