diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-30 22:36:02 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-09-30 22:37:32 +0300 |
commit | 3a09ff77a1d74af2df7da5225c8292d3cf1243a6 (patch) | |
tree | 565eb6ebd2a97675c7f508c0af68a4c09c0b6703 /source/blender/editors/curve/editfont.c | |
parent | 0722981e99b0f174067b9d07eeaf7c55401f85eb (diff) |
Fix T56879: Blender2.8 Crash when Editing Text on Curve.
Moving cursor in 3D text edit mode calls `BKE_vfont_to_curve_ex()`,
which expects to work with evaluated data (curve cache runtime etc.).
Diffstat (limited to 'source/blender/editors/curve/editfont.c')
-rw-r--r-- | source/blender/editors/curve/editfont.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 0275cb68550..b87584dc8b7 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -56,6 +56,7 @@ #include "BKE_report.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "RNA_access.h" #include "RNA_define.h" @@ -246,6 +247,7 @@ 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; @@ -258,7 +260,8 @@ 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 */ - BKE_vfont_to_curve(obedit, mode); + /* We need evaluated data here. */ + BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), mode); } cu->curinfo = ef->textbufinfo[ef->pos ? ef->pos - 1 : 0]; @@ -895,6 +898,7 @@ static const EnumPropertyItem move_type_items[] = { static int move_cursor(bContext *C, int type, const bool select) { + Depsgraph *depsgraph = CTX_data_depsgraph(C); Object *obedit = CTX_data_edit_object(C); Curve *cu = obedit->data; EditFont *ef = cu->editfont; @@ -977,17 +981,17 @@ static int move_cursor(bContext *C, int type, const bool select) else if (ef->pos >= MAXTEXT) ef->pos = MAXTEXT; else if (ef->pos < 0) ef->pos = 0; - /* apply virtical cursor motion to position immediately + /* apply vertical cursor motion to position immediately * otherwise the selection will lag behind */ if (FO_CURS_IS_MOTION(cursmove)) { - BKE_vfont_to_curve(obedit, cursmove); + BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), cursmove); cursmove = FO_CURS; } if (select == 0) { if (ef->selstart) { ef->selstart = ef->selend = 0; - BKE_vfont_to_curve(obedit, FO_SELCHANGE); + BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), FO_SELCHANGE); } } |