Bugfix [#25721] Unable to delete grease pencil data blocks
Missing check for id-block users before saving
This commit is contained in:
@@ -1948,21 +1948,23 @@ static void write_gpencils(WriteData *wd, ListBase *lb)
|
||||
bGPDstroke *gps;
|
||||
|
||||
for (gpd= lb->first; gpd; gpd= gpd->id.next) {
|
||||
/* write gpd data block to file */
|
||||
writestruct(wd, ID_GD, "bGPdata", 1, gpd);
|
||||
|
||||
/* write grease-pencil layers to file */
|
||||
for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
|
||||
writestruct(wd, DATA, "bGPDlayer", 1, gpl);
|
||||
if (gpd->id.us>0 || wd->current) {
|
||||
/* write gpd data block to file */
|
||||
writestruct(wd, ID_GD, "bGPdata", 1, gpd);
|
||||
|
||||
/* write this layer's frames to file */
|
||||
for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
|
||||
writestruct(wd, DATA, "bGPDframe", 1, gpf);
|
||||
/* write grease-pencil layers to file */
|
||||
for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
|
||||
writestruct(wd, DATA, "bGPDlayer", 1, gpl);
|
||||
|
||||
/* write strokes */
|
||||
for (gps= gpf->strokes.first; gps; gps= gps->next) {
|
||||
writestruct(wd, DATA, "bGPDstroke", 1, gps);
|
||||
writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);
|
||||
/* write this layer's frames to file */
|
||||
for (gpf= gpl->frames.first; gpf; gpf= gpf->next) {
|
||||
writestruct(wd, DATA, "bGPDframe", 1, gpf);
|
||||
|
||||
/* write strokes */
|
||||
for (gps= gpf->strokes.first; gps; gps= gps->next) {
|
||||
writestruct(wd, DATA, "bGPDstroke", 1, gps);
|
||||
writestruct(wd, DATA, "bGPDspoint", gps->totpoints, gps->points);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user