Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_280.c
| Show First 20 Lines • Show All 351 Lines • ▼ Show 20 Lines | for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { | ||||
| view_layer->pass_xor = srl->pass_xor; | view_layer->pass_xor = srl->pass_xor; | ||||
| view_layer->pass_alpha_threshold = srl->pass_alpha_threshold; | view_layer->pass_alpha_threshold = srl->pass_alpha_threshold; | ||||
| BKE_freestyle_config_free(&view_layer->freestyle_config, true); | BKE_freestyle_config_free(&view_layer->freestyle_config, true); | ||||
| view_layer->freestyle_config = srl->freestyleConfig; | view_layer->freestyle_config = srl->freestyleConfig; | ||||
| view_layer->id_properties = srl->prop; | view_layer->id_properties = srl->prop; | ||||
| /* unlink master collection */ | /* unlink master collection */ | ||||
| BKE_collection_unlink(view_layer, view_layer->layer_collections.first); | BKE_collection_unlink(view_layer, view_layer->layer_collections.first, main); | ||||
| /* Add new collection bases. */ | /* Add new collection bases. */ | ||||
| for (int layer = 0; layer < 20; layer++) { | for (int layer = 0; layer < 20; layer++) { | ||||
| if ((scene->lay & srl->lay & ~(srl->lay_exclude) & (1 << layer)) || | if ((scene->lay & srl->lay & ~(srl->lay_exclude) & (1 << layer)) || | ||||
| (srl->lay_zmask & (scene->lay | srl->lay_exclude) & (1 << layer))) | (srl->lay_zmask & (scene->lay | srl->lay_exclude) & (1 << layer))) | ||||
| { | { | ||||
| if (collections[DO_VERSION_COLLECTION_VISIBLE].created & (1 << layer)) { | if (collections[DO_VERSION_COLLECTION_VISIBLE].created & (1 << layer)) { | ||||
| ▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | |||||
| // BLI_assert(workspace->view_layer == NULL); | // BLI_assert(workspace->view_layer == NULL); | ||||
| } | } | ||||
| } | } | ||||
| { | { | ||||
| /* Since we don't have access to FileData we check the (always valid) master collection of the group. */ | /* Since we don't have access to FileData we check the (always valid) master collection of the group. */ | ||||
| for (Group *group = main->group.first; group; group = group->id.next) { | for (Group *group = main->group.first; group; group = group->id.next) { | ||||
| if (group->collection == NULL) { | if (group->collection == NULL) { | ||||
| BKE_group_init(group); | BKE_group_init(group, main); | ||||
| SceneCollection *sc = GROUP_MASTER_COLLECTION(group); | SceneCollection *sc = GROUP_MASTER_COLLECTION(group); | ||||
| SceneCollection *sc_hidden = NULL; | SceneCollection *sc_hidden = NULL; | ||||
| for (GroupObject *go = group->gobject.first; go; go = go->next) { | for (GroupObject *go = group->gobject.first; go; go = go->next) { | ||||
| if (go->ob->lay & group->layer) { | if (go->ob->lay & group->layer) { | ||||
| BKE_collection_object_add(&group->id, sc, go->ob); | BKE_collection_object_add(&group->id, sc, go->ob); | ||||
| } | } | ||||
| else { | else { | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | #endif | ||||
| else if (object->transflag & OB_DUPLI){ | else if (object->transflag & OB_DUPLI){ | ||||
| object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT; | object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT; | ||||
| } | } | ||||
| else { | else { | ||||
| object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT | OB_DUPLI_FLAG_RENDER; | object->duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT | OB_DUPLI_FLAG_RENDER; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| { | |||||
| for (wmWindowManager *wm = main->wm.first; wm; wm = wm->id.next) { | |||||
| for (wmWindow *win = wm->windows.first; win; win = win->next) { | |||||
| WorkSpace *workspace = BKE_workspace_active_get(win->workspace_hook); | |||||
| if (workspace->preferred_mode == OB_MODE_OBJECT) { /* Should never be the case! */ | |||||
| const Base *base = BKE_workspace_active_base_get(workspace, win->scene); | |||||
| if (!base) { | |||||
| /* skip */ | |||||
| } | |||||
| else if (base->object->mode == OB_MODE_OBJECT) { | |||||
| workspace->preferred_mode = (base->object->restore_mode == OB_MODE_OBJECT) ? | |||||
| OB_MODE_EDIT : base->object->restore_mode; | |||||
| } | |||||
| else { | |||||
| workspace->preferred_mode = base->object->mode; | |||||
| workspace->flags |= WORKSPACE_USE_PREFERED_MODE; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| for (WorkSpace *workspace = main->workspaces.first; workspace; workspace = workspace->id.next) { | |||||
| if (workspace->preferred_mode == OB_MODE_OBJECT) { /* Should never be the case! */ | |||||
| workspace->preferred_mode = OB_MODE_EDIT; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| static void do_version_layer_collections_idproperties(ListBase *lb) | static void do_version_layer_collections_idproperties(ListBase *lb) | ||||
| { | { | ||||
| IDPropertyTemplate val = {0}; | IDPropertyTemplate val = {0}; | ||||
| for (LayerCollection *lc = lb->first; lc; lc = lc->next) { | for (LayerCollection *lc = lb->first; lc; lc = lc->next) { | ||||
| lc->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP); | lc->properties = IDP_New(IDP_GROUP, &val, ROOT_PROP); | ||||
| BKE_layer_collection_engine_settings_create(lc->properties); | BKE_layer_collection_engine_settings_create(lc->properties); | ||||
| ▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines | |||||