diff options
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 11 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_paint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont.c | 6 |
3 files changed, 10 insertions, 13 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index d1d43a49826..047b78af7b1 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -7094,16 +7094,17 @@ static bool match_texture_space_poll(bContext *C) static int match_texture_space_exec(bContext *C, wmOperator *UNUSED(op)) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); - Scene *scene = CTX_data_scene(C); + /* Need to ensure the dependency graph is fully evaluated, so the display list is at a correct + * state. */ + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); + (void)depsgraph; + Object *object = CTX_data_active_object(C); Curve *curve = (Curve *)object->data; float min[3], max[3], size[3], loc[3]; int a; - if (object->runtime.curve_cache == NULL) { - BKE_displist_make_curveTypes(depsgraph, scene, object, false, false); - } + BLI_assert(object->runtime.curve_cache != NULL); INIT_MINMAX(min, max); BKE_displist_minmax(&object->runtime.curve_cache->disp, min, max); diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 6811e32cc2a..5e0053782d4 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -89,8 +89,6 @@ struct StrokeElem { }; struct CurveDrawData { - Depsgraph *depsgraph; - short init_event_type; short curve_type; @@ -578,8 +576,6 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke) struct CurveDrawData *cdd = MEM_callocN(sizeof(*cdd), __func__); - cdd->depsgraph = CTX_data_depsgraph(C); - if (is_invoke) { ED_view3d_viewcontext_init(C, &cdd->vc); if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) { @@ -590,7 +586,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke) } else { cdd->vc.bmain = CTX_data_main(C); - cdd->vc.depsgraph = CTX_data_depsgraph(C); + cdd->vc.depsgraph = CTX_data_ensure_evaluated_depsgraph(C); cdd->vc.scene = CTX_data_scene(C); cdd->vc.view_layer = CTX_data_view_layer(C); cdd->vc.obedit = CTX_data_edit_object(C); diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index db3d5ad401d..c912cea5937 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -407,7 +407,6 @@ static int insert_into_textbuf(Object *obedit, uintptr_t c) static void text_update_edited(bContext *C, Object *obedit, int mode) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); Curve *cu = obedit->data; EditFont *ef = cu->editfont; @@ -421,6 +420,7 @@ static void text_update_edited(bContext *C, Object *obedit, int mode) else { /* depsgraph runs above, but since we're not tagging for update, call direct */ /* We need evaluated data here. */ + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), mode); } @@ -590,7 +590,7 @@ void FONT_OT_text_paste_from_file(wmOperatorType *ot) static void txt_add_object(bContext *C, TextLine *firstline, int totline, const float offset[3]) { Main *bmain = CTX_data_main(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Curve *cu; @@ -1084,7 +1084,7 @@ static const EnumPropertyItem move_type_items[] = { static int move_cursor(bContext *C, int type, const bool select) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); Object *obedit = CTX_data_edit_object(C); Curve *cu = obedit->data; EditFont *ef = cu->editfont; |