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 used for constraints and viewport drawing

Type:MovieClip
active_layer

Active scene layer index

Type:int in [-inf, inf], default 0, (readonly)
animation_data

Animation data for this data-block

Type:AnimData, (readonly)
audio_distance_model

Distance model for distance attenuation calculation

  • 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 Exponent, Exponent distance model.
  • EXPONENT_CLAMPED Exponent 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 0.0
audio_doppler_speed

Speed of sound for Doppler effect calculation

Type:float in [0.01, inf], default 0.0
audio_volume

Audio volume

Type:float in [0, 100], default 0.0
background_set

Background set scene

Type:Scene
camera

Active camera, used for rendering the scene

Type:Object
cursor_location

3D cursor location

Type:float array of 3 items in [-inf, inf], default (0.0, 0.0, 0.0)
cycles

Cycles render settings

Type:CyclesRenderSettings, (readonly)
cycles_curves

Cycles hair rendering settings

Type:CyclesCurveRenderSettings, (readonly)
depsgraph

Dependencies in the scene data

Type:Depsgraph, (readonly)
display_settings

Settings of device saved image would be displayed on

Type:ColorManagedDisplaySettings, (readonly)
frame_current

Current Frame, to update animation data from python frame_set() instead

Type:int in [-500000, 500000], default 0
frame_current_final

Current frame with subframe and time remapping applied

Type:float in [-500000, 500000], default 0.0, (readonly)
frame_end

Final frame of the playback/rendering range

Type:int in [0, 500000], default 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, 500000], default 0
frame_step

Number of frames to skip forward while rendering/playing back each frame

Type:int in [0, 500000], default 0
frame_subframe
Type:float in [-inf, inf], default 0.0, (readonly)
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, 0.0)
grease_pencil

Grease Pencil data-block

Type:GreasePencil
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:KeyingSets bpy_prop_collection of KeyingSet, (readonly)
keying_sets_all

All Keying Sets available for use (Builtins and Absolute Keying Sets for this Scene)

Type:KeyingSetsAll bpy_prop_collection of KeyingSet, (readonly)
layers

Visible layers - Shift-Click/Drag to select multiple layers

Type:boolean array of 20 items, default (False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)
lock_frame_selection_to_range

Don’t allow frame to be selected with mouse outside of frame range

Type:boolean, default False
node_tree

Compositing node tree

