Scene
Overview
Scene is a class in Aspose.3D FOSS for Typescript.
Inherits from: SceneObject.
Scene.constructor creates an empty scene instance.
This class provides 11 methods for working with Scene objects in Typescript programs.
Available methods include: clear, constructor, createAnimationClip, fromFile, getAnimationClip, open, openFromBuffer, render, save, saveToBuffer, toString.
All public members are accessible to any Typescript application after installing the Aspose.3D FOSS for Typescript package.
Properties: VERSION, animationClips, assetInfo, currentAnimationClip, library, poses, and 2 more.
Description
Scene is a class in the Aspose.3D FOSS library for TypeScript that exposes 10 methods and 8 properties for programmatic use. It extends SceneObject, inheriting shared functionality from its parent type.
Core capabilities include: node; scene[]; customobject[]. These operations enable developers to integrate scene functionality directly into TypeScript applications.
The class also provides the VERSION property (gets the version), the rootNode property (gets the root node), the subScenes property (gets the sub scenes).
The class offers 4 constructor overloads, allowing flexible initialization depending on the calling context.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
VERSION | `` | Read | Gets the version. |
rootNode | Node | Read | Gets the root node. |
subScenes | Scene[] | Read | Gets the sub scenes. |
library | CustomObject[] | Read | Gets the library. |
assetInfo | AssetInfo | Read/Write | Gets the asset info. |
animationClips | AnimationClip[] | Read | Gets the animation clips. |
currentAnimationClip | AnimationClip | null | Read/Write | Gets the current animation clip. |
poses | any[] | Read | Gets the poses. |
Methods
| Signature | Description |
|---|---|
constructor() | Creates a scene containing the specified entity |
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 new animation clip with the given name |
getAnimationClip(name: string) → AnimationClip | null | Returns the animation clip with the specified name or null |
open(fileOrStream: any, options: any) | Loads scene data from a file path or stream using options |
openFromBuffer(buffer: Buffer | Uint8Array, options: any) | Loads scene data from a memory buffer with options |
save(fileOrStream: any, formatOrOptions: any, options: any) | Writes the scene to a file or stream |
saveToBuffer(format: string, _options: any) → Buffer | Returns a Buffer containing the scene in the given format |
render(_camera: any, _file_name_or_bitmap: any, _size: any, _format: any, _options: any) | Not implemented in the FOSS edition — throws at runtime. Renders the scene with the camera to an image |
fromFile(fileName: string) → Scene | Loads a scene from the specified file and returns the scene |
toString() → string |