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

active_clip

Active Movie Clip that can be used by motion tracking constraints or as a camera’s background image

Type:

MovieClip

animation_data

Animation data for this data-block (readonly)

Type:

AnimData

annotation

Data-block used for annotations in the 3D view

Type:

Annotation

audio_distance_model

Distance model for distance attenuation calculation (default 'INVERSE_CLAMPED')

  • NONE None – No distance attenuation.

  • INVERSE Inverse – Inverse distance model.

  • INVERSE_CLAMPED Inverse Clamped – Inverse distance model with clamping.

  • LINEAR Linear – Linear distance model.

  • LINEAR_CLAMPED Linear Clamped – Linear distance model with clamping.

  • EXPONENT Exponential – Exponential distance model.

  • EXPONENT_CLAMPED Exponential Clamped – Exponential distance model with clamping.

Type:

Literal[‘NONE’, ‘INVERSE’, ‘INVERSE_CLAMPED’, ‘LINEAR’, ‘LINEAR_CLAMPED’, ‘EXPONENT’, ‘EXPONENT_CLAMPED’]

audio_doppler_factor

Pitch factor for Doppler effect calculation (in [0, inf], default 1.0)

Type:

float

audio_doppler_speed

Speed of sound for Doppler effect calculation (in [0.01, inf], default 343.3)

Type:

float

audio_volume

Audio volume (in [0, 100], default 1.0)

Type:

float

background_set

Background set scene

Type:

Scene

camera

Active camera, used for rendering the scene

Type:

Object

collection

Scene root collection that owns all the objects and other collections instantiated in the scene (readonly, never None)

Type:

Collection

componenthelper

Add a component defined in this file

Type:

Text

compositing_node_group

Compositor Nodes

Type:

NodeTree

cursor

(readonly, never None)

Type:

View3DCursor

custom_mainloop_tree
Type:

NodeTree

display

Scene display settings for 3D viewport (readonly)

Type:

SceneDisplay

display_settings

Settings of device saved image would be displayed on (readonly)

Type:

ColorManagedDisplaySettings

eevee

EEVEE settings for the scene (readonly)

Type:

SceneEEVEE

frame_current

Current frame, to update animation data from Python frame_set() instead (in [-1048574, 1048574], default 1)

Type:

int

frame_current_final

Current frame with subframe and time remapping applied (in [-1.04857e+06, 1.04857e+06], default 0.0, readonly)

Type:

float

frame_end

Final frame of the playback/rendering range (in [0, 1048574], default 250)

Type:

int

frame_float

(in [-1.04857e+06, 1.04857e+06], default 0.0)

Type:

float

frame_preview_end

Alternative end frame for UI playback (in [-inf, inf], default 0)

Type:

int

frame_preview_start

Alternative start frame for UI playback (in [-inf, inf], default 0)

Type:

int

frame_start

First frame of the playback/rendering range (in [0, 1048574], default 1)

Type:

int

frame_step

Number of frames to skip forward while rendering/playing back each frame (in [0, 1048574], default 1)

Type:

int

frame_subframe

(in [0, 1], default 0.0)

Type:

float

game_settings

(readonly, never None)

Type:

SceneGameData

gravity

Constant acceleration in a given direction (array of 3 items, in [-inf, inf], default (0.0, 0.0, -9.81))

Type:

mathutils.Vector

grease_pencil_settings

Grease Pencil settings for the scene (readonly)

Type:

SceneGpencil

hydra

Hydra settings for the scene (readonly)

Type:

SceneHydra

is_nla_tweakmode

Whether there is any action referenced by NLA being edited (strictly read-only) (default False, readonly)

Type:

bool

jump_in_game_cam

(default False)

Type:

bool

keying_sets

Absolute Keying Sets for this Scene (default None, readonly)

Type:

KeyingSets[KeyingSet]

keying_sets_all

All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene) (default None, readonly)

Type:

KeyingSetsAll[KeyingSet]

lock_frame_selection_to_range

Don’t allow frame to be selected with mouse outside of frame range (default False)

Type:

bool

nl_fmod_parameters

(default None, readonly)

Type:

bpy_prop_collection[LogicNodesFmodParameter]

nl_global_cat_selected

(in [-inf, inf], default 0)

Type:

int

nl_global_categories

(default None, readonly)

Type:

bpy_prop_collection[LogicNodesGlobalCategory]

nl_portals

(default None, readonly)

Type:

bpy_prop_collection[LogicNodesPortal]

objects

(default None, readonly)

Type:

SceneObjects[Object]

render

(readonly, never None)

Type:

RenderSettings

rigidbody_world

(readonly)

Type:

RigidBodyWorld

safe_areas

(readonly, never None)

Type:

DisplaySafeAreas

screen_console_key

(default “BACKSLASH”, never None)

Type:

str

screen_console_open

When in debug mode, the on-screen console will always display messages, even when inactive (default False)

