Scene

Enumerasi

Enumerations Scene kelas dalam Aspose.3D berfungsi sebagai kontainer akar untuk konten 3D, mengelola objek tingkat atas dan memungkinkan manajemen hubungan induk/anak untuk hierarki adegan. Ini menyediakan akses ke node akar dan sub‑adegan, membentuk titik masuk untuk memuat, membangun, dan menyimpan adegan 3D.

using Aspose.ThreeD;

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

// Access the root node
Node root = scene.RootNode;

Enumerasi

Enumerations Scene kelas dapat diinstansiasi tanpa argumen untuk membuat adegan kosong.

using Aspose.ThreeD;

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

// Set name via property
scene.Name = "myScene";

// Access the root node
Node root = scene.RootNode;

Enumerasi

NameTypeAccessDescription
SubScenesIList<Scene>ReadGets the sub scenes.
LibraryIList<A3DObject>ReadGets the library.
AnimationClipsIList<AnimationClip>ReadGets the animation clips.
CurrentAnimationClipAnimationClip?Read/WriteGets or sets the current animation clip.
AssetInfoAssetInfo?Read/WriteGets or sets the asset info.
PosesICollection<Pose>ReadGets the poses.
RootNodeNodeReadGets the root node.
SceneSceneReadGets the scene.
NamestringRead/WriteGets or sets the name.
PropertiesPropertyCollectionReadGets the properties.

Enumerasi

SignatureDescription
Scene()
Scene(entity: Entity)
Scene(parentScene: Scene, name: string)
GetAnimationClip(name: string)Gets a named AnimationClip
Clear()Clears the scene content and restores the default settings.
CreateAnimationClip(name: string)A shorthand function to create and register the The first AnimationClip will be assigned to the
Open(stream: Stream, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream)Opens the scene from given stream using specified file format.
Open(stream: Stream, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream, fileName: string)Opens the scene from given stream using specified file format.
Open(stream: Stream, fileName: string, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(stream: Stream, options: LoadOptions)Opens the scene from given stream using specified file format.
Open(fileName: string, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(fileName: string, options: LoadOptions)Opens the scene from given stream using specified file format.
Open(fileName: string, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
Open(fileName: string)Opens the scene from given stream using specified file format.
Open(fileName: string, format: FileFormat)Opens the scene from given stream using specified file format.
Open(fileName: string, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromStream(stream: Stream, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromStream(stream: Stream, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromStream(stream: Stream, cancellationToken: CancellationToken)Opens the scene from given stream using specified file format.
FromFile(fileName: string, format: FileFormat, cancellationToken: CancellationToken)Opens the scene from given path using specified file format.
FromFile(fileName: string, options: LoadOptions, cancellationToken: CancellationToken)Opens the scene from given path using specified file format.
FromFile(fileName: string)Opens the scene from given path using specified file format.
FromFile(fileName: string, cancellationToken: CancellationToken)Opens the scene from given path using specified file format.
Save(stream: Stream, format: FileFormat)Saves the scene to stream using specified file format.
Save(stream: Stream, format: FileFormat, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Save(stream: Stream, options: SaveOptions)Saves the scene to stream using specified file format.
Save(stream: Stream, options: SaveOptions, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Save(fileName: string, format: FileFormat, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Save(fileName: string)Saves the scene to stream using specified file format.
Save(fileName: string, format: FileFormat)Saves the scene to stream using specified file format.
Save(fileName: string, options: SaveOptions)Saves the scene to stream using specified file format.
Save(fileName: string, options: SaveOptions, cancellationToken: CancellationToken)Saves the scene to stream using specified file format.
Render(camera: Entities.Camera, fileName: string)Not implemented in the FOSS edition — throws at runtime. Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png
Render(camera: Entities.Camera, fileName: string, size: Vector2, format: string)Not implemented in the FOSS edition — throws at runtime. Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png
Render(camera: Entities.Camera, fileName: string, size: Vector2, format: string, options: ImageRenderOptions)Not implemented in the FOSS edition — throws at runtime. Render the scene into external file from given camera’s perspective. The default output size is 1024x768 and output format is png
Render(camera: Entities.Camera, bitmap: object)Not implemented in the FOSS edition — throws at runtime. \u003C/summary>
Render(camera: Entities.Camera, bitmap: object, options: ImageRenderOptions)Not implemented in the FOSS edition — throws at runtime. \u003C/summary>
SceneObject(name: string)
A3DObject()
RemoveProperty(property: Property)Removes a dynamic property.
GetProperty(property: string)Get the value of specified property
SetProperty(property: string, value: object?)Sets the value of specified property
FindProperty(propertyName: string)Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)

Enumerasi

Buat sebuah adegan, tambahkan node kotak, dan simpan ke GLB:

using Aspose.ThreeD;
using Aspose.ThreeD.Entities;
using Aspose.ThreeD.Formats;

// Create scene with a box primitive
var scene = new Scene();
var box = new Box(2, 2, 2);
var node = scene.RootNode.CreateChildNode("BoxNode", box);

// Save as GLB (format inferred from .glb extension)
scene.Save("box.glb");

Lihat Juga

 Bahasa Indonesia