Blender V5.3
scene.cc File Reference
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <optional>
#include "MEM_guardedalloc.h"
#include "DNA_anim_types.h"
#include "DNA_brush_types.h"
#include "DNA_collection_types.h"
#include "DNA_curveprofile_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_lightprobe_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_mask_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
#include "DNA_rigidbody_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "DNA_userdef_types.h"
#include "DNA_vfont_types.h"
#include "DNA_view3d_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_world_types.h"
#include "BLI_function_ref.hh"
#include "BLI_listbase.hh"
#include "BLI_math_base_c.hh"
#include "BLI_math_rotation_c.hh"
#include "BLI_path_utils.hh"
#include "BLI_string_utf8.hh"
#include "BLI_string_utils.hh"
#include "BLI_threads.hh"
#include "BLI_utildefines.hh"
#include "BLO_readfile.hh"
#include "BLT_translation.hh"
#include "BKE_action.hh"
#include "BKE_anim_data.hh"
#include "BKE_animsys.hh"
#include "BKE_bpath.hh"
#include "BKE_callbacks.hh"
#include "BKE_collection.hh"
#include "BKE_colortools.hh"
#include "BKE_curveprofile.h"
#include "BKE_duplilist.hh"
#include "BKE_editmesh.hh"
#include "BKE_effect.h"
#include "BKE_fcurve.hh"
#include "BKE_idprop.hh"
#include "BKE_idtype.hh"
#include "BKE_image.hh"
#include "BKE_image_format.hh"
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_lib_remap.hh"
#include "BKE_main.hh"
#include "BKE_mesh_types.hh"
#include "BKE_node_legacy_types.hh"
#include "BKE_node_runtime.hh"
#include "BKE_paint.hh"
#include "BKE_paint_types.hh"
#include "BKE_pointcache.h"
#include "BKE_preview_image.hh"
#include "BKE_rigidbody.h"
#include "BKE_scene.hh"
#include "BKE_scene_runtime.hh"
#include "BKE_screen.hh"
#include "BKE_sound.hh"
#include "BKE_unit.hh"
#include "BKE_workspace.hh"
#include "ANIM_action.hh"
#include "DEG_depsgraph.hh"
#include "DEG_depsgraph_build.hh"
#include "DEG_depsgraph_debug.hh"
#include "DEG_depsgraph_query.hh"
#include "NOD_eval_log.hh"
#include "RE_engine.h"
#include "RNA_access.hh"
#include "SEQ_iterator.hh"
#include "SEQ_sequencer.hh"
#include "BLO_read_write.hh"
#include "IMB_colormanagement.hh"
#include "IMB_imbuf.hh"
#include "DRW_engine.hh"
#include "bmesh.hh"
#include "versioning_common.hh"

Go to the source code of this file.

Classes

struct  blender::DepsgraphKey
class  blender::CompositorRuntime
class  blender::SceneRuntime
class  blender::SequencerRuntime

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define DNA_DEPRECATED_ALLOW
#define FOREACHID_PROCESS_ID_NOCHECK(_data, _id_super, _cb_flag)
#define FOREACHID_PROCESS_IDSUPER(_data, _id_super, _cb_flag)

Enumerations

enum  blender::eCyclesFeatureSet { blender::CYCLES_FEATURES_SUPPORTED = 0 , blender::CYCLES_FEATURES_EXPERIMENTAL = 1 }

Functions

