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/mesh/editmesh_path.c
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/mesh/editmesh_path.c')
-rw-r--r--source/blender/editors/mesh/editmesh_path.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c
index 2ae48bee095..4081e3b0302 100644
--- a/source/blender/editors/mesh/editmesh_path.c
+++ b/source/blender/editors/mesh/editmesh_path.c
@@ -578,19 +578,19 @@ static bool edbm_shortest_path_pick_ex(
static int edbm_shortest_path_pick_exec(bContext *C, wmOperator *op);
-static BMElem *edbm_elem_find_nearest(const struct EvaluationContext *eval_ctx, ViewContext *vc, const char htype)
+static BMElem *edbm_elem_find_nearest(ViewContext *vc, const char htype)
{
BMEditMesh *em = vc->em;
float dist = ED_view3d_select_dist_px();
if ((em->selectmode & SCE_SELECT_VERTEX) && (htype == BM_VERT)) {
- return (BMElem *)EDBM_vert_find_nearest(eval_ctx, vc, &dist);
+ return (BMElem *)EDBM_vert_find_nearest(vc, &dist);
}
else if ((em->selectmode & SCE_SELECT_EDGE) && (htype == BM_EDGE)) {
- return (BMElem *)EDBM_edge_find_nearest(eval_ctx, vc, &dist);
+ return (BMElem *)EDBM_edge_find_nearest(vc, &dist);
}
else if ((em->selectmode & SCE_SELECT_FACE) && (htype == BM_FACE)) {
- return (BMElem *)EDBM_face_find_nearest(eval_ctx, vc, &dist);
+ return (BMElem *)EDBM_face_find_nearest(vc, &dist);
}
return NULL;
@@ -613,12 +613,10 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE
return edbm_shortest_path_pick_exec(C, op);
}
- EvaluationContext eval_ctx;
ViewContext vc;
BMEditMesh *em;
bool track_active = true;
- CTX_data_eval_ctx(C, &eval_ctx);
em_setup_viewcontext(C, &vc);
copy_v2_v2_int(vc.mval, event->mval);
em = vc.em;
@@ -627,14 +625,14 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE
BMElem *ele_src, *ele_dst;
if (!(ele_src = edbm_elem_active_elem_or_face_get(em->bm)) ||
- !(ele_dst = edbm_elem_find_nearest(&eval_ctx, &vc, ele_src->head.htype)))
+ !(ele_dst = edbm_elem_find_nearest(&vc, ele_src->head.htype)))
{
/* special case, toggle edge tags even when we don't have a path */
if (((em->selectmode & SCE_SELECT_EDGE) &&
(vc.scene->toolsettings->edge_mode != EDGE_MODE_SELECT)) &&
/* check if we only have a destination edge */
((ele_src == NULL) &&
- (ele_dst = edbm_elem_find_nearest(&eval_ctx, &vc, BM_EDGE))))
+ (ele_dst = edbm_elem_find_nearest(&vc, BM_EDGE))))
{
ele_src = ele_dst;
track_active = false;