[Bf-blender-cvs] [84682e9] soc-2013-paint: Update factory defaults:

Antony Riakiotakis noreply at git.blender.org
Mon Jul 14 15:33:00 CEST 2014


Commit: 84682e9229625ba0df82cc8b065398e2ff649b64
Author: Antony Riakiotakis
Date:   Mon Jul 14 16:32:44 2014 +0300
https://developer.blender.org/rB84682e9229625ba0df82cc8b065398e2ff649b64

Update factory defaults:

* Add mask and fill brushes to texture painting.
* Sculpt mode now has mirroring turned on.
* Lower default dyntopo resolution.
* Fill threshold not zero by default.

===================================================================

M	source/blender/blenkernel/intern/brush.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/editors/interface/resources.c
M	source/blender/editors/sculpt_paint/sculpt.c

===================================================================

diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 4b4755a..cfdb1aa 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -83,6 +83,7 @@ static void brush_defaults(Brush *brush)
 	brush->plane_trim = 0.5f;
 	brush->clone.alpha = 0.5f;
 	brush->normal_weight = 0.0f;
+	brush->fill_threshold = 0.2f;
 	brush->flag |= BRUSH_ALPHA_PRESSURE;
 
 	/* BRUSH PAINT TOOL SETTINGS */
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index df6e6ef..46f1696 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -34,6 +34,7 @@
 /* allow readfile to use deprecated functionality */
 #define DNA_DEPRECATED_ALLOW
 
+#include "DNA_brush_types.h"
 #include "DNA_constraint_types.h"
 #include "DNA_sdna_types.h"
 #include "DNA_space_types.h"
@@ -319,9 +320,15 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 
 	if (!MAIN_VERSION_ATLEAST(main, 271, 2)) {
 		Scene *sce;
+		Brush *br;
+
 		for (sce = main->scene.first; sce; sce = sce->id.next) {
 			sce->toolsettings->imapaint.slot_xresolution_default = 1024;
 			sce->toolsettings->imapaint.slot_yresolution_default = 1024;
 		}
+
+		for (br = main->brush.first; br; br = br->id.next) {
+			br->fill_threshold = 0.2f;
+		}
 	}
 }
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 372ced0..dbb10ab 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -35,17 +35,20 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "DNA_brush_types.h"
 #include "DNA_curve_types.h"
-#include "DNA_userdef_types.h"
+#include "DNA_mesh_types.h"  /* init_userdef_factory */
+#include "DNA_object_types.h"
 #include "DNA_screen_types.h"
 #include "DNA_space_types.h"
+#include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
-#include "DNA_mesh_types.h"  /* init_userdef_factory */
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
 #include "BLI_math.h"
 
+#include "BKE_brush.h"
 #include "BKE_DerivedMesh.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
@@ -2470,4 +2473,36 @@ void init_userdef_factory(void)
 			me->flag &= ~ME_TWOSIDED;
 		}
 	}
+
+	{
+		Brush *br;
+		br = BKE_brush_add(G.main, "Fill");
+		br->imagepaint_tool = PAINT_TOOL_FILL;
+		br->ob_mode = OB_MODE_TEXTURE_PAINT;
+
+		for (br = G.main->brush.first; br; br = br->id.next) {
+			if (strcmp(br->id.name, "BRMask") == 0) {
+				br->imagepaint_tool = PAINT_TOOL_MASK;
+				br->ob_mode |= OB_MODE_TEXTURE_PAINT;
+				break;
+			}
+		}
+	}
+
+	{
+		Scene *scene;
+
+		for (scene = G.main->scene.first; scene; scene = scene->id.next) {
+			if (scene->toolsettings) {
+				ToolSettings *ts = scene->toolsettings;
+
+				if (ts->sculpt) {
+					Sculpt *sculpt = ts->sculpt;
+					sculpt->paint.symmetry_flags |= PAINT_SYMM_X;
+					sculpt->flags |= SCULPT_DYNTOPO_COLLAPSE;
+					sculpt->detail_size = 12;
+				}
+			}
+		}
+	}
 }
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 71f09b2..1706778 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5015,11 +5015,11 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
 			ts->sculpt->paint.flags |= PAINT_SHOW_BRUSH;
 
 			/* Make sure at least dyntopo subdivision is enabled */
-			ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE;
+			ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
 		}
 
 		if (!ts->sculpt->detail_size) {
-			ts->sculpt->detail_size = 30;
+			ts->sculpt->detail_size = 12;
 		}
 
 		if (ts->sculpt->constant_detail == 0.0f)




More information about the Bf-blender-cvs mailing list