static void blender::remove_sequencer_fcurves (Scene *sce)
ToolSettings * blender::BKE_toolsettings_copy (ToolSettings *toolsettings, int flag)
void blender::BKE_toolsettings_free (ToolSettings *toolsettings)
void blender::BKE_scene_copy_data_eevee (Scene *sce_dst, const Scene *sce_src)
Scene * blender::BKE_scene_duplicate (Main *bmain, Scene *sce, eSceneCopyMethod type, eDupli_ID_Flags duplicate_flags, uint duplicate_options)
void blender::BKE_scene_groups_relink (Scene *sce)
bool blender::BKE_scene_can_be_removed (const Main *bmain, const Scene *scene)
Scene * blender::BKE_scene_find_replacement (const Main &bmain, const Scene &scene, FunctionRef< bool(const Scene &scene)> scene_validate_cb=nullptr)
Scene * blender::BKE_scene_add (Main *bmain, const char *name)
bool blender::BKE_scene_object_find (const Main &bmain, Scene *scene, Object *ob)
Object * blender::BKE_scene_object_find_by_name (const Main &bmain, const Scene *scene, const char *name)
void blender::BKE_scene_set_background (Main *bmain, Scene *sce)
Scene * blender::BKE_scene_set_name (Main *bmain, const char *name)
int blender::BKE_scene_base_iter_next (Depsgraph *depsgraph, SceneBaseIter *iter, Scene **scene, int val, Base **base, Object **ob)
bool blender::BKE_scene_has_view_layer (const Scene *scene, const ViewLayer *layer)
Scene * blender::BKE_scene_find_from_collection (const Main *bmain, const Collection *collection)
Object * blender::BKE_scene_camera_switch_find (const Scene *scene, const int time)
bool blender::BKE_scene_camera_switch_update (Scene *scene)
const char * blender::BKE_scene_find_marker_name (const Scene *scene, int frame)
const char * blender::BKE_scene_find_last_marker_name (const Scene *scene, int frame)
float blender::BKE_scene_frame_snap_by_seconds (const Scene *scene, double interval_in_seconds, float frame)
void blender::BKE_scene_remove_rigidbody_object (Main *bmain, Scene *scene, Object *ob, bool free_us)
bool blender::BKE_scene_validate_setscene (Main *bmain, Scene *sce)
float blender::BKE_scene_ctime_get (const Scene *scene)
float blender::BKE_scene_frame_to_ctime (const Scene *scene, int frame)
float blender::BKE_scene_frame_get (const Scene *scene)
void blender::BKE_scene_frame_set (Scene *scene, float frame)
ScenePlaybackRange blender::BKE_scene_get_playback_range (const Scene *scene)
void blender::BKE_scene_frame_clamp_for_playback (Scene *scene, bool is_playing_forward)
static bool blender::check_rendered_viewport_visible (Main *bmain)
static void blender::prepare_mesh_for_viewport_render (Main *bmain, const Scene *scene, ViewLayer *view_layer)
void blender::BKE_scene_update_sound (Depsgraph *depsgraph, Main *bmain)
void blender::BKE_scene_update_tag_audio_volume (Depsgraph *, Scene *scene)
static void blender::scene_graph_update_tagged (Depsgraph *depsgraph, Main *bmain, bool only_if_tagged)
void blender::BKE_scene_graph_update_tagged (Depsgraph *depsgraph, Main *bmain)
void blender::BKE_scene_graph_evaluated_ensure (Depsgraph *depsgraph, Main *bmain)
void blender::BKE_scene_graph_update_for_newframe_ex (Depsgraph *depsgraph, bool clear_recalc)
void blender::BKE_scene_graph_update_for_newframe (Depsgraph *depsgraph)
void blender::BKE_scene_view_layer_graph_evaluated_ensure (Main *bmain, Scene *scene, ViewLayer *view_layer)
SceneRenderView * blender::BKE_scene_add_render_view (Scene *sce, const char *name)
bool blender::BKE_scene_remove_render_view (Scene *scene, SceneRenderView *srv)
int blender::get_render_subsurf_level (const RenderData *r, int lvl, bool for_render)
int blender::get_render_child_particle_number (const RenderData *r, int child_num, bool for_render)
Base * blender::_setlooper_base_step (const Main &bmain, Scene **sce_iter, ViewLayer *view_layer, Base *base)
bool blender::BKE_scene_use_shading_nodes_custom (Scene *scene)
bool blender::BKE_scene_use_spherical_stereo (Scene *scene)
bool blender::BKE_scene_uses_blender_eevee (const Scene *scene)
bool blender::BKE_scene_uses_blender_workbench (const Scene *scene)
bool blender::BKE_scene_uses_cycles (const Scene *scene)
bool blender::BKE_scene_uses_shader_previews (const Scene *scene)
void blender::BKE_scene_base_flag_to_objects (const Main &bmain, const Scene *scene, ViewLayer *view_layer)
void blender::BKE_scene_object_base_flag_sync_from_base (Base *base)
void blender::BKE_scene_disable_color_management (Scene *scene)
bool blender::BKE_scene_check_rigidbody_active (const Scene *scene)
int blender::BKE_render_num_threads (const RenderData *r)
int blender::BKE_scene_num_threads (const Scene *scene)
void blender::BKE_render_resolution (const RenderData *r, const bool use_crop, int *r_width, int *r_height)
int blender::BKE_render_preview_pixel_size (const RenderData *r)
int blender::BKE_scene_multiview_num_views_get (const RenderData *rd)
bool blender::BKE_scene_multiview_is_stereo3d (const RenderData *rd)
bool blender::BKE_scene_multiview_is_render_view_active (const RenderData *rd, const SceneRenderView *srv)
bool blender::BKE_scene_multiview_is_render_view_first (const RenderData *rd, const char *viewname)
bool blender::BKE_scene_multiview_is_render_view_last (const RenderData *rd, const char *viewname)
SceneRenderView * blender::BKE_scene_multiview_render_view_findindex (const RenderData *rd, int view_id)
const char * blender::BKE_scene_multiview_render_view_name_get (const RenderData *rd, int view_id)
int blender::BKE_scene_multiview_view_id_get (const RenderData *rd, const char *viewname)
void blender::BKE_scene_multiview_filepath_get (const SceneRenderView *srv, const char *filepath, char *r_filepath)
void blender::BKE_scene_multiview_view_filepath_get (const RenderData *rd, const char *filepath, const char *view, char *r_filepath)
const char * blender::BKE_scene_multiview_view_suffix_get (const RenderData *rd, const char *viewname)
const char * blender::BKE_scene_multiview_view_id_suffix_get (const RenderData *rd, int view_id)
void blender::BKE_scene_multiview_view_prefix_get (const Scene *scene, const char *filepath, char *r_prefix, const char **r_ext)
void blender::BKE_scene_multiview_videos_dimensions_get (const RenderData *rd, const ImageFormatData *imf, size_t width, size_t height, size_t *r_width, size_t *r_height)
int blender::BKE_scene_multiview_num_videos_get (const RenderData *rd, const ImageFormatData *imf)
void blender::BKE_scene_ppm_get (const RenderData *rd, double r_ppm[2])
static void blender::depsgraph_key_value_free (void *value)
void blender::BKE_scene_allocate_depsgraph_hash (Scene *scene)
void blender::BKE_scene_ensure_depsgraph_hash (Scene *scene)
void blender::BKE_scene_free_depsgraph_hash (Scene *scene)
void blender::BKE_scene_free_view_layer_depsgraph (Scene *scene, ViewLayer *view_layer)
static Depsgraph ** blender::scene_get_depsgraph_p (Scene *scene, ViewLayer *view_layer, const bool allocate_ghash_entry)
static Depsgraph ** blender::scene_ensure_depsgraph_p (Main *bmain, Scene *scene, ViewLayer *view_layer)
Depsgraph * blender::BKE_scene_get_depsgraph (const Scene *scene, const ViewLayer *view_layer)
Depsgraph * blender::BKE_scene_ensure_depsgraph (Main *bmain, Scene *scene, ViewLayer *view_layer)
static char * blender::scene_undo_depsgraph_gen_key (Scene *scene, ViewLayer *view_layer, char *key_full)
GHash * blender::BKE_scene_undo_depsgraphs_extract (Main *bmain)
void blender::BKE_scene_undo_depsgraphs_restore (Main *bmain, GHash *depsgraph_extract)
Scene Orientation Slots
TransformOrientationSlot * blender::BKE_scene_orientation_slot_get (Scene *scene, int slot_index)
TransformOrientationSlot * blender::BKE_scene_orientation_slot_get_from_flag (Scene *scene, int flag)
void blender::BKE_scene_orientation_slot_set_index (TransformOrientationSlot *orient_slot, int orientation)
int blender::BKE_scene_orientation_slot_get_index (const TransformOrientationSlot *orient_slot)
int blender::BKE_scene_orientation_get_index (Scene *scene, int slot_index)
int blender::BKE_scene_orientation_get_index_from_flag (Scene *scene, int flag)
Scene Orientation
void blender::BKE_scene_transform_orientation_remove (Scene *scene, TransformOrientation *orientation)
TransformOrientation * blender::BKE_scene_transform_orientation_find (const Scene *scene, int index)
int blender::BKE_scene_transform_orientation_get_index (const Scene *scene, const TransformOrientation *orientation)

