diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-07 07:38:30 +0300 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2009-01-07 07:38:30 +0300 |
commit | a811d802dd96a2dc93885a1dab46004084386030 (patch) | |
tree | 42e09725613129f591b0b97f4d06d931bfd89ab6 /source/blender/blenloader | |
parent | 23e3fdb28b1d0c7d7d8992c2835bd492daef528c (diff) |
Changes/cleanup for sculptdata and brushes. Summary:
* Removed texfade, wasn't a very useful option (same result can be created with the falloff curve)
* Removed CurveMapping from sculptdata, moved instead to Brush
* Removed rake field from sculptdata, moved to Brush.flag
* Moved Anchored flag from sculpt to Brush, same for direction field
* Removed BrushData, replaced usages with the regular Brush type
* Removed hardcoded brushes and brush_type from sculptdata, replaced with a pointer to the current Brush
* Made sculpt tool type settable in Brush
* Changed symmetry and axis lock fields to flags
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 43 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 5 |
2 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 24dc69c50bf..042516e518e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1456,6 +1456,22 @@ void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd) { } +/* ************ READ CurveMapping *************** */ + +/* cuma itself has been read! */ +static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap) +{ + int a; + + /* flag seems to be able to hang? Maybe old files... not bad to clear anyway */ + cumap->flag &= ~CUMA_PREMULLED; + + for(a=0; a<CM_TOT; a++) { + cumap->cm[a].curve= newdataadr(fd, cumap->cm[a].curve); + cumap->cm[a].table= NULL; + } +} + /* ************ READ Brush *************** */ /* library brush linking after fileread */ static void lib_link_brush(FileData *fd, Main *main) @@ -1485,6 +1501,11 @@ static void direct_link_brush(FileData *fd, Brush *brush) for(a=0; a<MAX_MTEX; a++) brush->mtex[a]= newdataadr(fd, brush->mtex[a]); + + /* fallof curve */ + brush->curve= newdataadr(fd, brush->curve); + if(brush->curve) + direct_link_curvemapping(fd, brush->curve); } static void direct_link_script(FileData *fd, Script *script) @@ -1493,22 +1514,6 @@ static void direct_link_script(FileData *fd, Script *script) SCRIPT_SET_NULL(script) } -/* ************ READ CurveMapping *************** */ - -/* cuma itself has been read! */ -static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap) -{ - int a; - - /* flag seems to be able to hang? Maybe old files... not bad to clear anyway */ - cumap->flag &= ~CUMA_PREMULLED; - - for(a=0; a<CM_TOT; a++) { - cumap->cm[a].curve= newdataadr(fd, cumap->cm[a].curve); - cumap->cm[a].table= NULL; - } -} - /* ************ READ NODE TREE *************** */ /* singe node tree (also used for material/scene trees), ntree is not NULL */ @@ -3604,12 +3609,6 @@ static void direct_link_scene(FileData *fd, Scene *sce) /* SculptData textures */ for(a=0; a<MAX_MTEX; ++a) sce->sculptdata.mtex[a]= newdataadr(fd,sce->sculptdata.mtex[a]); - /* Sculpt intensity curve */ - sce->sculptdata.cumap= newdataadr(fd, sce->sculptdata.cumap); - if(sce->sculptdata.cumap) - direct_link_curvemapping(fd, sce->sculptdata.cumap); - else - sculpt_reset_curve(&sce->sculptdata); if(sce->ed) { ListBase *old_seqbasep= &((Editing *)sce->ed)->seqbase; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 1d17b471b0e..57dde906fa3 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1475,8 +1475,6 @@ static void write_scenes(WriteData *wd, ListBase *scebase) for(a=0; a<MAX_MTEX; ++a) writestruct(wd, DATA, "MTex", 1, sce->sculptdata.mtex[a]); - if(sce->sculptdata.cumap) - write_curvemapping(wd, sce->sculptdata.cumap); ed= sce->ed; if(ed) { @@ -2011,6 +2009,9 @@ static void write_brushes(WriteData *wd, ListBase *idbase) for(a=0; a<MAX_MTEX; a++) if(brush->mtex[a]) writestruct(wd, DATA, "MTex", 1, brush->mtex[a]); + + if(brush->curve) + write_curvemapping(wd, brush->curve); } } } |