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:
authorCampbell Barton <ideasman42@gmail.com>2017-04-26 19:36:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-04-26 19:36:56 +0300
commita7c5d2e159d59e045983009e191c94c1bf561f5d (patch)
treef0432d6c29fab29c749a9f635a4d919338533822 /source/blender/editors/space_view3d/view3d_edit.c
parentedd1512741f9a8fd9c3d93f47ccf367932cff32a (diff)
Pass graph to depth functions
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 019a431fc19..028d613ba8c 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -729,13 +729,14 @@ static void viewops_data_create_ex(bContext *C, wmOperator *op, const wmEvent *e
}
else if (use_orbit_zbuf) {
Scene *scene = CTX_data_scene(C);
+ struct Depsgraph *graph = CTX_data_depsgraph(C);
float fallback_depth_pt[3];
view3d_operator_needs_opengl(C); /* needed for zbuf drawing */
negate_v3_v3(fallback_depth_pt, rv3d->ofs);
- if ((vod->use_dyn_ofs = ED_view3d_autodist(scene, vod->ar, vod->v3d,
+ if ((vod->use_dyn_ofs = ED_view3d_autodist(graph, scene, vod->ar, vod->v3d,
event->mval, vod->dyn_ofs, true, fallback_depth_pt)))
{
if (rv3d->is_persp) {
@@ -3277,6 +3278,7 @@ static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *ev
ARegion *ar = CTX_wm_region(C);
if (rv3d) {
+ struct Depsgraph *graph = CTX_data_depsgraph(C);
float new_ofs[3];
const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
@@ -3284,7 +3286,7 @@ static int viewcenter_pick_invoke(bContext *C, wmOperator *op, const wmEvent *ev
view3d_operator_needs_opengl(C);
- if (ED_view3d_autodist(scene, ar, v3d, event->mval, new_ofs, false, NULL)) {
+ if (ED_view3d_autodist(graph, scene, ar, v3d, event->mval, new_ofs, false, NULL)) {
/* pass */
}
else {
@@ -3571,7 +3573,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(scene, ar, v3d, true);
+ ED_view3d_draw_depth(CTX_data_depsgraph(C), scene, ar, v3d, true);
{
/* avoid allocating the whole depth buffer */
@@ -4672,8 +4674,9 @@ 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(scene, ar, v3d, mval, fp, true, NULL))
+ if (ED_view3d_autodist(graph, scene, ar, v3d, mval, fp, true, NULL))
depth_used = true;
}
@@ -4849,7 +4852,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(
- Scene *scene, ARegion *ar, View3D *v3d,
+ struct Depsgraph *graph, Scene *scene, ARegion *ar, View3D *v3d,
const int mval[2], float mouse_worldloc[3],
const bool alphaoverride, const float fallback_depth_pt[3])
{
@@ -4859,7 +4862,7 @@ bool ED_view3d_autodist(
bool depth_ok = false;
/* Get Z Depths, needed for perspective, nice for ortho */
- ED_view3d_draw_depth(scene, ar, v3d, alphaoverride);
+ ED_view3d_draw_depth(graph, scene, ar, v3d, alphaoverride);
/* Attempt with low margin's first */
i = 0;
@@ -4887,12 +4890,14 @@ bool ED_view3d_autodist(
}
}
-void ED_view3d_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode)
+void ED_view3d_autodist_init(
+ struct Depsgraph *graph,
+ Scene *scene, ARegion *ar, View3D *v3d, int mode)
{
/* Get Z Depths, needed for perspective, nice for ortho */
switch (mode) {
case 0:
- ED_view3d_draw_depth(scene, ar, v3d, true);
+ ED_view3d_draw_depth(graph, scene, ar, v3d, true);
break;
case 1:
ED_view3d_draw_depth_gpencil(scene, ar, v3d);