Load and Save Options

Load and Save Options — Aspose.3D FOSS for Python API Reference

ColladaSaveOptions

すべてのインポートおよびエクスポート操作は、から派生したオプションオブジェクト(任意)を受け入れます LoadOptions または SaveOptions. 適切なサブクラスを に渡してください Scene.open() または Scene.save() フォーマット固有の動作を制御します。.

ColladaSaveOptions: aspose.threed.formats

from aspose.threed.formats import (
    LoadOptions, SaveOptions,
    ObjLoadOptions, ObjSaveOptions,
    GltfLoadOptions, GltfSaveOptions,
    StlLoadOptions, StlSaveOptions,
    FbxLoadOptions, FbxSaveOptions,
    ColladaLoadOptions, ColladaSaveOptions,
    ThreeMfLoadOptions, ThreeMfSaveOptions,
)

ColladaSaveOptions

ColladaSaveOptions LoadOptionsSaveOptions は から継承します IOConfig.。.

ColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
file_format`FileFormatNone`
encoding`strNone`
file_system`FileSystemNone`
lookup_pathslist[str]外部参照を解決する際に検索する追加ディレクトリ
file_name`strNone`

LoadOptions

ObjLoadOptions.

追加プロパティ(超えて IOConfig):

ColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
encoding`strNone`

SaveOptions

Properties.

追加プロパティ(超えて IOConfig):

ColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
export_texturesboolColladaSaveOptions True,、シーンで参照されているテクスチャが出力にコピーされます。デフォルトは False

ObjLoadOptions

Wavefront OBJ ファイルのロードオプション(.obj).

