Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/scene.c
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_depsgraph.h" | #include "BKE_depsgraph.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "BKE_freestyle.h" | #include "BKE_freestyle.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "BKE_gpencil.h" | #include "BKE_gpencil.h" | ||||
| #include "BKE_group.h" | #include "BKE_group.h" | ||||
| #include "BKE_icons.h" | |||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_image.h" | #include "BKE_image.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_linestyle.h" | #include "BKE_linestyle.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mask.h" | #include "BKE_mask.h" | ||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| ▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | if (scen->gpd) { | ||||
| else if (type == SCE_COPY_EMPTY) { | else if (type == SCE_COPY_EMPTY) { | ||||
| scen->gpd = NULL; | scen->gpd = NULL; | ||||
| } | } | ||||
| else { | else { | ||||
| id_us_plus((ID *)scen->gpd); | id_us_plus((ID *)scen->gpd); | ||||
| } | } | ||||
| } | } | ||||
| if (sce->preview) { | |||||
| scen->preview = BKE_previewimg_copy(sce->preview); | |||||
| } | |||||
| return scen; | return scen; | ||||
| } | } | ||||
| 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); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | #endif | ||||
| if (sce->stats) | if (sce->stats) | ||||
| MEM_freeN(sce->stats); | MEM_freeN(sce->stats); | ||||
| if (sce->fps_info) | if (sce->fps_info) | ||||
| MEM_freeN(sce->fps_info); | MEM_freeN(sce->fps_info); | ||||
| BKE_sound_destroy_scene(sce); | BKE_sound_destroy_scene(sce); | ||||
| BKE_color_managed_view_settings_free(&sce->view_settings); | BKE_color_managed_view_settings_free(&sce->view_settings); | ||||
| BKE_previewimg_free(&sce->preview); | |||||
| } | } | ||||
| Scene *BKE_scene_add(Main *bmain, const char *name) | Scene *BKE_scene_add(Main *bmain, const char *name) | ||||
| { | { | ||||
| Scene *sce; | Scene *sce; | ||||
| ParticleEditSettings *pset; | ParticleEditSettings *pset; | ||||
| int a; | int a; | ||||
| const char *colorspace_name; | const char *colorspace_name; | ||||
| ▲ Show 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | BLI_strncpy(sce->sequencer_colorspace_settings.name, colorspace_name, | ||||
| sizeof(sce->sequencer_colorspace_settings.name)); | sizeof(sce->sequencer_colorspace_settings.name)); | ||||
| /* Safe Areas */ | /* Safe Areas */ | ||||
| copy_v2_fl2(sce->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f); | copy_v2_fl2(sce->safe_areas.title, 3.5f / 100.0f, 3.5f / 100.0f); | ||||
| copy_v2_fl2(sce->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f); | copy_v2_fl2(sce->safe_areas.action, 10.0f / 100.0f, 5.0f / 100.0f); | ||||
| copy_v2_fl2(sce->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f); | copy_v2_fl2(sce->safe_areas.title_center, 17.5f / 100.0f, 5.0f / 100.0f); | ||||
| copy_v2_fl2(sce->safe_areas.action_center, 15.0f / 100.0f, 5.0f / 100.0f); | copy_v2_fl2(sce->safe_areas.action_center, 15.0f / 100.0f, 5.0f / 100.0f); | ||||
| sce->preview = NULL; | |||||
| return sce; | return sce; | ||||
| } | } | ||||
| Base *BKE_scene_base_find_by_name(struct Scene *scene, const char *name) | Base *BKE_scene_base_find_by_name(struct Scene *scene, const char *name) | ||||
| { | { | ||||
| Base *base; | Base *base; | ||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| ▲ Show 20 Lines • Show All 1,751 Lines • Show Last 20 Lines | |||||