From 6ab8cbc68cd1b6c2e8f30e42c57585fa8defaf05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Oct 2020 12:47:12 +1100 Subject: Text: support "Text to 3D Object" for read-only data Add poll function for read-only text data, for operators that don't require the text to be editable. --- source/blender/editors/curve/editfont.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/curve') diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 2a880c11afb..1e5984ee14c 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -635,7 +635,10 @@ void FONT_OT_text_paste_from_file(wmOperatorType *ot) /** \name Text To Object * \{ */ -static void txt_add_object(bContext *C, TextLine *firstline, int totline, const float offset[3]) +static void txt_add_object(bContext *C, + const TextLine *firstline, + int totline, + const float offset[3]) { Main *bmain = CTX_data_main(C); Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); @@ -644,7 +647,7 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, const Curve *cu; Object *obedit; Base *base; - struct TextLine *tmp; + const struct TextLine *tmp; int nchars = 0, nbytes = 0; char *s; int a; @@ -709,10 +712,10 @@ static void txt_add_object(bContext *C, TextLine *firstline, int totline, const WM_event_add_notifier(C, NC_OBJECT | NA_ADDED, obedit); } -void ED_text_to_object(bContext *C, Text *text, const bool split_lines) +void ED_text_to_object(bContext *C, const Text *text, const bool split_lines) { RegionView3D *rv3d = CTX_wm_region_view3d(C); - TextLine *line; + const TextLine *line; float offset[3]; int linenum = 0; -- cgit v1.2.3