Load and Save Options

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

FbxSaveOptions

Totes les operacions d’importació i exportació accepten un objecte d’opcions opcional derivat de LoadOptions o SaveOptions. Passeu la subclasse apropiada a Scene.open() o Scene.save() per controlar el comportament específic del format.

FbxSaveOptions: com.aspose.threed

import com.aspose.threed.*;

LoadOptions

Classe base per a tots els objectes d’opcions de càrrega. Extends A3DObject.

FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
fileFormatFileFormatgetFileFormat()El format amb el qual està associada aquesta configuració (només lectura)

SaveOptions

Classe base per a tots els objectes d’opcions de desament. Extends A3DObject.

FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
fileFormatFileFormatgetFileFormat()El format amb el qual està associada aquesta configuració (només de lectura)

ObjLoadOptions

Opcions de càrrega per a fitxers 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)falseInverteix el sistema de coordenades en importar
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueCarrega l’adjunt .mtl fitxer de material
scaledoublegetScale()setScale(double)1.0Escala uniforme aplicada a tota la geometria importada
normalizeNormalbooleangetNormalizeNormal()setNormalizeNormal(boolean)trueNormalitza els vectors normals importats a una longitud unitària

ObjSaveOptions

Opcions de desament per a fitxers Wavefront OBJ.

import com.aspose.threed.*;

ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falseAplica el factor d’escala d’unitat de l’escena a les coordenades exportades
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseExporta només vèrtexs (sense cares de polígon)
verbosebooleangetVerbose()setVerbose(boolean)falseInclou comentaris addicionals d’OBJ a la sortida
serializeWbooleangetSerializeW()setSerializeW(boolean)falseEscriu el component W dels punts de control
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueEscriu un .mtl fitxer de material i fes-ne referència des del .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseInverteix el sistema de coordenades en l’exportació

GltfLoadOptions

Carrega opcions per a fitxers glTF 2.0 i 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)falseInverteix el sistema de coordenades en importar
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormata el JSON de sortida amb sagnat per a una millor llegibilitat

GltfSaveOptions

Opcions de desament per a la sortida glTF 2.0 i 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.ASCIIEstableix a FileContentType.BINARY per a generar un fitxer GLB autònom; estableix a FileContentType.ASCII per a JSON .gltf amb un buffer extern
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseInverteix el sistema de coordenades en exportar
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormata el JSON de sortida amb indentació per a una millor llegibilitat
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullPrefix per als noms de fitxers de buffer externs
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullDades extra personalitzades per incloure a la sortida glTF

StlLoadOptions

Carrega opcions per a fitxers 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)falseInverteix el sistema de coordenades en la importació
recalculateNormalbooleangetRecalculateNormal()setRecalculateNormal(boolean)falseRecalcula les normals a partir de la geometria en la importació
contentTypeFileContentTypegetContentType()setContentType(FileContentType)Suggeriment per a la detecció binària vs ASCII de STL

StlSaveOptions

Opcions de desament per a la sortida STL.

import com.aspose.threed.*;

StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);
FbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptionsFbxSaveOptions
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseInverteix el sistema de coordenades en l’exportació
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Sobreescriu el sistema d’eixos de destinació en l’exportació
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYEstableix a BINARY o ASCII per controlar el format de sortida

FbxLoadOptions

Carrega opcions per a fitxers 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)falseInverteix el sistema de coordenades en importar

FbxSaveOptions

Nota: L’exportació FBX és no disponible a l’edició Java FOSS. FBX només és compatible per a importació. El FbxSaveOptions classe existeix a l’API però produirà un error si s’utilitza per a desar. Utilitzeu OBJ, STL, glTF o GLB per a l’exportació.


Vegeu també

 Català