Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/gpencil/editaction_gpencil.c
| Show First 20 Lines • Show All 486 Lines • ▼ Show 20 Lines | for (gpfs = gpls->frames.first; gpfs; gpfs = gpfs->next) { | ||||
| * - For now, we don't check if the types will be compatible since we | * - For now, we don't check if the types will be compatible since we | ||||
| * don't have enough info to do so. Instead, we simply just paste, | * don't have enough info to do so. Instead, we simply just paste, | ||||
| * af it works, it will show up. | * af it works, it will show up. | ||||
| */ | */ | ||||
| for (gps = gpfs->strokes.first; gps; gps = gps->next) { | for (gps = gpfs->strokes.first; gps; gps = gps->next) { | ||||
| /* make a copy of stroke, then of its points array */ | /* make a copy of stroke, then of its points array */ | ||||
| gpsn = MEM_dupallocN(gps); | gpsn = MEM_dupallocN(gps); | ||||
| gpsn->points = MEM_dupallocN(gps->points); | gpsn->points = MEM_dupallocN(gps->points); | ||||
| gpsn->dvert = MEM_dupallocN(gps->dvert); | |||||
| BKE_gpencil_stroke_weights_duplicate(gps, gpsn); | |||||
| /* duplicate triangle information */ | /* duplicate triangle information */ | ||||
| gpsn->triangles = MEM_dupallocN(gps->triangles); | gpsn->triangles = MEM_dupallocN(gps->triangles); | ||||
| /* append stroke to frame */ | /* append stroke to frame */ | ||||
| BLI_addtail(&gpf->strokes, gpsn); | BLI_addtail(&gpf->strokes, gpsn); | ||||
| } | } | ||||
| /* if no strokes (i.e. new frame) added, free gpf */ | /* if no strokes (i.e. new frame) added, free gpf */ | ||||
| if (BLI_listbase_is_empty(&gpf->strokes)) | if (BLI_listbase_is_empty(&gpf->strokes)) | ||||
| ▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines | |||||