Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_280.c
| Show First 20 Lines • Show All 1,744 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { | ||||
| /* Ensure new Paint modes. */ | /* Ensure new Paint modes. */ | ||||
| BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_VERTEX_GPENCIL); | BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_VERTEX_GPENCIL); | ||||
| BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_SCULPT_GPENCIL); | BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_SCULPT_GPENCIL); | ||||
| BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_WEIGHT_GPENCIL); | BKE_paint_ensure_from_paintmode(scene, PAINT_MODE_WEIGHT_GPENCIL); | ||||
| } | } | ||||
| } | } | ||||
| if (!MAIN_VERSION_ATLEAST(bmain, 290, 0)) { | |||||
| /* Patch old grease pencil modifiers material filter. */ | |||||
| LISTBASE_FOREACH (Object *, ob, &bmain->objects) { | |||||
| LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) { | |||||
| switch (md->type) { | |||||
| case eGpencilModifierType_Array: { | |||||
| ArrayGpencilModifierData *gpmd = (ArrayGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Color: { | |||||
| ColorGpencilModifierData *gpmd = (ColorGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Hook: { | |||||
| HookGpencilModifierData *gpmd = (HookGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Lattice: { | |||||
| LatticeGpencilModifierData *gpmd = (LatticeGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Mirror: { | |||||
| MirrorGpencilModifierData *gpmd = (MirrorGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Multiply: { | |||||
| MultiplyGpencilModifierData *gpmd = (MultiplyGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Noise: { | |||||
| NoiseGpencilModifierData *gpmd = (NoiseGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Offset: { | |||||
| OffsetGpencilModifierData *gpmd = (OffsetGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Opacity: { | |||||
| OpacityGpencilModifierData *gpmd = (OpacityGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Simplify: { | |||||
| SimplifyGpencilModifierData *gpmd = (SimplifyGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Smooth: { | |||||
| SmoothGpencilModifierData *gpmd = (SmoothGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Subdiv: { | |||||
| SubdivGpencilModifierData *gpmd = (SubdivGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Texture: { | |||||
| TextureGpencilModifierData *gpmd = (TextureGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| case eGpencilModifierType_Thick: { | |||||
| ThickGpencilModifierData *gpmd = (ThickGpencilModifierData *)md; | |||||
| if (gpmd->materialname[0] != '\0') { | |||||
| gpmd->material = BLI_findstring( | |||||
| &bmain->materials, gpmd->materialname, offsetof(ID, name) + 2); | |||||
| gpmd->materialname[0] = '\0'; | |||||
| } | |||||
| break; | |||||
| } | |||||
| default: | |||||
| break; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| /** | /** | ||||
| * Versioning code until next subversion bump goes here. | * Versioning code until next subversion bump goes here. | ||||
| * | * | ||||
| * \note Be sure to check when bumping the version: | * \note Be sure to check when bumping the version: | ||||
| * - #blo_do_versions_280 in this file. | * - #blo_do_versions_280 in this file. | ||||
| * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend | * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend | ||||
| * - "versioning_userdef.c", #do_versions_theme | * - "versioning_userdef.c", #do_versions_theme | ||||
| * | * | ||||
| ▲ Show 20 Lines • Show All 3,316 Lines • Show Last 20 Lines | |||||