Bugfix [#25721] Unable to delete grease pencil data blocks

Missing check for id-block users before saving
This commit is contained in:
2011-01-19 22:49:09 +00:00
parent f0d9ff34af
commit 677ed28b3e

View File

@@ -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);
}
}
}
}