Scene
Overview
Scene is a class in Aspose.3d for Typescript.
Inherits from: Scene, SceneObject.
Scene management features include creating a Scene, adding Node objects, and attaching Entity (e.g., Mesh) instances to nodes.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
VERSION | `` | Read | Holds the library version string for the Scene class |
rootNode | Node | Read | Is the top‑level Node that contains all child nodes of the scene |
subScenes | Scene[] | Read | Is an array of child Scene objects representing nested scenes |
library | CustomObject[] | Read | Stores custom objects associated with the scene |
assetInfo | AssetInfo | Read | Provides metadata about the assets contained in the scene |
animationClips | AnimationClip[] | Read | Is a collection of all AnimationClip objects in the scene |
currentAnimationClip | AnimationClip | null | Read | References the AnimationClip currently active or null |
poses | any[] | Read | Holds an array of pose data applied to the scene |
Methods
| Signature | Description |
|---|---|
constructor() | Creates a sub‑scene of the specified parent with the provided name |
constructor(entity: Entity) | |
constructor(parentScene: Scene, name: string) | |
constructor() | |
clear() | Removes all nodes, assets and animation data from the scene |
createAnimationClip(name: string) → AnimationClip | creates a newAnimationClip` that can be added to the scene’s animation collection |
getAnimationClip(name: string) → AnimationClip | null | Returns the AnimationClip matching the name or null if not found |
open(fileOrStream: any, options: any) | ` loads a 3D file (e.g., OBJ, STL, 3MF) into the scene using the provided load options |
openFromBuffer(buffer: Buffer | Uint8Array, options: any) | Loads a scene from a memory buffer with the given options |
save(fileOrStream: any, formatOrOptions: any, options: any) | Writes the scene to a file or stream using format or options and additional settings |
saveToBuffer(format: string, _options: any) → Buffer | Returns a Buffer containing the scene serialized in the specified format |
render(_camera: any, _file_name_or_bitmap: any, _size: any, _format: any, _options: any) | Renders the scene from the camera to a file, bitmap, or other target with size, format and options |
fromFile(fileName: string) → Scene | Creates and returns a new Scene loaded from the specified file |
_propagateScene() | |
toString() → string |