diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8bb0619c45b..067f5781392 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -745,7 +745,7 @@ static void viewops_data_create_ex( negate_v3_v3(fallback_depth_pt, rv3d->ofs); vod->use_dyn_ofs = ED_view3d_autodist( - graph, vod->ar, vod->v3d, + C, graph, vod->ar, vod->v3d, event->mval, vod->dyn_ofs, true, fallback_depth_pt); } else { @@ -3324,7 +3324,7 @@ static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *ev view3d_operator_needs_opengl(C); - if (ED_view3d_autodist(graph, ar, v3d, event->mval, new_ofs, false, NULL)) { + if (ED_view3d_autodist(C, graph, ar, v3d, event->mval, new_ofs, false, NULL)) { /* pass */ } else { @@ -3610,7 +3610,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) ED_view3d_dist_range_get(v3d, dist_range); /* Get Z Depths, needed for perspective, nice for ortho */ - ED_view3d_draw_depth(CTX_data_depsgraph(C), ar, v3d, true); + ED_view3d_draw_depth(C, CTX_data_depsgraph(C), ar, v3d, true); { /* avoid allocating the whole depth buffer */ @@ -4712,7 +4712,7 @@ void ED_view3d_cursor3d_position(bContext *C, float fp[3], const int mval[2]) if (U.uiflag & USER_ZBUF_CURSOR) { /* maybe this should be accessed some other way */ struct Depsgraph *graph = CTX_data_depsgraph(C); view3d_operator_needs_opengl(C); - if (ED_view3d_autodist(graph, ar, v3d, mval, fp, true, NULL)) { + if (ED_view3d_autodist(C, graph, ar, v3d, mval, fp, true, NULL)) { depth_used = true; } } @@ -4889,7 +4889,7 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg * \param fallback_depth_pt: Use this points depth when no depth can be found. */ bool ED_view3d_autodist( - struct Depsgraph *graph, ARegion *ar, View3D *v3d, + const bContext *C, struct Depsgraph *graph, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3], const bool alphaoverride, const float fallback_depth_pt[3]) { @@ -4899,7 +4899,7 @@ bool ED_view3d_autodist( bool depth_ok = false; /* Get Z Depths, needed for perspective, nice for ortho */ - ED_view3d_draw_depth(graph, ar, v3d, alphaoverride); + ED_view3d_draw_depth(C, graph, ar, v3d, alphaoverride); /* Attempt with low margin's first */ i = 0; @@ -4928,18 +4928,18 @@ bool ED_view3d_autodist( } void ED_view3d_autodist_init( - struct Depsgraph *graph, + const bContext *C, struct Depsgraph *graph, ARegion *ar, View3D *v3d, int mode) { /* Get Z Depths, needed for perspective, nice for ortho */ switch (mode) { case 0: - ED_view3d_draw_depth(graph, ar, v3d, true); + ED_view3d_draw_depth(C, graph, ar, v3d, true); break; case 1: { Scene *scene = DEG_get_evaluated_scene(graph); - ED_view3d_draw_depth_gpencil(scene, ar, v3d); + ED_view3d_draw_depth_gpencil(C, scene, ar, v3d); break; } } @@ -5144,6 +5144,7 @@ void ED_view3d_from_object(Object *ob, float ofs[3], float quat[4], float *dist, void ED_view3d_to_object(Object *ob, const float ofs[3], const float quat[4], const float dist) { float mat[4][4]; + ED_view3d_to_m4(mat, ofs, quat, dist); BKE_object_apply_mat4(ob, mat, true, true); } |