Scene

Enumerations

Enumerations Scene class i Aspose.3D fungerer som rotbeholder for 3D‑innhold, håndterer objekter på toppnivå og muliggjør administrasjon av forelder/barn‑relasjoner for scenehierarkiet. Den gir tilgang til rotnoder og under‑scener, og utgjør inngangspunktet for lasting, bygging og lagring av 3D‑scener.

import com.aspose.threed.Scene;

// Create an empty scene
Scene scene = new Scene();

// Access the root node via getter method
Node root = scene.getRootNode();

Enumerations

Enumerations Scene class kan instansieres uten argumenter for å lage en tom scene, eller med valgfrie parametere.

NameTypeAccessDescription
rootNodeNodeReadGets the root node.
assetInfoAssetInfoReadGets the asset info.
subScenesList<Scene>ReadGets the sub scenes.
libraryList<A3DObject>ReadGets the library.
animationClipsList<AnimationClip>ReadGets the animation clips.
currentAnimationClipAnimationClipReadGets the current animation clip.
posesCollection<Pose>ReadGets the poses.
VERSIONStringReadGets the version.
sceneSceneReadGets the scene.
nameStringReadGets the name.
propertiesPropertyCollectionReadGets the properties.

// Empty scene Scene scene = new Scene();

// Scene with an initial entity Scene scene = new Scene(new Mesh());

// Access the root node (getter method) Node root = scene.getRootNode();


## Klassemetoder

