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:
authorCampbell Barton <ideasman42@gmail.com>2010-08-04 16:18:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-04 16:18:07 +0400
commit1f77f7b05af24d3117d76d8c2ec43dbee031ab6a (patch)
treec3262b326313bb4c1cdf0dc6894204e4eaf3bdd9 /source/blender/blenloader
parent2f8f86e4f6afe8ecdff5c57bdbcc1c0d9b18301e (diff)
Brush/Paint internal changes
- remove brush array for each Paint struct, just use a single brush pointer. - removed rna function based template filtering. - filter brushes using a flag on the brush and the pointer poll function. - set the brushes using a new operator WM_OT_context_set_id(). TODO - remake startup.blend, currently brush groupings are lost. - rewrite WM_OT_context_set_id() to use rna introspection.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c22
-rw-r--r--source/blender/blenloader/intern/writefile.c10
2 files changed, 10 insertions, 22 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9a81974349c..88ddca3328c 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4123,10 +4123,8 @@ static void composite_patch(bNodeTree *ntree, Scene *scene)
static void link_paint(FileData *fd, Scene *sce, Paint *p)
{
- if(p && p->brushes) {
- int i;
- for(i = 0; i < p->brush_count; ++i)
- p->brushes[i]= newlibadr_us(fd, sce->id.lib, p->brushes[i]);
+ if(p && p->brush) {
+ p->brush= newlibadr_us(fd, sce->id.lib, p->brush);
}
}
@@ -4242,13 +4240,8 @@ static void link_recurs_seq(FileData *fd, ListBase *lb)
static void direct_link_paint(FileData *fd, Paint **paint)
{
Paint *p;
-
+/* TODO. is this needed */
p= (*paint)= newdataadr(fd, (*paint));
- if(p) {
- p->paint_cursor= NULL;
- p->brushes= newdataadr(fd, p->brushes);
- test_pointer_array(fd, (void**)&p->brushes);
- }
}
static void direct_link_scene(FileData *fd, Scene *sce)
@@ -4284,9 +4277,6 @@ static void direct_link_scene(FileData *fd, Scene *sce)
direct_link_paint(fd, (Paint**)&sce->toolsettings->vpaint);
direct_link_paint(fd, (Paint**)&sce->toolsettings->wpaint);
- sce->toolsettings->imapaint.paint.brushes= newdataadr(fd, sce->toolsettings->imapaint.paint.brushes);
- test_pointer_array(fd, (void**)&sce->toolsettings->imapaint.paint.brushes);
-
sce->toolsettings->imapaint.paintcursor= NULL;
sce->toolsettings->particle.paintcursor= NULL;
}
@@ -11117,6 +11107,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* put compatibility code here until next subversion bump */
{
+ Brush *br;
+ for(br= main->brush.first; br; br= br->id.next) {
+ if(br->ob_mode==0)
+ br->ob_mode= (OB_MODE_SCULPT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT);
+ }
+
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index eab6a4c2b55..dbe869450a5 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1770,11 +1770,6 @@ 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)
{
@@ -1809,18 +1804,15 @@ static void write_scenes(WriteData *wd, ListBase *scebase)
writestruct(wd, DATA, "ToolSettings", 1, tos);
if(tos->vpaint) {
writestruct(wd, DATA, "VPaint", 1, tos->vpaint);
- write_paint(wd, &tos->vpaint->paint);
}
if(tos->wpaint) {
writestruct(wd, DATA, "VPaint", 1, tos->wpaint);
- write_paint(wd, &tos->wpaint->paint);
}
if(tos->sculpt) {
writestruct(wd, DATA, "Sculpt", 1, tos->sculpt);
- write_paint(wd, &tos->sculpt->paint);
}
- write_paint(wd, &tos->imapaint.paint);
+ // write_paint(wd, &tos->imapaint.paint);
ed= sce->ed;
if(ed) {