Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.c
| Show All 35 Lines | |||||
| #include "DNA_userdef_types.h" | #include "DNA_userdef_types.h" | ||||
| #include "DNA_windowmanager_types.h" | #include "DNA_windowmanager_types.h" | ||||
| #include "DNA_workspace_types.h" | #include "DNA_workspace_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_light_types.h" | #include "DNA_light_types.h" | ||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_brush.h" | |||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| ▲ Show 20 Lines • Show All 228 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 122 Lines • ▼ Show 20 Lines | void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) | ||||
| } | } | ||||
| { | { | ||||
| /* 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, "Draw Sharp", offsetof(ID, name) + 2); | |||||
| if (!brush) { | |||||
| brush = BKE_brush_add(bmain, "Draw Sharp", OB_MODE_SCULPT); | |||||
| id_us_min(&brush->id); | |||||
| brush->sculpt_tool = SCULPT_TOOL_DRAW_SHARP; | |||||
| } | |||||
| brush = BLI_findstring(&bmain->brushes, "Elastic Deform", offsetof(ID, name) + 2); | |||||
| if (!brush) { | |||||
| brush = BKE_brush_add(bmain, "Elastic Defrom", OB_MODE_SCULPT); | |||||
| id_us_min(&brush->id); | |||||
| brush->sculpt_tool = SCULPT_TOOL_ELASTIC_DEFORM; | |||||
| } | |||||
| brush = BLI_findstring(&bmain->brushes, "Pose", offsetof(ID, name) + 2); | |||||
| if (!brush) { | |||||
| brush = BKE_brush_add(bmain, "Pose", OB_MODE_SCULPT); | |||||
| id_us_min(&brush->id); | |||||
| brush->sculpt_tool = SCULPT_TOOL_POSE; | |||||
| } | |||||
| /* Use the same tool icon color in the brush cursor */ | |||||
| for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { | |||||
| if (brush->sculpt_tool) { | |||||
| BKE_brush_sculpt_reset(brush); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
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); } }