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: Scene → SceneObject → A3DObject
The Scene type exposes the following members:
Constructors
Constructor | Description |
---|---|
Scene() | Initializes a new instance of the Scene class. |
Scene(entity) | Initializes a new instance of the Scene class with an entity attached to a new node. |
Scene(parent_scene, name) | Initializes a new instance of the Scene class as a sub-scene. |
Scene(file_name) | Initializes a new instance of the Scene class and open the file immediately.
This is an obsoleted constructor, please use Scene.from_file(file_name). |
Properties
Property | Description |
---|---|
name | Gets or sets the name. |
properties | Gets the collection of all properties. |
scene | Gets the scene that this object belongs to |
sub_scenes | Gets all sub-scenes |
library | Objects 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_clips | Gets all AnimationClip defined in the scene. |
current_animation_clip | Gets or sets the active AnimationClip |
asset_info | Gets or sets the top-level asset information |
poses | Gets all Pose used in this scene. |
root_node | Gets the root node of the scene. |
Methods
Method | Description |
---|---|
remove_property(property) | Removes a dynamic property. |
remove_property(property) | Remove the specified property identified by name |
open(stream) | Opens the scene from given stream |
open(file_name, options) | Opens the scene from given path using specified file format. |
open(file_name) | Opens the scene from given path |
save(stream, format) | Saves the scene to stream using specified file format. |
save(stream, options) | Saves the scene to stream using specified file format. |
save(file_name) | Saves the scene to specified path using specified file format. |
save(file_name, format) | Saves the scene to specified path using specified file format. |
save(file_name, options) | Saves the scene to specified path using specified file format. |
render(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(camera, file_name, size, format) | Render the scene into external file from given camera’s perspective. |
render(camera, file_name, size, format, options) | Render the scene into external file from given camera’s perspective. |
render(camera, bitmap) | Render the scene into bitmap from given camera’s perspective. |
render(camera, bitmap, options) | Render the scene into bitmap from given camera’s perspective. |
get_property(property) | Get the value of specified property |
set_property(property, value) | Sets the value of specified property |
find_property(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(name) | Gets a named AnimationClip |
clear() | Clears the scene content and restores the default settings. |
create_animation_clip(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
- module aspose.threed
- class A3DObject
- class AnimationClip
- class Pose
- class Scene
- class SceneObject