Load and Save Options

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

FbxSaveOptions

Alle import- og eksportoperationer accepterer et valgfrit options-objekt afledt fra LoadOptions eller SaveOptions. Videregiv den passende underklasse til Scene.open() eller Scene.save() for at kontrollere format‑specifik adfærd.

FbxSaveOptions: com.aspose.threed

import com.aspose.threed.*;

LoadOptions

Basisklasse for alle load-option-objekter. Udvider A3DObject.

FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
fileFormatFileFormatgetFileFormat()Formatet, som denne konfiguration er knyttet til (kun læsning)

SaveOptions

Basisklasse for alle save-option-objekter. Udvider A3DObject.

FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
fileFormatFileFormatgetFileFormat()Formatet, som denne konfiguration er knyttet til (skrivebeskyttet)

ObjLoadOptions

Indlæsningsindstillinger for Wavefront OBJ-filer (.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)falseVend koordinatsystemet ved import
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueIndlæs den tilhørende .mtl materialfil
scaledoublegetScale()setScale(double)1.0Ensartet skalering anvendt på al importeret geometri
normalizeNormalbooleangetNormalizeNormal()setNormalizeNormal(boolean)trueNormaliser importerede normalvektorer til enhedslængde

ObjSaveOptions

Gem‑indstillinger for Wavefront OBJ‑filer.

import com.aspose.threed.*;

ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falseAnvend scenens enhedsskalafaktor på eksporterede koordinater
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseEksporter kun vertices (ingen polygonflader)
verbosebooleangetVerbose()setVerbose(boolean)falseInkluder yderligere OBJ-kommentarer i outputtet
serializeWbooleangetSerializeW()setSerializeW(boolean)falseSkriv W-komponenten af kontrolpunkterne
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueSkriv en .mtl materialfil og referer til den fra the .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseVend koordinatsystemet ved eksport

GltfLoadOptions

Indlæsningsindstillinger for glTF 2.0- og GLB-filer (.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)falseVend koordinatsystemet ved import
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormater output-JSON med indrykning for læsbarhed

GltfSaveOptions

Gem indstillinger for glTF 2.0 og GLB-output.

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.ASCIIIndstil til FileContentType.BINARY for at producere en selvstændig GLB-fil; indstil til FileContentType.ASCII for JSON .gltf med en ekstern buffer
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseVend koordinatsystemet ved eksport
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormater output-JSON’en med indrykning for læsbarhed
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullPræfiks for eksterne bufferfilnavne
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullTilpassede ekstra data, der skal inkluderes i glTF-outputtet

StlLoadOptions

Indlæsningsindstillinger for STL-filer (.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)falseVend koordinatsystemet ved import
recalculateNormalbooleangetRecalculateNormal()setRecalculateNormal(boolean)falseGenberegn normaler fra geometri ved import
contentTypeFileContentTypegetContentType()setContentType(FileContentType)Hint til binær vs ASCII STL-detektion

StlSaveOptions

Gem indstillinger for STL-output.

import com.aspose.threed.*;

StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseVend koordinatsystemet ved eksport
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Tilsidesæt målakse-systemet ved eksport
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYIndstil til BINARY eller ASCII for at kontrollere outputformatet

FbxLoadOptions

Indlæs indstillinger for FBX-filer (.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)falseVend koordinatsystemet ved import

FbxSaveOptions

Bemærk: FBX-eksport er ikke tilgængelig i Java FOSS-udgaven. FBX understøttes kun til import. Den FbxSaveOptions Klassen findes i API’et, men vil give en fejl, hvis den bruges til at gemme. Brug i stedet OBJ, STL, glTF eller GLB til eksport.


Se også

 Dansk