Variables

Render Data Enum/Flags
const char * blender::RE_engine_id_BLENDER_EEVEE = "BLENDER_EEVEE"
const char * blender::RE_engine_id_BLENDER_EEVEE_NEXT = "BLENDER_EEVEE_NEXT"
const char * blender::RE_engine_id_BLENDER_WORKBENCH = "BLENDER_WORKBENCH"
const char * blender::RE_engine_id_CYCLES = "CYCLES"

Scene Data-Block

#define BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_IDSUPER_P(_data, _id_p, _do_undo_restore, _action, _reader, _id_old_p, _cb_flag)
#define BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_FUNCTION_CALL(_data, _do_undo_restore, _func_call)
enum  blender::eSceneForeachUndoPreserveProcess { blender::SCENE_FOREACH_UNDO_RESTORE , blender::SCENE_FOREACH_UNDO_NO_RESTORE }
CurveMapping * blender::BKE_sculpt_default_cavity_curve ()
CurveMapping * blender::BKE_paint_default_curve ()
CurveMapping * blender::BKE_paint_default_curve_inverted ()
static void blender::scene_init_data (ID *id)
static void blender::scene_copy_data (Main *bmain, std::optional< Library * > owner_library, ID *id_dst, const ID *id_src, const int flag)
static void blender::scene_free_data (ID *id)
static void blender::scene_foreach_rigidbodyworldSceneLooper (RigidBodyWorld *, ID **id_pointer, void *user_data, const LibraryForeachIDCallbackFlag cb_flag)
static void blender::scene_foreach_toolsettings_id_pointer_process (ID **id_p, const eSceneForeachUndoPreserveProcess action, BlendLibReader *reader, ID **id_old_p, const uint cb_flag)
static void blender::scene_foreach_paint (LibraryForeachIDData *data, Paint *paint, const bool do_undo_restore, BlendLibReader *reader, Paint *paint_old)
static void blender::scene_foreach_toolsettings (LibraryForeachIDData *data, ToolSettings *toolsett, const bool do_undo_restore, BlendLibReader *reader, ToolSettings *toolsett_old)
static void blender::scene_foreach_layer_collection (LibraryForeachIDData *data, ListBaseT< LayerCollection > *lb, const bool is_master)
static bool blender::strip_foreach_member_id_cb (Strip *strip, void *user_data)
static void blender::scene_foreach_id (ID *id, LibraryForeachIDData *data)
static bool blender::strip_foreach_path_callback (Strip *strip, void *user_data)
static void blender::scene_foreach_path (ID *id, BPathForeachPathData *bpath_data)
static void blender::scene_foreach_working_space_color (ID *id, const IDTypeForeachColorFunctionCallback &fn)
static void blender::scene_foreach_asset_weak_reference (ID *id, FunctionRef< void(AssetWeakReference &)> fn)
static void blender::scene_foreach_cache (ID *id, IDTypeForeachCacheFunctionCallback function_callback, void *user_data)
static void blender::scene_blend_write_compositor_forward_compat (Scene &scene, const bNodeTree &compositing_node_group, BlendWriter *writer)
static void blender::scene_blend_write (BlendWriter *writer, ID *id, const void *id_address)
static void blender::direct_link_paint_helper (BlendDataReader *reader, const Scene *scene, Paint **paint)
static void blender::link_recurs_seq (BlendDataReader *reader, ListBaseT< Strip > *lb)
static void blender::scene_blend_read_data (BlendDataReader *reader, ID *id)
static void blender::scene_blend_read_after_liblink (BlendLibReader *reader, ID *id)
static void blender::scene_undo_preserve (BlendLibReader *reader, ID *id_new, ID *id_old)
static void blender::scene_lib_override_apply_post (ID *id_dst, ID *)

