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:
authorNicholas Bishop <nicholasbishop@gmail.com>2009-08-17 04:39:00 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-17 04:39:00 +0400
commit951895b6197925b1dd9f7be884539f809e82f994 (patch)
treec17b3f295db064416e4302473a09b6cc70379a8f /source/blender/blenloader/intern/writefile.c
parent79da01a288e1ef0725bb5bf79428dc6a7aacd172 (diff)
2.5 Paint:
* Refactored the file write/read code for the new Paint type. Just used for sculpt for now, but this'll make it easier when the other paint modes are converted.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r--source/blender/blenloader/intern/writefile.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 366480f3c82..6822305e75f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1676,6 +1676,11 @@ static void write_lamps(WriteData *wd, ListBase *idbase)
}
}
+static void write_paint(WriteData *wd, Paint *p)
+{
+ if(p && p->brushes)
+ writedata(wd, DATA, p->brush_count * sizeof(Brush*), p->brushes);
+}
static void write_scenes(WriteData *wd, ListBase *scebase)
{
@@ -1688,6 +1693,7 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
TimeMarker *marker;
TransformOrientation *ts;
SceneRenderLayer *srl;
+ ToolSettings *tos;
sce= scebase->first;
while(sce) {
@@ -1705,17 +1711,15 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
base= base->next;
}
- writestruct(wd, DATA, "ToolSettings", 1, sce->toolsettings);
- if(sce->toolsettings->vpaint)
- writestruct(wd, DATA, "VPaint", 1, sce->toolsettings->vpaint);
- if(sce->toolsettings->wpaint)
- writestruct(wd, DATA, "VPaint", 1, sce->toolsettings->wpaint);
- if(sce->toolsettings->sculpt) {
- writestruct(wd, DATA, "Sculpt", 1, sce->toolsettings->sculpt);
- if(sce->toolsettings->sculpt->paint.brushes) {
- Paint *p = &sce->toolsettings->sculpt->paint;
- writedata(wd, DATA, p->brush_count * sizeof(Brush*), p->brushes);
- }
+ tos = sce->toolsettings;
+ writestruct(wd, DATA, "ToolSettings", 1, tos);
+ if(tos->vpaint)
+ writestruct(wd, DATA, "VPaint", 1, tos->vpaint);
+ if(tos->wpaint)
+ writestruct(wd, DATA, "VPaint", 1, tos->wpaint);
+ if(tos->sculpt) {
+ writestruct(wd, DATA, "Sculpt", 1, tos->sculpt);
+ write_paint(wd, &tos->sculpt->paint);
}
ed= sce->ed;