| Signature                                                                                               | Description                                                                                                                    |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `Scene()`                                                                                               | Calls Scene on this Scene instance.                                                                                            |
| `Scene(entity: Entity)`                                                                                 | Calls Scene(entity) on this Scene instance.                                                                                    |
| `Scene(scene: Scene, name: String)`                                                                     | Calls Scene(scene, name) on this Scene instance.                                                                               |
| `getRootNode()`  →  `Node`                                                                              | Returns the root node.                                                                                                         |
| `getAssetInfo()`  →  `AssetInfo`                                                                        | Returns the asset info.                                                                                                        |
| `setAssetInfo(value: AssetInfo)`                                                                        | Sets the asset info value.                                                                                                     |
| `getSubScenes()`  →  `List<Scene>`                                                                      | Returns the sub scenes.                                                                                                        |
| `getLibrary()`  →  `List<A3DObject>`                                                                    | Returns the library.                                                                                                           |
| `getAnimationClips()`  →  `List<AnimationClip>`                                                         | Returns the animation clips.                                                                                                   |
| `getCurrentAnimationClip()`  →  `AnimationClip`                                                         | Returns the current animation clip.                                                                                            |
| `setCurrentAnimationClip(value: AnimationClip)`                                                         | Sets the current animation clip value.                                                                                         |
| `getAnimationClip(name: String)`  →  `AnimationClip`                                                    | Calls getAnimationClip(name) on this Scene instance.                                                                           |
| `createAnimationClip(name: String)`  →  `AnimationClip`                                                 | Calls createAnimationClip(name) on this Scene instance.                                                                        |
| `getPoses()`  →  `Collection<Pose>`                                                                     | Returns the poses.                                                                                                             |
| `clear()`                                                                                               | Calls clear on this Scene instance.                                                                                            |
| `open(filePath: String)`                                                                                | Calls open(filePath) on this Scene instance.                                                                                   |
| `open(filePath: String, cancellationToken: Cancellation)`                                               | Calls open(filePath, cancellationToken) on this Scene instance.                                                                |
| `open(filePath: String, format: FileFormat)`                                                            | Calls open(filePath, format) on this Scene instance.                                                                           |
| `open(filePath: String, format: FileFormat, cancellationToken: Cancellation)`                           | Calls open(filePath, format, cancellationToken) on this Scene instance.                                                        |
| `open(filePath: String, options: LoadOptions)`                                                          | Calls open(filePath, options) on this Scene instance.                                                                          |
| `open(filePath: String, options: LoadOptions, cancellationToken: Cancellation)`                         | Calls open(filePath, options, cancellationToken) on this Scene instance.                                                       |
| `open(stream: InputStream)`                                                                             | Calls open(stream) on this Scene instance.                                                                                     |
| `open(stream: InputStream, cancellationToken: Cancellation)`                                            | Calls open(stream, cancellationToken) on this Scene instance.                                                                  |
| `open(stream: InputStream, format: FileFormat)`                                                         | Calls open(stream, format) on this Scene instance.                                                                             |
| `open(stream: InputStream, format: FileFormat, cancellationToken: Cancellation)`                        | Calls open(stream, format, cancellationToken) on this Scene instance.                                                          |
| `open(stream: InputStream, options: LoadOptions)`                                                       | Calls open(stream, options) on this Scene instance.                                                                            |
| `open(stream: InputStream, options: LoadOptions, cancellationToken: Cancellation)`                      | Calls open(stream, options, cancellationToken) on this Scene instance.                                                         |
| `open(stream: Stream, format: FileFormat, options: LoadOptions)`                                        | Calls open(stream, format, options) on this Scene instance.                                                                    |
| `open(stream: Stream, format: FileFormat, options: LoadOptions, cancellationToken: Cancellation)`       | Calls open(stream, format, options, cancellationToken) on this Scene instance.                                                 |
| `open(stream: Stream)`                                                                                  | Calls open(stream) on this Scene instance.                                                                                     |
| `open(stream: Stream, cancellationToken: Cancellation)`                                                 | Calls open(stream, cancellationToken) on this Scene instance.                                                                  |
| `open(stream: Stream, format: FileFormat)`                                                              | Calls open(stream, format) on this Scene instance.                                                                             |
| `open(stream: Stream, format: FileFormat, cancellationToken: Cancellation)`                             | Calls open(stream, format, cancellationToken) on this Scene instance.                                                          |
| `open(stream: Stream, options: LoadOptions)`                                                            | Calls open(stream, options) on this Scene instance.                                                                            |
| `open(stream: Stream, options: LoadOptions, cancellationToken: Cancellation)`                           | Calls open(stream, options, cancellationToken) on this Scene instance.                                                         |
| `fromFile(filePath: String)`  →  `Scene`                                                                | Calls fromFile(filePath) on this Scene instance.                                                                               |
| `fromFile(filePath: String, cancellationToken: Cancellation)`  →  `Scene`                               | Calls fromFile(filePath, cancellationToken) on this Scene instance.                                                            |
| `fromFile(filePath: String, format: FileFormat)`  →  `Scene`                                            | Calls fromFile(filePath, format) on this Scene instance.                                                                       |
| `fromFile(filePath: String, format: FileFormat, cancellationToken: Cancellation)`  →  `Scene`           | Calls fromFile(filePath, format, cancellationToken) on this Scene instance.                                                    |
| `fromFile(filePath: String, options: LoadOptions)`  →  `Scene`                                          | Calls fromFile(filePath, options) on this Scene instance.                                                                      |
| `fromFile(filePath: String, options: LoadOptions, cancellationToken: Cancellation)`  →  `Scene`         | Calls fromFile(filePath, options, cancellationToken) on this Scene instance.                                                   |
| `fromStream(stream: InputStream)`  →  `Scene`                                                           | Calls fromStream(stream) on this Scene instance.                                                                               |
| `fromStream(stream: InputStream, cancellationToken: Cancellation)`  →  `Scene`                          | Calls fromStream(stream, cancellationToken) on this Scene instance.                                                            |
| `fromStream(stream: InputStream, format: FileFormat)`  →  `Scene`                                       | Calls fromStream(stream, format) on this Scene instance.                                                                       |
| `fromStream(stream: InputStream, format: FileFormat, cancellationToken: Cancellation)`  →  `Scene`      | Calls fromStream(stream, format, cancellationToken) on this Scene instance.                                                    |
| `fromStream(stream: InputStream, options: LoadOptions)`  →  `Scene`                                     | Calls fromStream(stream, options) on this Scene instance.                                                                      |
| `fromStream(stream: InputStream, options: LoadOptions, cancellationToken: Cancellation)`  →  `Scene`    | Calls fromStream(stream, options, cancellationToken) on this Scene instance.                                                   |
| `fromStream(stream: Stream)`  →  `Scene`                                                                | Calls fromStream(stream) on this Scene instance.                                                                               |
| `fromStream(stream: Stream, cancellationToken: Cancellation)`  →  `Scene`                               | Calls fromStream(stream, cancellationToken) on this Scene instance.                                                            |
| `fromStream(stream: Stream, format: FileFormat)`  →  `Scene`                                            | Calls fromStream(stream, format) on this Scene instance.                                                                       |
| `fromStream(stream: Stream, format: FileFormat, cancellationToken: Cancellation)`  →  `Scene`           | Calls fromStream(stream, format, cancellationToken) on this Scene instance.                                                    |
| `fromStream(stream: Stream, options: LoadOptions)`  →  `Scene`                                          | Calls fromStream(stream, options) on this Scene instance.                                                                      |
| `fromStream(stream: Stream, options: LoadOptions, cancellationToken: Cancellation)`  →  `Scene`         | Calls fromStream(stream, options, cancellationToken) on this Scene instance.                                                   |
| `save(filePath: String)`                                                                                | Calls save(filePath) on this Scene instance.                                                                                   |
| `save(filePath: String, format: FileFormat)`                                                            | Calls save(filePath, format) on this Scene instance.                                                                           |
| `save(filePath: String, format: FileFormat, cancellationToken: Cancellation)`                           | Calls save(filePath, format, cancellationToken) on this Scene instance.                                                        |
| `save(filePath: String, options: SaveOptions)`                                                          | Calls save(filePath, options) on this Scene instance.                                                                          |
| `save(filePath: String, options: SaveOptions, cancellationToken: Cancellation)`                         | Calls save(filePath, options, cancellationToken) on this Scene instance.                                                       |
| `save(stream: OutputStream, format: FileFormat)`                                                        | Calls save(stream, format) on this Scene instance.                                                                             |
| `save(stream: OutputStream, format: FileFormat, cancellationToken: Cancellation)`                       | Calls save(stream, format, cancellationToken) on this Scene instance.                                                          |
| `save(stream: OutputStream, options: SaveOptions)`                                                      | Calls save(stream, options) on this Scene instance.                                                                            |
| `save(stream: OutputStream, options: SaveOptions, cancellationToken: Cancellation)`                     | Calls save(stream, options, cancellationToken) on this Scene instance.                                                         |
| `save(stream: OutputStream, format: FileFormat, options: SaveOptions)`                                  | Calls save(stream, format, options) on this Scene instance.                                                                    |
| `save(stream: OutputStream, format: FileFormat, options: SaveOptions, cancellationToken: Cancellation)` | Calls save(stream, format, options, cancellationToken) on this Scene instance.                                                 |
| `save(stream: Stream, format: FileFormat)`                                                              | Calls save(stream, format) on this Scene instance.                                                                             |
| `save(stream: Stream, format: FileFormat, cancellationToken: Cancellation)`                             | Calls save(stream, format, cancellationToken) on this Scene instance.                                                          |
| `save(stream: Stream, options: SaveOptions)`                                                            | Calls save(stream, options) on this Scene instance.                                                                            |
| `save(stream: Stream, options: SaveOptions, cancellationToken: Cancellation)`                           | Calls save(stream, options, cancellationToken) on this Scene instance.                                                         |
| `render(camera: Camera, fileName: String)`                                                              | Not implemented in the FOSS edition — throws at runtime.  Calls render(camera, fileName) on this Scene instance.               |
| `render(camera: Camera, fileName: String, size: Vector2, format: String)`                               | Not implemented in the FOSS edition — throws at runtime.  Calls render(camera, fileName, size, format) on this Scene instance. |
| `render(camera: Camera, texture: TextureData)`                                                          | Not implemented in the FOSS edition — throws at runtime.  Calls render(camera, texture) on this Scene instance.                |
| `SceneObject()`                                                                                         | Boolean operator allows you to apply Boolean operation on two IMeshConvertible instances.                                      |
| `getScene()`  →  `Scene`                                                                                | Constructor of BooleanOperator.                                                                                                |
| `A3DObject()`                                                                                           | Parameterized Cylinder. It can also be used to represent a cone when one of radiusTop/radiusBottom is zero.                    |
| `getName()`  →  `String`                                                                                | The segments of the curve.                                                                                                     |
| `setName(name: String)`                                                                                 | Constructs a CircleShape profile with specified radius.                                                                        |
| `getProperties()`  →  `PropertyCollection`                                                              | Initializes a new instance of Cylinder class.                                                                                  |
| `findProperty(name: String)`  →  `Property`                                                             | Initializes a new instance of the Bone class.                                                                                  |
| `getProperty(name: String)`  →  `Object`                                                                | Gets the transform matrix of the node in current pose.                                                                         |
| `setProperty(name: String, value: Object)`                                                              | Gets the width segments.                                                                                                       |
| `removeProperty(name: String)`  →  `boolean`                                                            | Gets flip coordinate system of control points/normal during importing/exporting.                                               |




// Load from file (format detected from extension)
Scene scene = Scene.fromFile("model.obj");

// Load with options
ObjLoadOptions opts = new ObjLoadOptions();
Scene scene = Scene.fromFile("model.obj", opts);

Enumerations

Alle egenskaper nås via getter/setter‑metoder.

Enumerations

Enumerations

Opprett en scene, legg til en mesh-node, og lagre til GLB:

import com.aspose.threed.Scene;
import com.aspose.threed.FileFormat;



// Create scene and mesh
Scene scene = new Scene();
Mesh mesh = new Mesh();
mesh.getControlPoints().add(new Vector4(0, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(1, 0, 0, 1));
mesh.getControlPoints().add(new Vector4(0.5, 1, 0, 1));
mesh.createPolygon(0, 1, 2);

// Add node to root
Node node = scene.getRootNode().createChildNode("triangle", mesh);

// Save as GLB
GltfSaveOptions glbOpts = new GltfSaveOptions();
glbOpts.setContentType(FileContentType.BINARY);
scene.save("triangle.glb", glbOpts);

Se også

 Norsk