Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.cc
| Show First 20 Lines • Show All 345 Lines • ▼ Show 20 Lines | static void blo_update_defaults_scene(Main *bmain, Scene *scene) | ||||
| } | } | ||||
| if (ts->sculpt) { | if (ts->sculpt) { | ||||
| ts->sculpt->paint.symmetry_flags |= PAINT_SYMMETRY_FEATHER; | ts->sculpt->paint.symmetry_flags |= PAINT_SYMMETRY_FEATHER; | ||||
| } | } | ||||
| /* Correct default startup UV's. */ | /* Correct default startup UV's. */ | ||||
| Mesh *me = static_cast<Mesh *>(BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2)); | Mesh *me = static_cast<Mesh *>(BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2)); | ||||
| if (me && (me->totloop == 24) && CustomData_has_layer(&me->ldata, CD_MLOOPUV)) { | if (me && (me->totloop == 24) && CustomData_has_layer(&me->ldata, CD_PROP_FLOAT2)) { | ||||
| MLoopUV *mloopuv = static_cast<MLoopUV *>(CustomData_get_layer(&me->ldata, CD_MLOOPUV)); | |||||
| 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}, | ||||
| }; | }; | ||||
| for (int i = 0; i < ARRAY_SIZE(uv_values); i++) { | float(*mloopuv)[2] = static_cast<float(*)[2]>( | ||||
| copy_v2_v2(mloopuv[i].uv, uv_values[i]); | CustomData_get_layer(&me->ldata, CD_PROP_FLOAT2)); | ||||
| } | memcpy(mloopuv, uv_values, sizeof(float[2]) * me->totloop); | ||||
| } | } | ||||
| /* Make sure that the curve profile is initialized */ | /* Make sure that the curve profile is initialized */ | ||||
| if (ts->custom_bevel_profile_preset == nullptr) { | if (ts->custom_bevel_profile_preset == nullptr) { | ||||
| ts->custom_bevel_profile_preset = BKE_curveprofile_add(PROF_PRESET_LINE); | ts->custom_bevel_profile_preset = BKE_curveprofile_add(PROF_PRESET_LINE); | ||||
| } | } | ||||
| /* Clear ID properties so Cycles gets defaults. */ | /* Clear ID properties so Cycles gets defaults. */ | ||||
| ▲ Show 20 Lines • Show All 419 Lines • Show Last 20 Lines | |||||