Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2011-01-20 01:49:09 +0300
committerJoshua Leung <aligorith@gmail.com>2011-01-20 01:49:09 +0300
commit677ed28b3e016883c0138f069c6939fb88cb37b1 (patch)
treed67edfcbcaa1a0d3b323422127141042dcb40d47 /source/blender/blenloader
parentf0d9ff34af265e6f6172c4912ff2efbde37f05b2 (diff)
Bugfix [#25721] Unable to delete grease pencil data blocks
Missing check for id-block users before saving
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/writefile.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 925b66f84a9..263d799aa69 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -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);
+ }
}
}
}