Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_290.c
| Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | if (scene != NULL) { | ||||
| gpf_dup->framenum = scene->r.sfra; | gpf_dup->framenum = scene->r.sfra; | ||||
| BLI_addhead(&gpl->frames, gpf_dup); | BLI_addhead(&gpl->frames, gpf_dup); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (!MAIN_VERSION_ATLEAST(bmain, 291, 1)) { | |||||
| LISTBASE_FOREACH (Collection *, collection, &bmain->collections) { | |||||
| if (BKE_collection_cycles_fix(bmain, collection)) { | |||||
| printf( | |||||
| "WARNING: Cycle detected in collection '%s', fixed as best as possible.\n" | |||||
| "You may have to reconstruct your View Layers...\n", | |||||
| collection->id.name); | |||||
| } | |||||
| } | |||||
| } | |||||
| /** | /** | ||||
| * 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_290 in this file. | * - #blo_do_versions_290 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 | ||||
| * | * | ||||
| * \note Keep this message at the bottom of the function. | * \note Keep this message at the bottom of the function. | ||||
| */ | */ | ||||
| { | { | ||||
| LISTBASE_FOREACH (Collection *, collection, &bmain->collections) { | |||||
| if (BKE_collection_cycles_fix(bmain, collection)) { | /* Keep this block, even when empty. */ | ||||
| printf( | |||||
| "WARNING: Cycle detected in collection '%s', fixed as best as possible.\n" | |||||
| "You may have to reconstruct your View Layers...\n", | |||||
| collection->id.name); | |||||
| } | } | ||||
| } | } | ||||
| /* Keep this block, even when empty. */ | |||||
| static void panels_remove_x_closed_flag_recursive(Panel *panel) | |||||
| { | |||||
| const bool was_closed_x = panel->flag & PNL_UNUSED_1; | |||||
| const bool was_closed_y = panel->flag & PNL_CLOSED; /* That value was the Y closed flag. */ | |||||
| SET_FLAG_FROM_TEST(panel->flag, was_closed_x || was_closed_y, PNL_CLOSED); | |||||
| /* Clear the old PNL_CLOSEDX flag. */ | |||||
| panel->flag &= ~PNL_UNUSED_1; | |||||
Severin: I prefer to keep using defines. There could be one `PNL_UNUSED_1` flag, and for the re-used bit… | |||||
| LISTBASE_FOREACH (Panel *, child_panel, &panel->children) { | |||||
| panels_remove_x_closed_flag_recursive(child_panel); | |||||
| } | } | ||||
| } | } | ||||
| void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) | void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) | ||||
| { | { | ||||
| UNUSED_VARS(fd); | UNUSED_VARS(fd); | ||||
| /** Repair files from duplicate brushes added to blend files, see: T76738. */ | /** Repair files from duplicate brushes added to blend files, see: T76738. */ | ||||
| ▲ Show 20 Lines • Show All 165 Lines • ▼ Show 20 Lines | for (Object *object = bmain->objects.first; object != NULL; object = object->id.next) { | ||||
| OceanModifierData *omd = (OceanModifierData *)md; | OceanModifierData *omd = (OceanModifierData *)md; | ||||
| omd->wave_alignment *= 0.1f; | omd->wave_alignment *= 0.1f; | ||||
| omd->sharpen_peak_jonswap *= 0.1f; | omd->sharpen_peak_jonswap *= 0.1f; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /** | if (!MAIN_VERSION_ATLEAST(bmain, 291, 1)) { | ||||
| * Versioning code until next subversion bump goes here. | |||||
| * | |||||
| * \note Be sure to check when bumping the version: | |||||
| * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend | |||||
| * - "versioning_userdef.c", #do_versions_theme | |||||
| * | |||||
| * \note Keep this message at the bottom of the function. | |||||
| */ | |||||
| { | |||||
| /* Keep this block, even when empty. */ | |||||
| /* Initialize additional parameter of the Nishita sky model and change altitude unit. */ | /* Initialize additional parameter of the Nishita sky model and change altitude unit. */ | ||||
| if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) { | if (!DNA_struct_elem_find(fd->filesdna, "NodeTexSky", "float", "sun_intensity")) { | ||||
| FOREACH_NODETREE_BEGIN (bmain, ntree, id) { | FOREACH_NODETREE_BEGIN (bmain, ntree, id) { | ||||
| if (ntree->type == NTREE_SHADER) { | if (ntree->type == NTREE_SHADER) { | ||||
| LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { | ||||
| if (node->type == SH_NODE_TEX_SKY && node->storage) { | if (node->type == SH_NODE_TEX_SKY && node->storage) { | ||||
| NodeTexSky *tex = (NodeTexSky *)node->storage; | NodeTexSky *tex = (NodeTexSky *)node->storage; | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (!DNA_struct_elem_find(fd->filesdna, "OceanModifierData", "int", "viewport_resolution")) { | ||||
| LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { | LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { | ||||
| if (md->type == eModifierType_Ocean) { | if (md->type == eModifierType_Ocean) { | ||||
| OceanModifierData *omd = (OceanModifierData *)md; | OceanModifierData *omd = (OceanModifierData *)md; | ||||
| omd->viewport_resolution = omd->resolution; | omd->viewport_resolution = omd->resolution; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Remove panel X axis collapsing, a remnant of horizontal panel alignment. */ | |||||
| LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { | |||||
| LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | |||||
| LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | |||||
| LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { | |||||
| panels_remove_x_closed_flag_recursive(panel); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| /** | |||||
| * Versioning code until next subversion bump goes here. | |||||
| * | |||||
| * \note Be sure to check when bumping the version: | |||||
| * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend | |||||
| * - "versioning_userdef.c", #do_versions_theme | |||||
| * | |||||
| * \note Keep this message at the bottom of the function. | |||||
| */ | |||||
| { | |||||
| /* Keep this block, even when empty. */ | |||||
| } | } | ||||
| } | } | ||||
I prefer to keep using defines. There could be one PNL_UNUSED_1 flag, and for the re-used bit you can just use PNL_CLOSED here too (maybe mentioning in a comment here that the bit used to mean something different).
We do the same in other places, e.g. IMA_HIGH_BITDEPTH.