Scene(ID)
base classes — bpy_struct, ID
- class bpy.types.Scene(ID)
Scene data-block, consisting in objects and defining time and render related settings
- audio_distance_model
Distance model for distance attenuation calculation
NONENone – No distance attenuation.INVERSEInverse – Inverse distance model.INVERSE_CLAMPEDInverse Clamped – Inverse distance model with clamping.LINEARLinear – Linear distance model.LINEAR_CLAMPEDLinear Clamped – Linear distance model with clamping.EXPONENTExponent – Exponent distance model.EXPONENT_CLAMPEDExponent Clamped – Exponent distance model with clamping.
- Type
enum in [‘NONE’, ‘INVERSE’, ‘INVERSE_CLAMPED’, ‘LINEAR’, ‘LINEAR_CLAMPED’, ‘EXPONENT’, ‘EXPONENT_CLAMPED’], default ‘NONE’
- audio_doppler_factor
Pitch factor for Doppler effect calculation
- Type
float in [0, inf], default 1.0
- audio_doppler_speed
Speed of sound for Doppler effect calculation
- Type
float in [0.01, inf], default 343.3
- audio_volume
Audio volume
- Type
float in [0, 100], default 1.0
- collection
Scene root collection that owns all the objects and other collections instantiated in the scene
- Type
Collection, (readonly, never None)
- cursor
- Type
View3DCursor, (readonly, never None)
- display
Scene display settings for 3D viewport
- Type
SceneDisplay, (readonly)
- display_settings
Settings of device saved image would be displayed on
- Type
ColorManagedDisplaySettings, (readonly)
- eevee
Eevee settings for the scene
- Type
SceneEEVEE, (readonly)
- frame_current
Current frame, to update animation data from python frame_set() instead
- Type
int in [-1048574, 1048574], default 1
- frame_current_final
Current frame with subframe and time remapping applied
- Type
float in [-1.04857e+06, 1.04857e+06], default 0.0, (readonly)
- frame_end
Final frame of the playback/rendering range
- Type
int in [0, 1048574], default 250
- frame_float
- Type
float in [-1.04857e+06, 1.04857e+06], default 0.0
- frame_preview_end
Alternative end frame for UI playback
- Type
int in [-inf, inf], default 0
- frame_preview_start
Alternative start frame for UI playback
- Type
int in [-inf, inf], default 0
- frame_start
First frame of the playback/rendering range
- Type
int in [0, 1048574], default 1
- frame_step
Number of frames to skip forward while rendering/playing back each frame
- Type
int in [0, 1048574], default 1
- frame_subframe
- Type
float in [0, 1], default 0.0
- game_settings
- Type
SceneGameData, (readonly, never None)
- gravity
Constant acceleration in a given direction
- Type
float array of 3 items in [-inf, inf], default (0.0, 0.0, -9.81)
- grease_pencil
Grease Pencil data-block used for annotations in the 3D view
- Type
- grease_pencil_settings
Grease Pencil settings for the scene
- Type
SceneGpencil, (readonly)
- is_nla_tweakmode
Whether there is any action referenced by NLA being edited (strictly read-only)
- Type
boolean, default False, (readonly)
- keying_sets
Absolute Keying Sets for this Scene
- Type
KeyingSetsbpy_prop_collectionofKeyingSet, (readonly)
- keying_sets_all
All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)
- Type
KeyingSetsAllbpy_prop_collectionofKeyingSet, (readonly)
- lock_frame_selection_to_range
Don’t allow frame to be selected with mouse outside of frame range
- Type
boolean, default False
- objects
- Type
SceneObjectsbpy_prop_collectionofObject, (readonly)
- render
- Type
RenderSettings, (readonly, never None)
- rigidbody_world
- Type
RigidBodyWorld, (readonly)
- safe_areas
- Type
DisplaySafeAreas, (readonly, never None)
- sequence_editor
- Type
SequenceEditor, (readonly)
- sequencer_colorspace_settings
Settings of color space sequencer is working in
- Type
ColorManagedSequencerColorspaceSettings, (readonly)
- show_keys_from_selected_only
Consider keyframes for active object and/or its selected bones only (in timeline and when jumping between keyframes)
- Type
boolean, default False
- show_subframe
Show current scene subframe and allow set it using interface tools
- Type
boolean, default False
- sync_mode
How to sync playback
NONEPlay Every Frame – Do not sync, play every frame.FRAME_DROPFrame Dropping – Drop frames if playback is too slow.AUDIO_SYNCSync to Audio – Sync to audio playback, dropping frames.
- Type
enum in [‘NONE’, ‘FRAME_DROP’, ‘AUDIO_SYNC’], default ‘AUDIO_SYNC’
- timeline_markers
Markers used in all timelines for the current scene
- Type
TimelineMarkersbpy_prop_collectionofTimelineMarker, (readonly)
- tool_settings
- Type
ToolSettings, (readonly, never None)
- transform_orientation_slots
- Type
bpy_prop_collectionofTransformOrientationSlot, (readonly)
- unit_settings
Unit editing settings
- Type
UnitSettings, (readonly, never None)
- use_audio
Play back of audio from Sequence Editor will be muted
- Type
boolean, default False
- use_audio_scrub
Play audio from Sequence Editor while scrubbing
- Type
boolean, default False
- use_gravity
Use global gravity for all dynamics
- Type
boolean, default True
- use_nodes
Enable the compositing node tree
- Type
boolean, default False
- use_preview_range
Use an alternative start/end frame range for animation playback and view renders
- Type
boolean, default False
- use_stamp_note
User defined note for the render stamping
- Type
string, default “”, (never None)
- view_layers
- Type
ViewLayersbpy_prop_collectionofViewLayer, (readonly)
- view_settings
Color management settings applied on image before saving
- Type
ColorManagedViewSettings, (readonly)
- classmethod update_render_engine()
Trigger a render engine update
- statistics(view_layer)
statistics
- Parameters
view_layer (
ViewLayer, (never None)) – View Layer- Returns
Statistics
- Return type
string, (never None)
- frame_set(frame, subframe=0.0)
Set scene frame updating all objects immediately
- Parameters
frame (int in [-1048574, 1048574]) – Frame number to set
subframe (float in [0, 1], (optional)) – Subframe time, between 0.0 and 1.0
- uvedit_aspect(object)
Get uv aspect for current object
- Parameters
object (
Object, (never None)) – Object- Returns
aspect
- Return type
float array of 2 items in [0, inf]
- ray_cast(depsgraph, origin, direction, distance=1.70141e+38)
Cast a ray onto in object space
- Parameters
depsgraph (
Depsgraph, (never None)) – The current dependency graphdistance (float in [0, inf], (optional)) – Maximum distance
- Return (result, location, normal, index, object, matrix)
result, boolean
location, The hit location of this ray cast, float array of 3 items in [-inf, inf]
normal, The face normal at the ray cast hit location, float array of 3 items in [-inf, inf]
index, The face index, -1 when original data isn’t available, int in [-inf, inf]
object, Ray cast object,
Objectmatrix, Matrix, float multi-dimensional array of 4 * 4 items in [-inf, inf]
- sequence_editor_create()
Ensure sequence editor is valid in this scene
- Returns
New sequence editor data or NULL
- Return type
- sequence_editor_clear()
Clear sequence editor in this scene
- classmethod bl_rna_get_subclass(id, default=None)
- Parameters
id (string) – The RNA type identifier.
- Returns
The RNA type or default when not found.
- Return type
bpy.types.Structsubclass
- classmethod bl_rna_get_subclass_py(id, default=None)
- Parameters
id (string) – The RNA type identifier.
- Returns
The class or default when not found.
- Return type
type
Inherited Properties
Inherited Functions
References