Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/curve/editfont.c
| Show First 20 Lines • Show All 414 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /******************* 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); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneLayer *sl = CTX_data_scene_layer(C); | |||||
| Curve *cu; | Curve *cu; | ||||
| Object *obedit; | Object *obedit; | ||||
| Base *base; | ObjectBase *base; | ||||
| struct TextLine *tmp; | struct TextLine *tmp; | ||||
| int nchars = 0, nbytes = 0; | int nchars = 0, nbytes = 0; | ||||
| char *s; | char *s; | ||||
| int a; | int a; | ||||
| float rot[3] = {0.f, 0.f, 0.f}; | float rot[3] = {0.f, 0.f, 0.f}; | ||||
| obedit = BKE_object_add(bmain, scene, OB_FONT, NULL); | obedit = BKE_object_add(bmain, scene, sl, OB_FONT, NULL); | ||||
| base = scene->basact; | base = sl->basact; | ||||
| /* seems to assume view align ? TODO - look into this, could be an operator option */ | /* seems to assume view align ? TODO - look into this, could be an operator option */ | ||||
| ED_object_base_init_transform(C, base, NULL, rot); | ED_object_base_init_transform(C, base, NULL, rot); | ||||
| BKE_object_where_is_calc(scene, obedit); | BKE_object_where_is_calc(scene, obedit); | ||||
| add_v3_v3(obedit->loc, offset); | add_v3_v3(obedit->loc, offset); | ||||
| ▲ Show 20 Lines • Show All 1,440 Lines • Show Last 20 Lines | |||||