Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.c
| Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | if (ts->gp_sculpt.cur_primitive == NULL) { | ||||
| CurveMapping *gp_primitive_curve = ts->gp_sculpt.cur_primitive; | CurveMapping *gp_primitive_curve = ts->gp_sculpt.cur_primitive; | ||||
| BKE_curvemapping_initialize(gp_primitive_curve); | BKE_curvemapping_initialize(gp_primitive_curve); | ||||
| BKE_curvemap_reset(gp_primitive_curve->cm, | BKE_curvemap_reset(gp_primitive_curve->cm, | ||||
| &gp_primitive_curve->clipr, | &gp_primitive_curve->clipr, | ||||
| CURVE_PRESET_BELL, | CURVE_PRESET_BELL, | ||||
| CURVEMAP_SLOPE_POSITIVE); | CURVEMAP_SLOPE_POSITIVE); | ||||
| } | } | ||||
| if (ts->sculpt) { | |||||
| ts->sculpt->paint.symmetry_flags |= PAINT_SYMMETRY_FEATHER; | |||||
| } | |||||
| /* Correct default startup UV's. */ | /* Correct default startup UV's. */ | ||||
| Mesh *me = BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2); | Mesh *me = BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2); | ||||
| if (me && (me->totloop == 24) && (me->mloopuv != NULL)) { | if (me && (me->totloop == 24) && (me->mloopuv != NULL)) { | ||||
| const float uv_values[24][2] = { | const float uv_values[24][2] = { | ||||
| {0.625, 0.50}, {0.875, 0.50}, {0.875, 0.75}, {0.625, 0.75}, {0.375, 0.75}, {0.625, 0.75}, | {0.625, 0.50}, {0.875, 0.50}, {0.875, 0.75}, {0.625, 0.75}, {0.375, 0.75}, {0.625, 0.75}, | ||||
| {0.625, 1.00}, {0.375, 1.00}, {0.375, 0.00}, {0.625, 0.00}, {0.625, 0.25}, {0.375, 0.25}, | {0.625, 1.00}, {0.375, 1.00}, {0.375, 0.00}, {0.625, 0.00}, {0.625, 0.25}, {0.375, 0.25}, | ||||
| {0.125, 0.50}, {0.375, 0.50}, {0.375, 0.75}, {0.125, 0.75}, {0.375, 0.50}, {0.625, 0.50}, | {0.125, 0.50}, {0.375, 0.50}, {0.375, 0.75}, {0.125, 0.75}, {0.375, 0.50}, {0.625, 0.50}, | ||||
| {0.625, 0.75}, {0.375, 0.75}, {0.375, 0.25}, {0.625, 0.25}, {0.625, 0.50}, {0.375, 0.50}, | {0.625, 0.75}, {0.375, 0.75}, {0.375, 0.25}, {0.625, 0.25}, {0.625, 0.50}, {0.375, 0.50}, | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | /* Brushes */ | ||||
| Brush *brush = BLI_findstring(&bmain->brushes, "Grab", offsetof(ID, name) + 2); | Brush *brush = BLI_findstring(&bmain->brushes, "Grab", offsetof(ID, name) + 2); | ||||
| if (brush) { | if (brush) { | ||||
| brush->ob_mode |= OB_MODE_EDIT; | brush->ob_mode |= OB_MODE_EDIT; | ||||
| } | } | ||||
| } | } | ||||
| for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { | for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { | ||||
| brush->blur_kernel_radius = 2; | brush->blur_kernel_radius = 2; | ||||
| brush->curve_preset = BRUSH_CURVE_SMOOTH; | |||||
| } | } | ||||
| { | { | ||||
| /* Change the spacing of the Smear brush to 3.0% */ | /* Change the spacing of the Smear brush to 3.0% */ | ||||
| Brush *brush = BLI_findstring(&bmain->brushes, "Smear", offsetof(ID, name) + 2); | Brush *brush = BLI_findstring(&bmain->brushes, "Smear", offsetof(ID, name) + 2); | ||||
| if (brush) { | if (brush) { | ||||
| brush->spacing = 3.0; | brush->spacing = 3.0; | ||||
| } | } | ||||
| brush = BLI_findstring(&bmain->brushes, "Grab", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| brush->alpha = 0.4f; | |||||
| } | |||||
| brush = BLI_findstring(&bmain->brushes, "Scrape/Peaks", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| brush->alpha = 1.0f; | |||||
| brush->spacing = 7; | |||||
| } | |||||
| brush = BLI_findstring(&bmain->brushes, "Draw Sharp", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| brush->curve_preset = BRUSH_CURVE_POW4; | |||||
| brush->spacing = 5; | |||||
| } | |||||
| brush = BLI_findstring(&bmain->brushes, "Elastic Deform", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| brush->elastic_deform_volume_preservation = 0.4f; | |||||
| brush->elastic_deform_type = BRUSH_ELASTIC_DEFORM_GRAB_TRISCALE; | |||||
| } | |||||
| brush = BLI_findstring(&bmain->brushes, "Pose", offsetof(ID, name) + 2); | |||||
| if (brush) { | |||||
| brush->flag = 0; | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
brecht: Is it possible to only add brushes here, and then initialize all the other defaults by doing… | |||||
Is it possible to only add brushes here, and then initialize all the other defaults by doing this, and extending BKE_brush_sculpt_reset as needed?
for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if (brush->sculpt_tool) { BKE_brush_sculpt_reset(brush); } }