Type:

bool

sequence_editor

(readonly)

Type:

SequenceEditor

sequencer_colorspace_settings

Settings of color space sequencer is working in (readonly)

Type:

ColorManagedSequencerColorspaceSettings

show_keys_from_selected_only

Only include channels relating to selected objects and data (default True)

Type:

bool

show_subframe

Display and allow setting fractional frame values for the current frame (default False)

Type:

bool

simulation_frame_end

Frame at which simulations end (in [-inf, inf], default 250)

Type:

int

simulation_frame_start

Frame at which simulations start (in [-inf, inf], default 1)

Type:

int

sync_mode

How to sync playback (default 'AUDIO_SYNC')

  • NONE Play Every Frame – Do not sync, play every frame.

  • FRAME_DROP Frame Dropping – Drop frames if playback is too slow.

  • AUDIO_SYNC Sync to Audio – Sync to audio playback, dropping frames.

Type:

Literal[‘NONE’, ‘FRAME_DROP’, ‘AUDIO_SYNC’]

time_jump_delta

Number of frames or seconds to jump forward or backward (in [0.1, inf], default 1.0)

Type:

float

time_jump_unit

Which unit to use for time jumps in the timeline (default 'SECOND')

  • FRAME Frame – Jump by frames.

  • SECOND Second – Jump by seconds.

Type:

Literal[‘FRAME’, ‘SECOND’]

timeline_markers

Markers used in all timelines for the current scene (default None, readonly)

Type:

TimelineMarkers[TimelineMarker]

tool_settings

(readonly, never None)

Type:

ToolSettings

transform_orientation_slots

(default None, readonly)

Type:

bpy_prop_collection[TransformOrientationSlot]

unit_settings

Unit editing settings (readonly, never None)

Type:

UnitSettings

use_audio

Play back of audio from Sequence Editor, otherwise mute audio (default False)

Type:

bool

use_audio_scrub

Play audio from Sequence Editor while scrubbing (default False)

Type:

bool

use_custom_simulation_range

Use a simulation range that is different from the scene range for simulation nodes that don’t override the frame range themselves (default False)

Type:

bool

use_gravity

Use global gravity for all dynamics (default True)

Type:

bool

use_nodes

Enable the compositing node group. (default False)

Deprecated since version 5.0: removal planned in version 6.0

Unused but kept for compatibility reasons. Setting the property has no effect, and getting it always returns True. Use #scene.render.use_compositing to turn compositing to enable or disable compositing.

Type:

bool

use_preview_range

Use an alternative start/end frame range for animation playback and view renders (default False)

Type:

bool

use_screen_console

Print messages to an on-screen console. Needs at least one uplogic import or Logic Node Tree. Note: Errors are not printed to this console

(default False)

Type:

bool

use_stamp_note

User defined note for the render stamping (default “”, never None)

Type:

str

use_vr_audio_space

(default False)

Type:

bool

view_layers

(default None, readonly)

Type:

ViewLayers[ViewLayer]

view_settings

Color management settings applied on image before saving (readonly)

Type:

ColorManagedViewSettings

world

World used for rendering the scene

Type:

World

classmethod update_render_engine()

Trigger a render engine update

statistics(view_layer)

statistics

Parameters:

view_layer (ViewLayer) – View Layer, (never None)

Returns:

Statistics, (never None)

Return type:

str

frame_set(frame, *, subframe=0.0)

Set scene frame updating all objects and view layers immediately

Parameters:
  • frame (int) – Frame number to set (in [-1048574, 1048574])

  • subframe (float) – Subframe time, between 0.0 and 1.0 (in [0, 1], optional)

uvedit_aspect(object)

Get uv aspect for current object

Parameters:

object (Object) – Object (never None)

Returns:

aspect (array of 2 items, in [0, inf])

Return type:

mathutils.Vector

ray_cast(depsgraph, origin, direction, *, distance=1.70141e+38)

Cast a ray onto evaluated geometry in world-space

Parameters:
  • depsgraph (Depsgraph) – The current dependency graph (never None)

  • origin (mathutils.Vector) – (array of 3 items, in [-inf, inf])

  • direction (mathutils.Vector) – (array of 3 items, in [-inf, inf])

  • distance (float) – Maximum distance (in [0, inf], optional)

Returns:

result, bool

location, The hit location of this ray cast, mathutils.Vector

normal, The face normal at the ray cast hit location, mathutils.Vector

index, The face index, -1 when original data isn’t available, int

object, Ray cast object, Object

matrix, Matrix, mathutils.Matrix

Return type:

tuple[bool, mathutils.Vector, mathutils.Vector, int, Object, mathutils.Matrix]

sequence_editor_create()

Ensure sequence editor is valid in this scene

Returns:

New sequence editor data or None

Return type:

SequenceEditor

sequence_editor_clear()

Clear sequence editor in this scene

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions

References