[Bf-blender-cvs] [1b20b60] PSketch: Merge branch 'master' into PSketch
Joshua Leung
noreply at git.blender.org
Sun Jan 31 14:28:48 CET 2016
Commit: 1b20b600c5b21c70d515f4f87ffd9607a04f8398
Author: Joshua Leung
Date: Tue Jan 12 14:00:04 2016 +1300
Branches: PSketch
https://developer.blender.org/rB1b20b600c5b21c70d515f4f87ffd9607a04f8398
Merge branch 'master' into PSketch
Conflicts:
source/blender/blenloader/intern/versioning_270.c
source/blender/makesrna/intern/rna_sculpt_paint.c
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/scene.c
index e3fac21,ca0896e..6f63675
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@@ -651,19 -650,8 +651,19 @@@ void BKE_scene_init(Scene *sce
pset->brush[a].count = 10;
}
pset->brush[PE_BRUSH_CUT].strength = 100;
+
+ psculpt = &sce->toolsettings->psculpt;
+ for (a = 0; a < PSCULPT_TOT_BRUSH; a++) {
+ psculpt->brush[a].strength = 0.5f;
+ psculpt->brush[a].size = 50;
+ psculpt->brush[a].rate = 0.1f;
+ }
+ psculpt->brush[PSCULPT_BRUSH_CURL].strength = 0.25f;
+ psculpt->brush[PSCULPT_BRUSH_TWIST].strength = 0.25f;
+ psculpt->brush[PSCULPT_BRUSH_CURL].xzMode = PSCULPT_BRUSH_DO_X;
+ psculpt->brush[PSCULPT_BRUSH_GRAB].flag |= PSCULPT_BRUSH_FLAG_GRAB_INITIAL;
- sce->r.ffcodecdata.audio_mixrate = 44100;
+ sce->r.ffcodecdata.audio_mixrate = 48000;
sce->r.ffcodecdata.audio_volume = 1.0f;
sce->r.ffcodecdata.audio_bitrate = 192;
sce->r.ffcodecdata.audio_channels = 2;
diff --cc source/blender/blenloader/intern/versioning_270.c
index b294c06,b975a39..f29c1e5
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@@ -935,31 -937,117 +937,146 @@@ void blo_do_versions_270(FileData *fd,
}
}
+ if (!MAIN_VERSION_ATLEAST(main, 276, 4)) {
+ for (Scene *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_RANDOMIZE];
+ brush->size = 25;
+ brush->strength = 0.5f;
+ brush->flag = GP_EDITBRUSH_FLAG_USE_FALLOFF;
+
+ brush = &gset->brush[GP_EDITBRUSH_TYPE_CLONE];
+ brush->size = 50;
+ brush->strength = 1.0f;
+ }
+
+ if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "gpencil_v3d_align")) {
+ #if 0 /* XXX: Cannot do this, as we get random crashes... */
+ if (scene->gpd) {
+ bGPdata *gpd = scene->gpd;
+
+ /* Copy over the settings stored in the GP datablock linked to the scene, for minimal disruption */
+ ts->gpencil_v3d_align = 0;
+
+ if (gpd->flag & GP_DATA_VIEWALIGN) ts->gpencil_v3d_align |= GP_PROJECT_VIEWSPACE;
+ if (gpd->flag & GP_DATA_DEPTH_VIEW) ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_VIEW;
+ if (gpd->flag & GP_DATA_DEPTH_STROKE) ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE;
+
+ if (gpd->flag & GP_DATA_DEPTH_STROKE_ENDPOINTS)
+ ts->gpencil_v3d_align |= GP_PROJECT_DEPTH_STROKE_ENDPOINTS;
+ }
+ else {
+ /* Default to cursor for all standard 3D views */
+ ts->gpencil_v3d_align = GP_PROJECT_VIEWSPACE;
+ }
+ #endif
+
+ ts->gpencil_v3d_align = GP_PROJECT_VIEWSPACE;
+ ts->gpencil_v2d_align = GP_PROJECT_VIEWSPACE;
+ ts->gpencil_seq_align = GP_PROJECT_VIEWSPACE;
+ ts->gpencil_ima_align = GP_PROJECT_VIEWSPACE;
+ }
+ }
+
+ for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) {
+ bool enabled = false;
+
+ /* Ensure that the datablock's onionskinning toggle flag
+ * stays in sync with the status of the actual layers
+ */
+ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ if (gpl->flag & GP_LAYER_ONIONSKIN) {
+ enabled = true;
+ }
+ }
+
+ if (enabled)
+ gpd->flag |= GP_DATA_SHOW_ONIONSKINS;
+ else
+ gpd->flag &= ~GP_DATA_SHOW_ONIONSKINS;
+ }
+
+ if (!DNA_struct_elem_find(fd->filesdna, "Object", "unsigned char", "max_jumps")) {
+ for (Object *ob = main->object.first; ob; ob = ob->id.next) {
+ ob->max_jumps = 1;
+ }
+ }
+ }
+ if (!MAIN_VERSION_ATLEAST(main, 276, 5)) {
+ ListBase *lbarray[MAX_LIBARRAY];
+ int a;
+
+ /* Important to clear all non-persistent flags from older versions here, otherwise they could collide
+ * with any new persistent flag we may add in the future. */
+ a = set_listbasepointers(main, lbarray);
+ while (a--) {
+ for (ID *id = lbarray[a]->first; id; id = id->next) {
+ id->flag &= LIB_FAKEUSER;
+ }
+ }
+ }
++
++
+ /* Pose Sculpt... */
+ if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "PSculptSettings", "psculpt")) {
+ Scene *scene;
+
+ /* init defaults for pose sculpt settings
+ * ! Keep in sync with blenkernel/scene.c - BKE_scene_init()
+ * and blenloader/versioning_defaults.c
+ */
+ for (scene = main->scene.first; scene; scene = scene->id.next) {
+ PSculptSettings *pset = &scene->toolsettings->psculpt;
+
+ //if (pset->brush[0].size == 0)
+ {
+ int i;
+
+ for (i = 0; i < PSCULPT_TOT_BRUSH; i++) {
+ pset->brush[i].strength = 0.5f;
+ pset->brush[i].size = 50;
+ pset->brush[i].rate = 0.1f;
+ }
+ pset->brush[PSCULPT_BRUSH_CURL].strength = 0.25f;
+ pset->brush[PSCULPT_BRUSH_TWIST].strength = 0.25f;
+ pset->brush[PSCULPT_BRUSH_CURL].xzMode = PSCULPT_BRUSH_DO_X;
+ pset->brush[PSCULPT_BRUSH_GRAB].flag |= PSCULPT_BRUSH_FLAG_GRAB_INITIAL;
+ }
+ }
+ }
}
diff --cc source/blender/blenloader/intern/versioning_defaults.c
index ab37fdf,e57a215..87f164f
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@@ -179,35 -229,12 +229,41 @@@ void BLO_update_defaults_startup_blend(
if (br) {
br->ob_mode &= ~OB_MODE_TEXTURE_PAINT;
}
+
+ /* rename twist brush to rotate brush to match rotate tool */
+ br = (Brush *)BKE_libblock_find_name_ex(bmain, ID_BR, "Twist");
+ if (br) {
+ BKE_libblock_rename(bmain, &br->id, "Rotate");
+ }
}
+
+
+ /* Pose Sculpt... */
+ {
+ Scene *scene;
+
+ /* init defaults for pose sculpt settings
+ * ! Keep in sync with blenkernel/scene.c - BKE_scene_init()
+ */
+ for (scene = bmain->scene.first; scene; scene = scene->id.next) {
+ PSculptSettings *pset = &scene->toolsettings->psculpt;
+
+ //if (pset->brush[0].size == 0)
+ {
+ int i;
+
+ for (i = 0; i < PSCULPT_TOT_BRUSH; i++) {
+ pset->brush[i].strength = 0.5f;
+ pset->brush[i].size = 50;
+ pset->brush[i].rate = 0.1f;
+ }
+ pset->brush[PSCULPT_BRUSH_CURL].strength = 0.25f;
+ pset->brush[PSCULPT_BRUSH_TWIST].strength = 0.25f;
+ pset->brush[PSCULPT_BRUSH_CURL].xzMode = PSCULPT_BRUSH_DO_X;
+ pset->brush[PSCULPT_BRUSH_GRAB].flag |= PSCULPT_BRUSH_FLAG_GRAB_INITIAL;
+ }
+ }
+ }
+
}
diff --cc source/blender/makesrna/intern/rna_sculpt_paint.c
index 40d9821,77bb4e9..25960a3
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@@ -974,112 -983,72 +1012,178 @@@ static void rna_def_particle_edit(Blend
RNA_def_property_ui_text(prop, "Curve", "");
}
+ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
+ {
+ static EnumPropertyItem prop_direction_items[] = {
+ {0, "ADD", 0, "Add", "Add effect of brush"},
+ {GP_EDITBRUSH_FLAG_INVERT, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"},
+ {0, NULL, 0, NULL, NULL}};
+
+ StructRNA *srna;
+ PropertyRNA *prop;
+
++
+ /* == Settings == */
+ srna = RNA_def_struct(brna, "GPencilSculptSettings", NULL);
+ RNA_def_struct_sdna(srna, "GP_BrushEdit_Settings");
+ RNA_def_struct_path_func(srna, "rna_GPencilSculptSettings_path");
+ RNA_def_struct_ui_text(srna, "GPencil Sculpt Settings", "Properties for Grease Pencil stroke sculpting tool");
+
+ prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "brushtype");
+ RNA_def_property_enum_items(prop, rna_enum_gpencil_sculpt_brush_items);
+ RNA_def_property_ui_text(prop, "Tool", "");
+
+ prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "GPencilSculptBrush");
+ RNA_def_property_pointer_funcs(prop, "rna_GPencilSculptSettings_brush_get", NULL, NULL, NULL);
+ RNA_def_property_ui_text(prop, "Brush", "");
+
+ prop = RNA_def_property(srna, "use_select_mask", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSHEDIT_FLAG_SELECT_MASK);
+ RNA_def_property_ui_text(prop, "Selection Mask", "Only sculpt selected stroke points");
+ RNA_def_property_ui_icon(prop, ICON_VERTEXSEL, 0); // FIXME: this needs a custom icon
+
+
+ /* brush */
+ srna = RNA_def_struct(brna, "GPencilSculptBrush", NULL);
+ RNA_def_struct_sdna(srna, "GP_EditBrush_Data");
+ RNA_def_struct_path_func(srna, "rna_GPencilSculptBrush_path");
+ RNA_def_struct_ui_text(srna, "GPencil Sculpt Brush", "Stroke editing brush");
+
+ prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL);
+ RNA_def_property_range(prop, 1, MAX_BRUSH_PIXEL_RADIUS);
+ RNA_def_property_ui_range(prop, 1, 100, 10, 3); // XXX: too big
+ RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels");
+
+ prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_range(prop, 0.001, 1.0);
+ RNA_def_property_ui_text(prop, "Strength", "Brush strength");
+
+ prop = R
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list