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.
| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | 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.
| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix el sistema de coordenades en importar |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Carrega l’adjunt .mtl fitxer de material |
scale | double | getScale() | setScale(double) | 1.0 | Escala uniforme aplicada a tota la geometria importada |
normalizeNormal | boolean | getNormalizeNormal() | setNormalizeNormal(boolean) | true | Normalitza 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
applyUnitScale | boolean | getApplyUnitScale() | setApplyUnitScale(boolean) | false | Aplica el factor d’escala d’unitat de l’escena a les coordenades exportades |
pointCloud | boolean | getPointCloud() | setPointCloud(boolean) | false | Exporta només vèrtexs (sense cares de polígon) |
verbose | boolean | getVerbose() | setVerbose(boolean) | false | Inclou comentaris addicionals d’OBJ a la sortida |
serializeW | boolean | getSerializeW() | setSerializeW(boolean) | false | Escriu el component W dels punts de control |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Escriu un .mtl fitxer de material i fes-ne referència des del .obj |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix el sistema de coordenades en importar |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Formata 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.ASCII | Estableix a FileContentType.BINARY per a generar un fitxer GLB autònom; estableix a FileContentType.ASCII per a JSON .gltf amb un buffer extern |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix el sistema de coordenades en exportar |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Formata el JSON de sortida amb indentació per a una millor llegibilitat |
bufferFilePrefix | String | getBufferFilePrefix() | setBufferFilePrefix(String) | null | Prefix per als noms de fitxers de buffer externs |
saveExtras | String | getSaveExtras() | setSaveExtras(String) | null | Dades 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix el sistema de coordenades en la importació |
recalculateNormal | boolean | getRecalculateNormal() | setRecalculateNormal(boolean) | false | Recalcula les normals a partir de la geometria en la importació |
contentType | FileContentType | getContentType() | 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix el sistema de coordenades en l’exportació |
axisSystem | AxisSystem | getAxisSystem() | setAxisSystem(AxisSystem) | – | Sobreescriu el sistema d’eixos de destinació en l’exportació |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.BINARY | Estableix 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);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inverteix 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ó.