diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-05-29 17:11:08 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-05-29 18:05:32 +0300 |
commit | e2bac484e02a26616419a4b51385e7068545c44b (patch) | |
tree | 3a747d88564272079f710b35280a35357d2f7b44 /source/blender/editors | |
parent | 36e9ed98e7cbccdf3e1b3085a4be2679aec5a869 (diff) |
Use correct time for curve parent evaluation
Time should alwaus come from depsgraph, not scene.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops_orient.c | 27 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 8 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_snap_object.c | 3 |
3 files changed, 22 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 2c6ef20f1c4..3db52e6a39b 100644 --- a/source/blender/editors/space_clip/tracking_ops_orient.c +++ b/source/blender/editors/space_clip/tracking_ops_orient.c @@ -145,7 +145,8 @@ static int count_selected_bundles(bContext *C) return tot; } -static void object_solver_inverted_matrix(Scene *scene, +static void object_solver_inverted_matrix(Depsgraph *depsgraph, + Scene *scene, Object *ob, float invmat[4][4]) { @@ -162,7 +163,7 @@ static void object_solver_inverted_matrix(Scene *scene, bObjectSolverConstraint *data = (bObjectSolverConstraint *)con->data; if (!found) { Object *cam = data->camera ? data->camera : scene->camera; - BKE_object_where_is_calc_mat4(scene, cam, invmat); + BKE_object_where_is_calc_mat4(depsgraph, scene, cam, invmat); } mul_m4_m4m4(invmat, invmat, data->invmat); found = true; @@ -200,6 +201,7 @@ 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); @@ -236,14 +238,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(scene, camera, mat); + BKE_tracking_get_camera_object_matrix(depsgraph, 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(scene, object, mat); + object_solver_inverted_matrix(depsgraph, scene, object, mat); mul_v3_m4v3(vec, mat, vec); copy_v3_v3(object->loc, vec); } @@ -278,7 +280,8 @@ void CLIP_OT_set_origin(wmOperatorType *ot) /********************** set floor operator *********************/ -static void set_axis(Scene *scene, +static void set_axis(Depsgraph *depsgraph, + Scene *scene, Object *ob, MovieClip *clip, MovieTrackingObject *tracking_object, @@ -292,14 +295,14 @@ static void set_axis(Scene *scene, BKE_object_to_mat4(ob, obmat); - BKE_tracking_get_camera_object_matrix(scene, camera, mat); + BKE_tracking_get_camera_object_matrix(depsgraph, 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(scene, ob, imat); + object_solver_inverted_matrix(depsgraph, scene, ob, imat); mul_v3_m4v3(vec, imat, vec); invert_m4_m4(imat, obmat); @@ -430,7 +433,7 @@ static int set_plane_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - BKE_tracking_get_camera_object_matrix(scene, camera, mat); + BKE_tracking_get_camera_object_matrix(depsgraph, scene, camera, mat); /* Get 3 bundles to use as reference. */ track = tracksbase->first; @@ -493,7 +496,7 @@ static int set_plane_exec(bContext *C, wmOperator *op) } BKE_object_where_is_calc(depsgraph, scene, object); - set_axis(scene, object, clip, tracking_object, axis_track, 'X'); + set_axis(depsgraph, scene, object, clip, tracking_object, axis_track, 'X'); DEG_id_tag_update(&clip->id, 0); DEG_id_tag_update(&object->id, OB_RECALC_OB); @@ -539,6 +542,7 @@ 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"); @@ -567,7 +571,7 @@ static int set_axis_exec(bContext *C, wmOperator *op) track = track->next; } - set_axis(scene, object, clip, tracking_object, track, axis == 0 ? 'X' : 'Y'); + set_axis(depsgraph, scene, object, clip, tracking_object, track, axis == 0 ? 'X' : 'Y'); DEG_id_tag_update(&clip->id, 0); DEG_id_tag_update(&object->id, OB_RECALC_OB); @@ -618,6 +622,7 @@ 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); @@ -642,7 +647,7 @@ static int do_set_scale(bContext *C, } } - BKE_tracking_get_camera_object_matrix(scene, camera, mat); + BKE_tracking_get_camera_object_matrix(depsgraph, scene, camera, mat); track = tracksbase->first; while (track) { diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 13d2ceb4ad4..ac967e3c97c 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -524,7 +524,7 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot) /* **************************************************** */ -static void bundle_midpoint(Scene *scene, Object *ob, float vec[3]) +static void bundle_midpoint(Depsgraph *depsgraph, Scene *scene, Object *ob, float vec[3]) { MovieClip *clip = BKE_object_movieclip_get(scene, ob, false); MovieTracking *tracking; @@ -539,7 +539,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3]) copy_m4_m4(cammat, ob->obmat); - BKE_tracking_get_camera_object_matrix(scene, ob, mat); + BKE_tracking_get_camera_object_matrix(depsgraph, scene, ob, mat); INIT_MINMAX(min, max); @@ -578,7 +578,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3]) static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) { - const Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_depsgraph(C); ViewLayer *view_layer_eval = DEG_get_evaluated_view_layer(depsgraph); Object *obedit = CTX_data_edit_object(C); Scene *scene = CTX_data_scene(C); @@ -650,7 +650,7 @@ static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) if (ob_eval->type == OB_CAMERA) { /* snap to bundles should happen only when bundles are visible */ if (v3d->flag2 & V3D_SHOW_RECONSTRUCTION) { - bundle_midpoint(scene, DEG_get_original_object(ob_eval), vec); + bundle_midpoint(depsgraph, scene, DEG_get_original_object(ob_eval), vec); } } diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 29497fe801c..d3092fa18cd 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -1633,6 +1633,7 @@ static short snapCamera( { short retval = 0; + Depsgraph *depsgraph = sctx->depsgraph; Scene *scene = sctx->scene; bool is_persp = snapdata->view_proj == VIEW_PROJ_PERSP; @@ -1657,7 +1658,7 @@ static short snapCamera( tracking = &clip->tracking; - BKE_tracking_get_camera_object_matrix(scene, object, orig_camera_mat); + BKE_tracking_get_camera_object_matrix(depsgraph, scene, object, orig_camera_mat); invert_m4_m4(orig_camera_imat, orig_camera_mat); invert_m4_m4(imat, obmat); |