Load and Save Options — Aspose.3D FOSS for Java
FbxSaveOptions
Kaikki tuonti- ja vientitoiminnot hyväksyvät valinnaisen options-objektin, joka on johdettu LoadOptions tai SaveOptions. Välitä sopiva aliluokka Scene.open() tai Scene.save() ohjaamaan formaattiin liittyvää käyttäytymistä.
FbxSaveOptions: com.aspose.threed
import com.aspose.threed.*;LoadOptions
Perusluokka kaikille load-option-objekteille. Laajentaa A3DObject.
| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | Formaatti, johon tämä config liittyy (vain luku) |
SaveOptions
Perusluokka kaikille save-option-objekteille. Laajentaa A3DObject.
| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | Tämä konfiguraatio liittyy formaattiin (vain luku) |
ObjLoadOptions
Lataa asetukset Wavefront OBJ -tiedostoille (.obj).
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` | Käännä koordinaatisto tuonnissa |
| `enableMaterials` | `boolean` | `getEnableMaterials()` | `setEnableMaterials(boolean)` | `true` | Lataa mukana oleva `.mtl` materiaalitiedosto |
| `scale` | `double` | `getScale()` | `setScale(double)` | `1.0` | Yhtenäinen skaalaus, joka kohdistetaan kaikkiin tuotuun geometriaan |
| `normalizeNormal` | `boolean` | `getNormalizeNormal()` | `setNormalizeNormal(boolean)` | `true` | Normalisoi tuodut normaalivektorit yksikköpituuteen |
---
## ObjSaveOptions
Tallennusasetukset Wavefront OBJ -tiedostoille.
ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);| FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions | FbxSaveOptions |
|---|---|---|---|---|---|
applyUnitScale | boolean | getApplyUnitScale() | setApplyUnitScale(boolean) | false | Käytä skenen yksikköskaalakerrointa vietyihin koordinaatteihin |
pointCloud | boolean | getPointCloud() | setPointCloud(boolean) | false | Vie vain kärkipisteet (ei polygonipintoja) |
verbose | boolean | getVerbose() | setVerbose(boolean) | false | Sisällytä ylimääräisiä OBJ-kommentteja tulosteeseen |
serializeW | boolean | getSerializeW() | setSerializeW(boolean) | false | Kirjoita ohjauspisteiden W-komponentti |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Kirjoita a .mtl materiaalitiedosto ja viittaa siihen .obj |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Käännä koordinaatisto viennissä |
GltfLoadOptions
Lataa asetukset glTF 2.0- ja GLB-tiedostoille (.gltf, .glb).
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` | Käännä koordinaatisto tuonnissa |
| `prettyPrint` | `boolean` | `getPrettyPrint()` | `setPrettyPrint(boolean)` | `false` | Muotoile tulostettu JSON sisennyksellä luettavuuden parantamiseksi |
---
## GltfSaveOptions
Tallennusasetukset glTF 2.0- ja GLB-tulosteelle.
```java
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 | Aseta FileContentType.BINARY tuottamaan itsenäinen GLB-tiedosto; aseta FileContentType.ASCII JSONille .gltf ulkoisen puskurin kanssa |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Käännä koordinaatisto viennissä |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Muotoile tulostettu JSON sisennyksillä luettavuuden parantamiseksi |
bufferFilePrefix | String | getBufferFilePrefix() | setBufferFilePrefix(String) | null | Etuliite ulkoisten puskuritiedostojen nimille |
saveExtras | String | getSaveExtras() | setSaveExtras(String) | null | Mukautettu lisädata, joka sisällytetään glTF-tulosteeseen |
StlLoadOptions
Latausasetukset STL-tiedostoille (.stl).
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` | Käännä koordinaatisto tuonnissa |
| `recalculateNormal` | `boolean` | `getRecalculateNormal()` | `setRecalculateNormal(boolean)` | `false` | Laske normaalit uudelleen geometriasta tuonnissa |
| `contentType` | `FileContentType` | `getContentType()` | `setContentType(FileContentType)` | -- | Vihje binäärisen ja ASCII STL:n tunnistukseen |
---
## StlSaveOptions
Tallennusasetukset STL‑tulosteelle.
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 | Käännä koordinaatisto viennissä |
axisSystem | AxisSystem | getAxisSystem() | setAxisSystem(AxisSystem) | – | Ohita kohdeakselijärjestelmä viennissä |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.BINARY | Aseta BINARY tai ASCII ohjaamaan tulostusmuotoa |
FbxLoadOptions
Lataa asetukset FBX-tiedostoille (.fbx).
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` | Käännä koordinaatisto tuonnissa |
---
## FbxSaveOptions
**Huomaa:** FBX-vienti on **ei saatavilla** Java FOSS -versiossa. FBX on tuettu vain tuontia varten. `FbxSaveOptions` Luokka on olemassa API:ssa, mutta se aiheuttaa virheen, jos sitä käytetään tallentamiseen. Käytä sen sijaan vientiin OBJ-, STL-, glTF- tai GLB-muotoja.
---
## Katso myös
- [FileFormat-luokan viite](/3d/java/file-format/)
- [Scene-luokan viite](/3d/java/scene/)