Scene — Aspose.3D FOSS for .NET
Example
Example Scene Aspose.3D のクラスは 3D コンテンツのルートコンテナとして機能し、トップレベルオブジェクトを管理し、シーン階層の親子関係管理を可能にします。ルートノードとサブシーンへのアクセスを提供し、3D シーンのロード、構築、保存のエントリーポイントを形成します。.
using Aspose.ThreeD;
// Create an empty scene
var scene = new Scene();
// Access the root node
Node root = scene.RootNode;Example
Example Scene クラスは引数なしでインスタンス化でき、空のシーンを作成します。.
using Aspose.ThreeD;
// Empty scene
var scene = new Scene();
// Set name via property
scene.Name = "myScene";
// Access the root node
Node root = scene.RootNode;Example
| Example | Example | Example | Example |
|---|---|---|---|
RootNode | Node | 取得 | シーン階層のルートノード |
AssetInfo | AssetInfo | 取得/設定 | 作者、作成日、単位などのアセットメタデータ |
AnimationClips | List<AnimationClip> | 取得 | シーンで定義されたアニメーションクリップ |
CurrentAnimationClip | AnimationClip | 取得/設定 | 現在アクティブなアニメーションクリップ |
Library | IList<A3DObject> | 取得 | シーンに添付されたユーザー定義メタデータオブジェクト |
Name | string | 取得/設定 | シーンオブジェクトの名前 |
Properties | PropertyCollection | 取得 | シーンに添付されたカスタムプロパティ |
Example
| Example | 戻り値の型 | Example |
|---|---|---|
Open(string filePath) | void | このシーンにファイルを開きます。拡張子から形式を推測します |
Open(string filePath, LoadOptions options) | void | 形式固有のロードオプションでファイルを開きます |
Open(Stream stream) | void | ストリームから自動検出で開きます |
Open(Stream stream, LoadOptions options) | void | ストリームから形式固有のロードオプションで開きます |
Open(Stream stream, string fileName) | void | ストリームから、ファイル名を使用して形式を検出しながら開きます |
Save(string filePath) | void | シーンをファイルに保存します;拡張子から形式を推測 |
Save(string filePath, FileFormat format) | void | シーンを指定された形式で保存します FileFormat |
Save(string filePath, SaveOptions options) | void | 形式固有の保存オプションを使用して保存します |
Save(Stream stream, SaveOptions options) | void | 形式固有の保存オプションを使用してストリームに保存します |
CreateAnimationClip(string name) | AnimationClip | 新しい名前付きアニメーションクリップを作成します |
GetAnimationClip(string name) | AnimationClip | 名前で既存のアニメーションクリップを検索し、または null 見つからない場合 |
Clear() | void | シーンのすべてのコンテンツをクリアします |
Example
シーンを作成し、ボックスノードを追加して、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");