Type:NodeTree, (readonly)
object_bases
Type:SceneBases bpy_prop_collection of ObjectBase, (readonly)
objects
Type:SceneObjects bpy_prop_collection of Object, (readonly)
orientations
Type:bpy_prop_collection of TransformOrientation, (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
sync_mode

How to sync playback

  • NONE No Sync, Do not sync, play every frame.
  • FRAME_DROP Frame Dropping, Drop frames if playback is too slow.
  • AUDIO_SYNC AV-sync, Sync to audio playback, dropping frames.
Type:enum in [‘NONE’, ‘FRAME_DROP’, ‘AUDIO_SYNC’], default ‘NONE’
timeline_markers

Markers used in all timelines for the current scene

Type:TimelineMarkers bpy_prop_collection of TimelineMarker, (readonly)
tool_settings
Type:ToolSettings, (readonly, never None)
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_audio_sync

Play back and sync with audio clock, dropping frames if frame display is too slow

Type:boolean, default False
use_frame_drop

Play back dropping frames if frame display is too slow

Type:boolean, default False
use_gravity

Use global gravity for all dynamics

Type:boolean, default False
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 OpenGL renders instead of the Render properties start/end frame range

Type:boolean, default False
use_stamp_note

User defined note for the render stamping

Type:string, default “”, (never None)
view_settings

Color management settings applied on image before saving

Type:ColorManagedViewSettings, (readonly)
world

World used for rendering the scene

Type:World
sequence_editor_create()

Ensure sequence editor is valid in this scene

Returns:New sequence editor data or NULL
Return type:SequenceEditor
sequence_editor_clear()

Clear sequence editor in this scene

statistics()

statistics

Returns:Statistics
Return type:string, (never None)
frame_set(frame, subframe=0.0)

Set scene frame updating all objects immediately

Parameters:
  • frame (int in [-500000, 500000]) – Frame number to set
  • subframe (float in [0, 1], (optional)) – Sub-frame time, between 0.0 and 1.0
update()

Update data tagged to be updated from previous access to data or operators

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(origin, direction, distance=1.70141e+38)

Cast a ray onto in object space

Parameters:

distance (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, Object

matrix, Matrix, float array of 16 items in [-inf, inf]

collada_export(filepath, apply_modifiers=False, export_mesh_type=0, selected=False, include_children=False, include_armatures=False, include_shapekeys=False, deform_bones_only=False, active_uv_only=False, include_uv_textures=False, include_material_textures=False, use_texture_copies=False, use_ngons=True, use_object_instantiation=True, use_blender_profile=True, sort_by_name=False, open_sim=False, export_transformation_type=0)

Export to collada file

Parameters:
  • filepath (string, (never None)) – File Path, File path to write Collada file
  • apply_modifiers (boolean, (optional)) – Apply Modifiers, Apply modifiers
  • export_mesh_type (int in [-inf, inf], (optional)) – Resolution, Modifier resolution for export
  • selected (boolean, (optional)) – Selection Only, Export only selected elements
  • include_children (boolean, (optional)) – Include Children, Export all children of selected objects (even if not selected)
  • include_armatures (boolean, (optional)) – Include Armatures, Export related armatures (even if not selected)
  • include_shapekeys (boolean, (optional)) – Include Shape Keys, Export all Shape Keys from Mesh Objects
  • deform_bones_only (boolean, (optional)) – Deform Bones only, Only export deforming bones with armatures
  • active_uv_only (boolean, (optional)) – Active UV Layer only, Export only the active UV Layer
  • include_uv_textures (boolean, (optional)) – Include UV Textures, Export textures assigned to the object UV maps
  • include_material_textures (boolean, (optional)) – Include Material Textures, Export textures assigned to the object Materials
  • use_texture_copies (boolean, (optional)) – copy, Copy textures to same folder where the .dae file is exported
  • use_ngons (boolean, (optional)) – Use NGons, Keep NGons in Export
  • use_object_instantiation (boolean, (optional)) – Use Object Instances, Instantiate multiple Objects from same Data
  • use_blender_profile (boolean, (optional)) – Use Blender Profile, Export additional Blender specific information (for material, shaders, bones, etc.)
  • sort_by_name (boolean, (optional)) – Sort by Object name, Sort exported data by Object name
  • open_sim (boolean, (optional)) – Export for SL/OpenSim, Compatibility mode for SL, OpenSim and similar online worlds
  • export_transformation_type (int in [-inf, inf], (optional)) – Transformation, Transformation type for translation, scale and rotation
alembic_export(filepath, frame_start=1, frame_end=1, xform_samples=1, geom_samples=1, shutter_open=0.0, shutter_close=1.0, selected_only=False, uvs=True, normals=True, vcolors=False, apply_subdiv=True, flatten=False, visible_layers_only=False, renderable_only=False, face_sets=False, subdiv_schema=False, compression_type='OGAWA', packuv=False, scale=1.0)

Export to Alembic file

Parameters:
  • filepath (string, (never None)) – File Path, File path to write Alembic file
  • frame_start (int in [-inf, inf], (optional)) – Start, Start Frame
  • frame_end (int in [-inf, inf], (optional)) – End, End Frame
  • xform_samples (int in [1, 128], (optional)) – Xform samples, Transform samples per frame
  • geom_samples (int in [1, 128], (optional)) – Geom samples, Geometry samples per frame
  • shutter_open (float in [-1, 1], (optional)) – Shutter open
  • shutter_close (float in [-1, 1], (optional)) – Shutter close
  • selected_only (boolean, (optional)) – Selected only, Export only selected objects
  • uvs (boolean, (optional)) – UVs, Export UVs
  • normals (boolean, (optional)) – Normals, Export cormals
  • vcolors (boolean, (optional)) – Vertex colors, Export vertex colors
  • apply_subdiv (boolean, (optional)) – Subsurfs as meshes, Export subdivision surfaces as meshes
  • flatten (boolean, (optional)) – Flatten hierarchy, Flatten hierarchy
  • visible_layers_only (boolean, (optional)) – Visible layers only, Export only objects in visible layers
  • renderable_only (boolean, (optional)) – Renderable objects only, Export only objects marked renderable in the outliner
  • face_sets (boolean, (optional)) – Facesets, Export face sets
  • subdiv_schema (boolean, (optional)) – Use Alembic subdivision Schema, Use Alembic subdivision Schema
  • compression_type (enum in ['OGAWA', 'HDF5'], (optional)) – Compression
  • packuv (boolean, (optional)) – Export with packed UV islands, Export with packed UV islands
  • scale (float in [0.0001, 1000], (optional)) – Scale, Value by which to enlarge or shrink the objects with respect to the world’s origin

Inherited Properties

Inherited Functions

References