Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editfont.c
| Show First 20 Lines • Show All 401 Lines • ▼ Show 20 Lines | static int insert_into_textbuf(Object *obedit, uintptr_t c) | ||||
| } | } | ||||
| else { | else { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||
| static void text_update_edited(bContext *C, Object *obedit, int mode) | static void text_update_edited(bContext *C, Object *obedit, int mode) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | |||||
| Curve *cu = obedit->data; | Curve *cu = obedit->data; | ||||
| EditFont *ef = cu->editfont; | EditFont *ef = cu->editfont; | ||||
| BLI_assert(ef->len >= 0); | BLI_assert(ef->len >= 0); | ||||
| /* run update first since it can move the cursor */ | /* run update first since it can move the cursor */ | ||||
| if (mode == FO_EDIT) { | if (mode == FO_EDIT) { | ||||
| /* re-tesselllate */ | /* re-tesselllate */ | ||||
| DEG_id_tag_update(obedit->data, 0); | DEG_id_tag_update(obedit->data, 0); | ||||
| } | } | ||||
| else { | else { | ||||
| /* depsgraph runs above, but since we're not tagging for update, call direct */ | /* depsgraph runs above, but since we're not tagging for update, call direct */ | ||||
| /* We need evaluated data here. */ | /* We need evaluated data here. */ | ||||
| Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); | |||||
| BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), mode); | BKE_vfont_to_curve(DEG_get_evaluated_object(depsgraph, obedit), mode); | ||||
| } | } | ||||
| cu->curinfo = ef->textbufinfo[ef->pos ? ef->pos - 1 : 0]; | cu->curinfo = ef->textbufinfo[ef->pos ? ef->pos - 1 : 0]; | ||||
| if (obedit->totcol > 0) { | if (obedit->totcol > 0) { | ||||
| obedit->actcol = cu->curinfo.mat_nr; | obedit->actcol = cu->curinfo.mat_nr; | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | WM_operator_properties_filesel(ot, | ||||
| FILE_SORT_ALPHA); | FILE_SORT_ALPHA); | ||||
| } | } | ||||
| /******************* text to object operator ********************/ | /******************* text to object operator ********************/ | ||||
| static void txt_add_object(bContext *C, TextLine *firstline, int totline, const float offset[3]) | static void txt_add_object(bContext *C, TextLine *firstline, int totline, const float offset[3]) | ||||
| { | { | ||||
| Main *bmain = CTX_data_main(C); | 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); | Scene *scene = CTX_data_scene(C); | ||||
| ViewLayer *view_layer = CTX_data_view_layer(C); | ViewLayer *view_layer = CTX_data_view_layer(C); | ||||
| Curve *cu; | Curve *cu; | ||||
| Object *obedit; | Object *obedit; | ||||
| Base *base; | Base *base; | ||||
| struct TextLine *tmp; | struct TextLine *tmp; | ||||
| int nchars = 0, nbytes = 0; | int nchars = 0, nbytes = 0; | ||||
| char *s; | char *s; | ||||
| ▲ Show 20 Lines • Show All 477 Lines • ▼ Show 20 Lines | static const EnumPropertyItem move_type_items[] = { | ||||
| {NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""}, | {NEXT_LINE, "NEXT_LINE", 0, "Next Line", ""}, | ||||
| {PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""}, | {PREV_PAGE, "PREVIOUS_PAGE", 0, "Previous Page", ""}, | ||||
| {NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""}, | {NEXT_PAGE, "NEXT_PAGE", 0, "Next Page", ""}, | ||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| static int move_cursor(bContext *C, int type, const bool select) | 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); | Object *obedit = CTX_data_edit_object(C); | ||||
| Curve *cu = obedit->data; | Curve *cu = obedit->data; | ||||
| EditFont *ef = cu->editfont; | EditFont *ef = cu->editfont; | ||||
| int cursmove = -1; | int cursmove = -1; | ||||
| if ((select) && (ef->selstart == 0)) { | if ((select) && (ef->selstart == 0)) { | ||||
| ef->selstart = ef->selend = ef->pos + 1; | ef->selstart = ef->selend = ef->pos + 1; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,097 Lines • Show Last 20 Lines | |||||