Load and Save Options

Load and Save Options — Aspose.3D FOSS for Java

FbxSaveOptions

Semua operasi impor dan ekspor menerima objek opsi opsional yang diturunkan dari LoadOptions atau SaveOptions. Kirim subclass yang sesuai ke Scene.open() atau Scene.save() untuk mengontrol perilaku khusus format.

FbxSaveOptions: com.aspose.threed

import com.aspose.threed.*;

LoadOptions

Kelas dasar untuk semua objek load-option. Memperluas A3DObject.

FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
fileFormatFileFormatgetFileFormat()Format yang dikaitkan dengan konfigurasi ini (hanya-baca)

SaveOptions

Kelas dasar untuk semua objek save-option. Memperluas A3DObject.

FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
fileFormatFileFormatgetFileFormat()Format yang dikaitkan dengan konfigurasi ini (hanya-baca)

ObjLoadOptions

Opsi muat untuk file Wavefront OBJ (.obj).

import com.aspose.threed.*;

ObjLoadOptions opts = new ObjLoadOptions();
opts.setFlipCoordinateSystem(true);
opts.setScale(0.01);
Scene scene = new Scene();
scene.open("model.obj", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat impor
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueMuat yang menyertai .mtl file material
scaledoublegetScale()setScale(double)1.0Skala seragam yang diterapkan pada semua geometri yang diimpor
normalizeNormalbooleangetNormalizeNormal()setNormalizeNormal(boolean)trueNormalisasi vektor normal yang diimpor ke panjang satu

ObjSaveOptions

Opsi simpan untuk file Wavefront OBJ.

import com.aspose.threed.*;

ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falseTerapkan faktor skala unit adegan ke koordinat yang diekspor
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseEkspor hanya vertex (tanpa wajah poligon)
verbosebooleangetVerbose()setVerbose(boolean)falseSertakan komentar OBJ tambahan dalam output
serializeWbooleangetSerializeW()setSerializeW(boolean)falseTuliskan komponen W dari titik kontrol
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueTuliskan sebuah .mtl file material dan referensikan dari the .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat mengekspor

GltfLoadOptions

Muat opsi untuk file glTF 2.0 dan GLB (.gltf, .glb).

import com.aspose.threed.*;

GltfLoadOptions opts = new GltfLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("model.gltf", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat mengimpor
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormat output JSON dengan indentasi untuk keterbacaan

GltfSaveOptions

Opsi simpan untuk output glTF 2.0 dan GLB.

import com.aspose.threed.*;
import com.aspose.threed.FileContentType;

// Save as glTF JSON
GltfSaveOptions opts = new GltfSaveOptions();
scene.save("output.gltf", opts);

// Save as GLB (binary glTF)
GltfSaveOptions glbOpts = new GltfSaveOptions();
glbOpts.setContentType(FileContentType.BINARY);
scene.save("output.glb", glbOpts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.ASCIIAtur ke FileContentType.BINARY untuk menghasilkan file GLB yang berdiri sendiri; atur ke FileContentType.ASCII untuk JSON .gltf dengan buffer eksternal
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat mengekspor
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormat output JSON dengan indentasi untuk keterbacaan
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullAwalan untuk nama file buffer eksternal
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullData ekstra khusus untuk disertakan dalam output glTF

StlLoadOptions

Opsi pemuatan untuk file STL (.stl).

import com.aspose.threed.*;

StlLoadOptions opts = new StlLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("part.stl", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat impor
recalculateNormalbooleangetRecalculateNormal()setRecalculateNormal(boolean)falseHitung ulang normal dari geometri saat impor
contentTypeFileContentTypegetContentType()setContentType(FileContentType)Petunjuk untuk deteksi STL biner vs ASCII

StlSaveOptions

Simpan opsi untuk output STL.

import com.aspose.threed.*;

StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat ekspor
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Timpa sistem sumbu target saat ekspor
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYAtur ke BINARY atau ASCII untuk mengontrol format output

FbxLoadOptions

Muat opsi untuk file FBX (.fbx).

import com.aspose.threed.*;

FbxLoadOptions opts = new FbxLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("animation.fbx", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseBalikkan sistem koordinat saat impor

FbxSaveOptions

Catatan: Ekspor FBX adalah tidak tersedia di edisi FOSS Java. FBX hanya didukung untuk impor. The FbxSaveOptions kelas ada dalam API tetapi akan menghasilkan error jika digunakan untuk menyimpan. Gunakan OBJ, STL, glTF, atau GLB untuk ekspor sebagai gantinya.


Lihat Juga

 Bahasa Indonesia