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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-06 13:07:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-16 20:55:33 +0300
commit34ab90f546f097cada951b2c9ca22bf271996980 (patch)
treeebcdb3d37120ac1d8fb16462b9104badd1800329 /source/blender/editors/gpencil
parent0c495005dd83913864acb510c1d4194a2275dbb0 (diff)
Depsgraph: remove EvaluationContext, pass Depsgraph instead.
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c5
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c14
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c5
4 files changed, 9 insertions, 17 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 942aa861cec..50a6e9125a0 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -1672,7 +1672,7 @@ void ED_gpencil_draw_view2d(const bContext *C, bool onlyv2d)
void ED_gpencil_draw_view3d(wmWindowManager *wm,
Scene *scene,
ViewLayer *view_layer,
- const struct Depsgraph *depsgraph,
+ struct Depsgraph *depsgraph,
View3D *v3d,
ARegion *ar,
bool only3d)
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 1eee774fd3e..4f9abff292a 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -2109,12 +2109,9 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op)
/* init autodist for geometry projection */
if (mode == GP_REPROJECT_SURFACE) {
- EvaluationContext eval_ctx;
- CTX_data_eval_ctx(C, &eval_ctx);
-
struct Depsgraph *graph = CTX_data_depsgraph(C);
view3d_region_operator_needs_opengl(CTX_wm_window(C), gsc.ar);
- ED_view3d_autodist_init(&eval_ctx, graph, gsc.ar, CTX_wm_view3d(C), 0);
+ ED_view3d_autodist_init(graph, gsc.ar, CTX_wm_view3d(C), 0);
}
// TODO: For deforming geometry workflow, create new frames?
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 77e5dc8fe5d..b74d6ed8d69 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -115,7 +115,6 @@ typedef enum eGPencil_PaintFlags {
* "p" = op->customdata
*/
typedef struct tGPsdata {
- EvaluationContext eval_ctx;
Scene *scene; /* current scene from context */
struct Depsgraph *graph;
@@ -646,7 +645,7 @@ static short gp_stroke_addpoint(
view3d_region_operator_needs_opengl(p->win, p->ar);
ED_view3d_autodist_init(
- &p->eval_ctx, p->graph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
+ p->graph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
}
/* convert screen-coordinates to appropriate coordinates (and store them) */
@@ -1247,7 +1246,7 @@ static void gp_stroke_doeraser(tGPsdata *p)
if (p->flags & GP_PAINTFLAG_V3D_ERASER_DEPTH) {
View3D *v3d = p->sa->spacedata.first;
view3d_region_operator_needs_opengl(p->win, p->ar);
- ED_view3d_autodist_init(&p->eval_ctx, p->graph, p->ar, v3d, 0);
+ ED_view3d_autodist_init(p->graph, p->ar, v3d, 0);
}
}
@@ -1400,7 +1399,6 @@ static bool gp_session_initdata(bContext *C, tGPsdata *p)
}
/* pass on current scene and window */
- CTX_data_eval_ctx(C, &p->eval_ctx);
p->scene = CTX_data_scene(C);
p->graph = CTX_data_depsgraph(C);
p->win = CTX_wm_window(C);
@@ -1608,7 +1606,7 @@ static void gp_session_cleanup(tGPsdata *p)
}
/* init new stroke */
-static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, const Depsgraph *depsgraph)
+static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Depsgraph *depsgraph)
{
Scene *scene = p->scene;
ToolSettings *ts = scene->toolsettings;
@@ -1815,7 +1813,7 @@ static void gp_paint_strokeend(tGPsdata *p)
/* need to restore the original projection settings before packing up */
view3d_region_operator_needs_opengl(p->win, p->ar);
- ED_view3d_autodist_init(&p->eval_ctx, p->graph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
+ ED_view3d_autodist_init(p->graph, p->ar, v3d, (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) ? 1 : 0);
}
/* check if doing eraser or not */
@@ -2055,7 +2053,7 @@ static void gpencil_draw_status_indicators(tGPsdata *p)
/* ------------------------------- */
/* create a new stroke point at the point indicated by the painting context */
-static void gpencil_draw_apply(wmOperator *op, tGPsdata *p, const Depsgraph *depsgraph)
+static void gpencil_draw_apply(wmOperator *op, tGPsdata *p, Depsgraph *depsgraph)
{
/* handle drawing/erasing -> test for erasing first */
if (p->paintmode == GP_PAINTMODE_ERASER) {
@@ -2110,7 +2108,7 @@ static void gpencil_draw_apply(wmOperator *op, tGPsdata *p, const Depsgraph *dep
}
/* handle draw event */
-static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event, const Depsgraph *depsgraph)
+static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event, Depsgraph *depsgraph)
{
tGPsdata *p = op->customdata;
PointerRNA itemptr;
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 94689fb59fa..d7e5b5a92aa 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -542,14 +542,11 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
View3D *v3d = (View3D *)CTX_wm_space_data(C);
RegionView3D *rv3d = ar->regiondata;
- EvaluationContext eval_ctx;
- CTX_data_eval_ctx(C, &eval_ctx);
-
/* init 3d depth buffers */
view3d_operator_needs_opengl(C);
view3d_region_operator_needs_opengl(win, ar);
- ED_view3d_autodist_init(&eval_ctx, graph, ar, v3d, 0);
+ ED_view3d_autodist_init(graph, ar, v3d, 0);
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {