Scene class

Scene class

A scene is a top-level object that contains the nodes, geometries, materials, textures, animation, poses, sub-scenes and etc. Scene can have sub-scenes, acts as multiple-document support in files like collada/blender/fbx Node hierarchy can be accessed through Scene.root_nodeScene.library is used to keep a reference of unattached objects during serialization(like meta data or custom objects) so it can be used as a library.

Inheritance: SceneSceneObjectA3DObject

The Scene type exposes the following members:

Constructors

ConstructorDescription
__init__(self)Initializes a new instance of the Scene class.
__init__(self, entity)Initializes a new instance of the Scene class with an entity attached to a new node.
__init__(self, parent_scene, name)Initializes a new instance of the Scene class as a sub-scene.

Properties

PropertyDescription
nameGets or sets the name.
propertiesGets the collection of all properties.
sceneGets the scene that this object belongs to
sub_scenesGets all sub-scenes
libraryObjects that not directly used in scene hierarchy can be defined in Library.
This is useful when you’re using sub-scenes and put reusable components under sub-scenes.
animation_clipsGets all AnimationClip defined in the scene.
current_animation_clipGets or sets the active AnimationClip
asset_infoGets or sets the top-level asset information
posesGets all Pose used in this scene.
root_nodeGets the root node of the scene.
VERSIONGets the current release version

Methods

MethodDescription
remove_property(self, property)Removes a dynamic property.
remove_property(self, property)Remove the specified property identified by name
open(self, stream)Opens the scene from given stream
open(self, file_name, options)Opens the scene from given path using specified file format.
open(self, file_name)Opens the scene from given path
save(self, stream, format)Saves the scene to stream using specified file format.
save(self, stream, options)Saves the scene to stream using specified file format.
save(self, file_name)Saves the scene to specified path using specified file format.
save(self, file_name, format)Saves the scene to specified path using specified file format.
save(self, file_name, options)Saves the scene to specified path using specified file format.
render(self, camera, file_name)Render the scene into external file from given camera’s perspective.
The default output size is 1024x768 and output format is png
render(self, camera, file_name, size, format)Render the scene into external file from given camera’s perspective.
render(self, camera, file_name, size, format, options)Render the scene into external file from given camera’s perspective.
render(self, camera, bitmap)Render the scene into bitmap from given camera’s perspective.
render(self, camera, bitmap, options)Render the scene into bitmap from given camera’s perspective.
get_property(self, property)Get the value of specified property
set_property(self, property, value)Sets the value of specified property
find_property(self, property_name)Finds the property.
It can be a dynamic property (Created by CreateDynamicProperty/SetProperty)
or native property(Identified by its name)
get_animation_clip(self, name)Gets a named AnimationClip
clear(self)Clears the scene content and restores the default settings.
create_animation_clip(self, name)A shorthand function to create and register the AnimationClip
The first AnimationClip will be assigned to the Scene.current_animation_clip
from_file(, file_name)Opens the scene from given path

See Also