Macro Definition Documentation

◆ BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_FUNCTION_CALL

#define BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_FUNCTION_CALL ( _data,
_do_undo_restore,
_func_call )
Value:
{ \
if (_do_undo_restore) { \
_func_call; \
} \
else { \
BLI_assert((_data) != nullptr); \
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(_data, _func_call); \
} \
} \
(void)0

Definition at line 560 of file scene.cc.

Referenced by blender::scene_foreach_toolsettings().

◆ BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_IDSUPER_P

#define BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS_IDSUPER_P ( _data,
_id_p,
_do_undo_restore,
_action,
_reader,
_id_old_p,
_cb_flag )
Value:
{ \
if (_do_undo_restore) { \
scene_foreach_toolsettings_id_pointer_process( \
(ID **)(_id_p), _action, _reader, (ID **)(_id_old_p), _cb_flag); \
} \
else { \
BLI_assert((_data) != nullptr); \
BKE_LIB_FOREACHID_PROCESS_IDSUPER_P(_data, _id_p, _cb_flag); \
} \
} \
(void)0

Special handling is needed here, as scene_foreach_toolsettings (and its dependency scene_foreach_paint) are also used by scene_undo_preserve, where LibraryForeachIDData *data is nullptr.

Definition at line 546 of file scene.cc.

Referenced by blender::scene_foreach_paint(), and blender::scene_foreach_toolsettings().

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 10 of file scene.cc.

◆ FOREACHID_PROCESS_ID_NOCHECK

#define FOREACHID_PROCESS_ID_NOCHECK ( _data,
_id_super,
_cb_flag )
Value:
{ \
BKE_lib_query_foreachid_process((_data), reinterpret_cast<ID **>(&(_id_super)), (_cb_flag)); \
if (BKE_lib_query_foreachid_iter_stop(_data)) { \
return false; \
} \
} \
((void)0)

◆ FOREACHID_PROCESS_IDSUPER

#define FOREACHID_PROCESS_IDSUPER ( _data,
_id_super,
_cb_flag )
Value:
{ \
CHECK_TYPE(&((_id_super)->id), ID *); \
FOREACHID_PROCESS_ID_NOCHECK(_data, _id_super, _cb_flag); \
} \
((void)0)

Referenced by blender::strip_foreach_member_id_cb().