Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/gpencil_convert.c
| Show First 20 Lines • Show All 1,173 Lines • ▼ Show 20 Lines | static void gp_layer_to_curve( | ||||
| /* init the curve object (remove rotation and get curve data from it) | /* init the curve object (remove rotation and get curve data from it) | ||||
| * - must clear transforms set on object, as those skew our results | * - must clear transforms set on object, as those skew our results | ||||
| */ | */ | ||||
| ob = BKE_object_add_only_object(bmain, OB_CURVE, gpl->info); | ob = BKE_object_add_only_object(bmain, OB_CURVE, gpl->info); | ||||
| cu = ob->data = BKE_curve_add(bmain, gpl->info, OB_CURVE); | cu = ob->data = BKE_curve_add(bmain, gpl->info, OB_CURVE); | ||||
| BKE_collection_object_add(bmain, collection, ob); | BKE_collection_object_add(bmain, collection, ob); | ||||
| base_new = BKE_view_layer_base_find(view_layer, ob); | base_new = BKE_view_layer_base_find(view_layer, ob); | ||||
| DEG_relations_tag_update(bmain); /* added object */ | |||||
| cu->flag |= CU_3D; | cu->flag |= CU_3D; | ||||
| gtd->inittime = ((bGPDstroke *)gpf->strokes.first)->inittime; | gtd->inittime = ((bGPDstroke *)gpf->strokes.first)->inittime; | ||||
| /* add points to curve */ | /* add points to curve */ | ||||
| for (gps = gpf->strokes.first; gps; gps = gps->next) { | for (gps = gpf->strokes.first; gps; gps = gps->next) { | ||||
| const bool add_start_point = (link_strokes && !(prev_gps)); | const bool add_start_point = (link_strokes && !(prev_gps)); | ||||
| ▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines | |||||