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
initInitializes a new instance of the Scene class.
initInitializes a new instance of the Scene class with an entity attached to a new node.
initInitializes a new instance of the Scene class as a sub-scene.
initInitializes a new instance of the Scene class and open the file immediately.
This is an obsoleted constructor, please use Scene.from_file.

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.

Methods

MethodDescription
remove_propertyRemoves a dynamic property.
remove_propertyRemove the specified property identified by name
openOpens the scene from given stream
openOpens the scene from given path using specified file format.
openOpens the scene from given path
saveSaves the scene to stream using specified file format.
saveSaves the scene to stream using specified file format.
saveSaves the scene to specified path using specified file format.
saveSaves the scene to specified path using specified file format.
saveSaves the scene to specified path using specified file format.
renderRender the scene into external file from given camera’s perspective.
The default output size is 1024x768 and output format is png
renderRender the scene into external file from given camera’s perspective.
renderRender the scene into external file from given camera’s perspective.
renderRender the scene into bitmap from given camera’s perspective.
renderRender the scene into bitmap from given camera’s perspective.
get_propertyGet the value of specified property
set_propertySets the value of specified property
find_propertyFinds the property.
It can be a dynamic property (Created by CreateDynamicProperty/SetProperty)
or native property(Identified by its name)
get_animation_clipGets a named AnimationClip
clearClears the scene content and restores the default settings.
create_animation_clipA shorthand function to create and register the AnimationClip
The first AnimationClip will be assigned to the Scene.current_animation_clip
from_fileOpens the scene from given path

See Also