[Bf-blender-cvs] [7c2557c] GPencil_Editing_Stage3: GP Sculpt: Version patching code to set sensible defaults for sculpt brushes
Joshua Leung
noreply at git.blender.org
Wed Jul 15 15:32:26 CEST 2015
Commit: 7c2557c3da9c2c7b47199b7f08c93c8a95ca6c20
Author: Joshua Leung
Date: Wed Jul 15 17:52:48 2015 +1200
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rB7c2557c3da9c2c7b47199b7f08c93c8a95ca6c20
GP Sculpt: Version patching code to set sensible defaults for sculpt brushes
===================================================================
M source/blender/blenloader/intern/versioning_270.c
M source/blender/blenloader/intern/versioning_defaults.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 6ab655e..7c7ab58 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -842,4 +842,51 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
+
+ {
+ Scene *scene;
+ for (scene = main->scene.first; scene; scene = scene->id.next) {
+ ToolSettings *ts = scene->toolsettings;
+
+ if (ts->gp_sculpt.brush[0].size == 0) {
+ GP_BrushEdit_Settings *gset = &ts->gp_sculpt;
+ GP_EditBrush_Data *brush;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_SMOOTH];
+ brush->size = 25;
+ brush->strength = 0.3f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF | GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_THICKNESS];
+ brush->size = 25;
+ brush->strength = 0.5f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_GRAB];
+ brush->size = 50;
+ brush->strength = 0.3f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_PUSH];
+ brush->size = 25;
+ brush->strength = 0.3f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_TWIST];
+ brush->size = 50;
+ brush->strength = 0.3f; // XXX?
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_PINCH];
+ brush->size = 50;
+ brush->strength = 0.5f; // XXX?
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_RANDOMISE];
+ brush->size = 25;
+ brush->strength = 0.5f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+ }
+ }
+ }
}
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 0e8e6e9..1555d63 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -91,6 +91,46 @@ void BLO_update_defaults_startup_blend(Main *bmain)
sculpt->flags |= SCULPT_DYNTOPO_COLLAPSE;
sculpt->detail_size = 12;
}
+
+ if (ts->gp_sculpt.brush[0].size == 0) {
+ GP_BrushEdit_Settings *gset = &ts->gp_sculpt;
+ GP_EditBrush_Data *brush;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_SMOOTH];
+ brush->size = 25;
+ brush->strength = 0.3f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF | GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_THICKNESS];
+ brush->size = 25;
+ brush->strength = 0.5f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_GRAB];
+ brush->size = 50;
+ brush->strength = 0.3f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_PUSH];
+ brush->size = 25;
+ brush->strength = 0.3f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_TWIST];
+ brush->size = 50;
+ brush->strength = 0.3f; // XXX?
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_PINCH];
+ brush->size = 50;
+ brush->strength = 0.5f; // XXX?
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_RANDOMISE];
+ brush->size = 25;
+ brush->strength = 0.5f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+ }
}
scene->gm.lodflag |= SCE_LOD_USE_HYST;
More information about the Bf-blender-cvs
mailing list