Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/scene.c
| Show First 20 Lines • Show All 2,026 Lines • ▼ Show 20 Lines | |||||
| void BKE_scene_groups_relink(Scene *sce) | void BKE_scene_groups_relink(Scene *sce) | ||||
| { | { | ||||
| if (sce->rigidbody_world) { | if (sce->rigidbody_world) { | ||||
| BKE_rigidbody_world_groups_relink(sce->rigidbody_world); | BKE_rigidbody_world_groups_relink(sce->rigidbody_world); | ||||
| } | } | ||||
| } | } | ||||
| bool BKE_scene_can_be_removed(const Main *bmain, const Scene *scene) | |||||
| { | |||||
| /* Linked scenes can always be removed. */ | |||||
| if (ID_IS_LINKED(scene)) { | |||||
mont29: just pass `scene`, the macro converts to `(ID *)` anyway. | |||||
| return true; | |||||
| } | |||||
| /* Local scenes can only be removed, when there is at least one local scene left. */ | |||||
| LISTBASE_FOREACH (Scene *, other_scene, &bmain->scenes) { | |||||
| if (other_scene != scene && !ID_IS_LINKED(other_scene)) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| Scene *BKE_scene_add(Main *bmain, const char *name) | Scene *BKE_scene_add(Main *bmain, const char *name) | ||||
| { | { | ||||
| Scene *sce; | Scene *sce; | ||||
| sce = BKE_id_new(bmain, ID_SCE, name); | sce = BKE_id_new(bmain, ID_SCE, name); | ||||
| id_us_min(&sce->id); | id_us_min(&sce->id); | ||||
| id_us_ensure_real(&sce->id); | id_us_ensure_real(&sce->id); | ||||
| ▲ Show 20 Lines • Show All 1,702 Lines • Show Last 20 Lines | |||||
just pass scene, the macro converts to (ID *) anyway.