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:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-14 18:11:03 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-14 18:11:03 +0400
commit5505697ac508c02b8a2e196c5a8c07431bc687cf (patch)
treea550a4718d586066017e3861d42104ef09e969bf /source/blender/blenloader
parentae1748b98470f08ed805e101b218f44c17d9b6b2 (diff)
Merge GSOC Sculpt Branch: 28499-30319
https://svn.blender.org/svnroot/bf-blender/branches/soc-2010-jwilkins See log of that branch for details.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f6122161130..7b29ab2a666 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1539,6 +1539,7 @@ static void lib_link_brush(FileData *fd, Main *main)
brush->id.flag -= LIB_NEEDLINK;
brush->mtex.tex= newlibadr_us(fd, brush->id.lib, brush->mtex.tex);
+ brush->image_icon= newlibadr_us(fd, brush->id.lib, brush->image_icon);
brush->clone.image= newlibadr_us(fd, brush->id.lib, brush->clone.image);
}
}
@@ -10971,6 +10972,82 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
+ {
+ /* GSOC 2010 Sculpt - New settings for Brush */
+
+ Brush *brush;
+ for (brush= main->brush.first; brush; brush= brush->id.next) {
+ /* Sanity Check */
+
+ // infinite number of dabs
+ if (brush->spacing == 0)
+ brush->spacing = 10;
+
+ // will have no effect
+ if (brush->alpha == 0)
+ brush->alpha = 0.5f;
+
+ // bad radius
+ if (brush->unprojected_radius == 0)
+ brush->unprojected_radius = 0.125;
+
+ // unusable size
+ if (brush->size == 0)
+ brush->size = 35;
+
+ // can't see overlay
+ if (brush->texture_overlay_alpha == 0)
+ brush->texture_overlay_alpha = 33;
+
+ // same as draw brush
+ if (brush->crease_pinch_factor == 0)
+ brush->crease_pinch_factor = 0.5f;
+
+ // will sculpt no vertexes
+ if (brush->plane_trim == 0)
+ brush->plane_trim = 0.5f;
+
+ // same as smooth stroke off
+ if (brush->smooth_stroke_radius == 0)
+ brush->smooth_stroke_radius= 75;
+
+ // will keep cursor in one spot
+ if (brush->smooth_stroke_radius == 1)
+ brush->smooth_stroke_factor= 0.9f;
+
+ // same as dots
+ if (brush->rate == 0)
+ brush->rate = 0.1f;
+
+ /* New Settings */
+ if (main->versionfile < 252 || (main->versionfile == 252 && main->subversionfile < 6)) {
+ brush->flag |= BRUSH_SPACE_ATTEN; // explicitly enable adaptive space
+
+ // spacing was originally in pixels, convert it to percentage for new version
+ // size should not be zero due to sanity check above
+ brush->spacing = (int)(100*((float)brush->spacing) / ((float)brush->size));
+
+ if (brush->add_col[0] == 0 &&
+ brush->add_col[1] == 0 &&
+ brush->add_col[2] == 0)
+ {
+ brush->add_col[0] = 1.00;
+ brush->add_col[1] = 0.39;
+ brush->add_col[2] = 0.39;
+ }
+
+ if (brush->sub_col[0] == 0 &&
+ brush->sub_col[1] == 0 &&
+ brush->sub_col[2] == 0)
+ {
+ brush->sub_col[0] = 0.39;
+ brush->sub_col[1] = 0.39;
+ brush->sub_col[2] = 1.00;
+ }
+ }
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */