Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_300.c
| Show First 20 Lines • Show All 587 Lines • ▼ Show 20 Lines | static bNodeTree *add_realize_node_tree(Main *bmain) | ||||
| LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) { | LISTBASE_FOREACH (bNode *, node, &node_tree->nodes) { | ||||
| nodeSetSelected(node, false); | nodeSetSelected(node, false); | ||||
| } | } | ||||
| version_socket_update_is_used(node_tree); | version_socket_update_is_used(node_tree); | ||||
| return node_tree; | return node_tree; | ||||
| } | } | ||||
| void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports)) | void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports)) | ||||
| { | { | ||||
| if (MAIN_VERSION_ATLEAST(bmain, 300, 0) && !MAIN_VERSION_ATLEAST(bmain, 300, 1)) { | if (MAIN_VERSION_ATLEAST(bmain, 300, 0) && !MAIN_VERSION_ATLEAST(bmain, 300, 1)) { | ||||
| /* Set zero user text objects to have a fake user. */ | /* Set zero user text objects to have a fake user. */ | ||||
| LISTBASE_FOREACH (Text *, text, &bmain->texts) { | LISTBASE_FOREACH (Text *, text, &bmain->texts) { | ||||
| if (text->id.us == 0) { | if (text->id.us == 0) { | ||||
| id_fake_user_set(&text->id); | id_fake_user_set(&text->id); | ||||
| } | } | ||||
| } | } | ||||
campbellbarton: Since this is generally useful, I'd rather this be moved into a BKE utility function. e.g. | |||||
| } | } | ||||
| if (!MAIN_VERSION_ATLEAST(bmain, 300, 3)) { | if (!MAIN_VERSION_ATLEAST(bmain, 300, 3)) { | ||||
| sort_linked_ids(bmain); | sort_linked_ids(bmain); | ||||
| assert_sorted_ids(bmain); | assert_sorted_ids(bmain); | ||||
| } | } | ||||
| if (MAIN_VERSION_ATLEAST(bmain, 300, 3)) { | if (MAIN_VERSION_ATLEAST(bmain, 300, 3)) { | ||||
| ▲ Show 20 Lines • Show All 2,226 Lines • ▼ Show 20 Lines | for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | ||||
| if (ELEM(((SpaceSeq *)sl)->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW)) { | if (ELEM(((SpaceSeq *)sl)->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : | ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : | ||||
| &sl->regionbase; | &sl->regionbase; | ||||
| ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS); | ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS); | ||||
| if (!region) { | if (!region) { | ||||
| ARegion *tools_region = BKE_area_find_region_type(area, RGN_TYPE_TOOLS); | /* Find sequencer tools region. */ | ||||
| ARegion *tools_region; | |||||
| LISTBASE_FOREACH (ARegion *, region_iter, regionbase) { | |||||
| if (region_iter->regiontype == RGN_TYPE_TOOLS) { | |||||
| tools_region = region_iter; | |||||
| } | |||||
| } | |||||
| region = do_versions_add_region(RGN_TYPE_CHANNELS, "channels region"); | region = do_versions_add_region(RGN_TYPE_CHANNELS, "channels region"); | ||||
| BLI_insertlinkafter(regionbase, tools_region, region); | BLI_insertlinkafter(regionbase, tools_region, region); | ||||
| region->alignment = RGN_ALIGN_LEFT; | region->alignment = RGN_ALIGN_LEFT; | ||||
| region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL; | region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL; | ||||
| } | } | ||||
| ARegion *timeline_region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); | ARegion *timeline_region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); | ||||
| if (timeline_region != NULL) { | if (timeline_region != NULL) { | ||||
| ▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines | |||||
Since this is generally useful, I'd rather this be moved into a BKE utility function. e.g. BKE_region_find_in_listbase_by_type(...) the functions doc-string can note that this is useful for versioning where either the Area or SpaceLink's regionbase are typical inputs.