from aspose.threed.formats import ObjLoadOptions
opts = ObjLoadOptions()
opts.flip_coordinate_system = True
opts.scale = 0.01
scene = Scene()
scene.open("model.obj", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
flip_coordinate_systemboolFalseインポート時に座標系を反転する
enable_materialsboolTrue付随するものをロードする .mtl マテリアルファイル
scalefloat1.0インポートされたすべてのジオメトリに適用される一様スケール
normalize_normalboolTrueインポートされた法線ベクトルを単位長さに正規化する

ObjSaveOptions

Wavefront OBJ ファイル用の保存オプション。.

from aspose.threed.formats import ObjSaveOptions
opts = ObjSaveOptions()
opts.enable_materials = False
scene.save("output.obj", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
apply_unit_scaleboolFalseシーンの単位スケール係数をエクスポート座標に適用する
point_cloudboolFalse頂点のみをエクスポートする(ポリゴン面は含めない)
verboseboolFalse出力に追加のOBJコメントを含める
serialize_wboolFalse制御点のW成分を書き込む
enable_materialsboolTrue書き込む .mtl material file を書き出し、そこから参照する .obj
flip_coordinate_systemboolFalseエクスポート時に座標系を反転する
axis_system`AxisSystemNone`None

GltfLoadOptions

glTF 2.0 および GLB ファイルのロードオプション(.gltf, .glb).

from aspose.threed.formats import GltfLoadOptions
opts = GltfLoadOptions()
opts.flip_tex_coord_v = False
scene = Scene()
scene.open("model.gltf", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
flip_tex_coord_vboolTrueインポート時に V テクスチャ座標を反転する(glTF は左上原点を使用します;; True 左下に変換します)

GltfSaveOptions

glTF 2.0 出力の保存オプション。.

from aspose.threed.formats import GltfSaveOptions
opts = GltfSaveOptions()
opts.binary_mode = True   # produce a .glb file
scene.save("output.glb", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
binary_modeboolFalseColladaSaveOptions True, 自己完結型のバイナリGLBを書き込みます; when False, JSONを書き込みます .gltf 外部バッファを使用して
flip_tex_coord_vboolTrueエクスポート時にVテクスチャ座標を反転
export_texturesboolFalse参照されたテクスチャを出力パッケージにコピーします (inherited from SaveOptions)

StlLoadOptions

STLファイルのロードオプション (.stl).

from aspose.threed.formats import StlLoadOptions
opts = StlLoadOptions()
opts.scale = 0.001   # convert millimetres to metres
scene = Scene()
scene.open("part.stl", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
flip_coordinate_systemboolFalseインポート時に座標系を反転
scalefloat1.0インポートされたジオメトリに均一スケールを適用

StlSaveOptions

GltfSaveOptions.

from aspose.threed.formats import StlSaveOptions
opts = StlSaveOptions()
opts.binary_mode = True
scene.save("output.stl", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
flip_coordinate_systemboolFalseエクスポート時に座標系を反転
scalefloat1.0エクスポートされたジオメトリに均一スケールを適用
binary_modeboolFalseASCII STL の代わりにバイナリ STL を書き込む

FbxLoadOptions

FBX ファイルのロードオプション (.fbx).

from aspose.threed.formats import FbxLoadOptions
opts = FbxLoadOptions()
opts.keep_builtin_global_settings = True
scene = Scene()
scene.open("animation.fbx", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
keep_builtin_global_settingsboolFalseFBX を保持 GlobalSettings シーンアセット情報内のプロパティ
compatible_modeboolFalse古いオーサリングツールからの FBX ファイル用に互換モードを有効にする

FbxSaveOptions

シーンをバイナリ GLB としてエクスポートし、UV 座標をそのまま保持します。.

from aspose.threed.formats import FbxSaveOptions
opts = FbxSaveOptions()
opts.enable_compression = False
scene.save("output.fbx", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
export_texturesboolFalse参照されているテクスチャを出力ディレクトリにコピーする
reuse_primitive_meshboolFalse出力内の同一メッシュジオメトリの重複を除去する
enable_compressionboolTrueバイナリ FBX の内部圧縮を有効にする
fold_repeated_curve_dataColladaSaveOptionsNone同一のアニメーションカーブセグメントを折りたたむ
export_legacy_material_propertiesboolTrueレガシーを含める Phong/Lambert 互換性のためのマテリアルプロパティノード
video_for_textureboolFalseFBX ビデオノードにテクスチャ データを埋め込む
embed_texturesboolFalseFBX バイナリ内にテクスチャ ファイルをインラインで埋め込む
generate_vertex_element_materialboolFalse追加 VertexElementMaterial ポリゴンごとのマテリアル割り当て用レイヤー

ColladaLoadOptions

COLLADA ファイルのロードオプション(.dae).

from aspose.threed.formats import ColladaLoadOptions
opts = ColladaLoadOptions()
opts.scale = 0.01
scene = Scene()
scene.open("model.dae", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
flip_coordinate_systemboolFalseインポート時に座標系を反転する
enable_materialsboolTrueCOLLADA マテリアル定義をインポートする
scalefloat1.0インポートされたジオメトリに均一スケールを適用する
normalize_normalboolTrueインポートされた法線ベクトルを正規化する

ColladaSaveOptions

COLLADA 出力の保存オプション。.

from aspose.threed.formats import ColladaSaveOptions
opts = ColladaSaveOptions()
opts.indented = False   # compact output
scene.save("output.dae", opts)
ColladaSaveOptionsColladaSaveOptionsColladaSaveOptionsColladaSaveOptions
flip_coordinate_systemboolFalseエクスポート時に座標系を反転する
enable_materialsboolTrueCOLLADA マテリアル定義を書き込む
indentedboolTrueXML出力をインデント付きで整形表示する

ThreeMfLoadOptions / ThreeMfSaveOptions

3MFファイルのロードおよび保存オプション (.3mf).

from aspose.threed.formats import ThreeMfLoadOptions, ThreeMfSaveOptions

# Load
load_opts = ThreeMfLoadOptions()
scene = Scene()
scene.open("part.3mf", load_opts)

# Save
save_opts = ThreeMfSaveOptions()
scene.save("output.3mf", save_opts)

これらのクラスは基底プロパティを継承します LoadOptions / SaveOptions それぞれ。現在のFOSSリリースでは、追加のフォーマット固有プロパティは文書化されていません。.


参照

 日本語