Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/scene.c
| Show First 20 Lines • Show All 721 Lines • ▼ Show 20 Lines | void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce) | ||||
| Scene *sce1; | Scene *sce1; | ||||
| bScreen *sc; | bScreen *sc; | ||||
| /* check all sets */ | /* check all sets */ | ||||
| for (sce1 = bmain->scene.first; sce1; sce1 = sce1->id.next) | for (sce1 = bmain->scene.first; sce1; sce1 = sce1->id.next) | ||||
| if (sce1->set == sce) | if (sce1->set == sce) | ||||
| sce1->set = NULL; | sce1->set = NULL; | ||||
| /* check render layer nodes in other scenes */ | for (sce1 = bmain->scene.first; sce1; sce1 = sce1->id.next) { | ||||
| clear_scene_in_nodes(bmain, sce); | bNode *node; | ||||
| if (sce1 == sce || !sce1->nodetree) | |||||
| continue; | |||||
| for (node = sce1->nodetree->nodes.first; node; node = node->next) { | |||||
| if (node->id == &sce->id) | |||||
| node->id = NULL; | |||||
| } | |||||
| } | |||||
| /* al screens */ | /* al screens */ | ||||
| for (sc = bmain->screen.first; sc; sc = sc->id.next) | for (sc = bmain->screen.first; sc; sc = sc->id.next) | ||||
| if (sc->scene == sce) | if (sc->scene == sce) | ||||
| sc->scene = newsce; | sc->scene = newsce; | ||||
| BKE_libblock_free(bmain, sce); | BKE_libblock_free(bmain, sce); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,107 Lines • Show Last 20 Lines | |||||