Load and Save Options

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

Properties

Visas importēšanas un eksportēšanas operācijas pieņem izvēles options object, kas izvedams no LoadOptions vai SaveOptions. Pārsūtiet atbilstošo apakšklasi uz Scene.open() vai Scene.save() lai kontrolētu formāta specifisku uzvedību.

Properties: com.aspose.threed

import com.aspose.threed.*;

LoadOptions

Bāzes klase visiem load-option objektiem. Paplašina A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formāts, ar ko šis config ir saistīts (tikai lasāms)

SaveOptions

Bāzes klase visiem save-option objektiem. Paplašina A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formāts, ar ko šī konfigurācija ir saistīta (tikai lasāma)

ObjLoadOptions

Ielādēt opcijas Wavefront OBJ failiem (.obj).

ObjLoadOptions opts = new ObjLoadOptions(); opts.setFlipCoordinateSystem(true); opts.setScale(0.01); Scene scene = new Scene(); scene.open(“model.obj”, opts);


| Properties             | Properties | Properties                  | Properties                         | Properties | Properties                                                      |
| ---------------------- | ---------- | --------------------------- | ---------------------------------- | ---------- | --------------------------------------------------------------- |
| `flipCoordinateSystem` | `boolean`  | `getFlipCoordinateSystem()` | `setFlipCoordinateSystem(boolean)` | `false`    | Apgriezt koordinātu sistēmu importēšanas laikā                  |
| `enableMaterials`      | `boolean`  | `getEnableMaterials()`      | `setEnableMaterials(boolean)`      | `true`     | Ielādēt pievienoto `.mtl` materiāla fails                       |
| `scale`                | `double`   | `getScale()`                | `setScale(double)`                 | `1.0`      | Vienota skalēšana, kas piemērota visai importētajai ģeometrijai |
| `normalizeNormal`      | `boolean`  | `getNormalizeNormal()`      | `setNormalizeNormal(boolean)`      | `true`     | Normalizēt importētos normālos vektorus līdz vienības garumam   |

---

## ObjSaveOptions

Saglabāšanas opcijas Wavefront OBJ failiem.

ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falsePielietot ainas vienības mēroga koeficientu eksportētajām koordinātēm
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseEksportēt tikai virsotnes (bez daudzstūru seju)
verbosebooleangetVerbose()setVerbose(boolean)falseIekļaut papildu OBJ komentārus izvadē
serializeWbooleangetSerializeW()setSerializeW(boolean)falseRakstīt kontroles punktu W komponenti
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueRakstīt a .mtl materiāla fails un atsauce uz to no .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu eksportēšanas laikā

GltfLoadOptions

Ielādēt opcijas glTF 2.0 un GLB failiem (.gltf, .glb).

GltfLoadOptions opts = new GltfLoadOptions(); opts.setFlipCoordinateSystem(true); Scene scene = new Scene(); scene.open(“model.gltf”, opts);


| Properties             | Properties | Properties                  | Properties                         | Properties | Properties                                             |
| ---------------------- | ---------- | --------------------------- | ---------------------------------- | ---------- | ------------------------------------------------------ |
| `flipCoordinateSystem` | `boolean`  | `getFlipCoordinateSystem()` | `setFlipCoordinateSystem(boolean)` | `false`    | Apgriezt koordinātu sistēmu importēšanas laikā         |
| `prettyPrint`          | `boolean`  | `getPrettyPrint()`          | `setPrettyPrint(boolean)`          | `false`    | Formatēt izvades JSON ar atkāpēm lasāmības uzlabošanai |

---

## GltfSaveOptions

Saglabāšanas iespējas glTF 2.0 un GLB izvadei.

```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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.ASCIIIestatīt uz FileContentType.BINARY lai izveidotu pašpietiekamu GLB failu; iestatīt uz FileContentType.ASCII JSON .gltf ar ārēju buferi
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu eksportēšanas laikā
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormatējiet izvades JSON ar atkāpēm, lai uzlabotu lasāmību
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullPrefikss ārējo bufera failu nosaukumiem
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullPielāgoti papildu dati, ko iekļaut glTF izvadē

StlLoadOptions

Ielādes iespējas STL failiem (.stl).

StlLoadOptions opts = new StlLoadOptions(); opts.setFlipCoordinateSystem(true); Scene scene = new Scene(); scene.open(“part.stl”, opts);


| Properties             | Properties        | Properties                  | Properties                         | Properties | Properties                                            |
| ---------------------- | ----------------- | --------------------------- | ---------------------------------- | ---------- | ----------------------------------------------------- |
| `flipCoordinateSystem` | `boolean`         | `getFlipCoordinateSystem()` | `setFlipCoordinateSystem(boolean)` | `false`    | Apgriezt koordinātu sistēmu importēšanas laikā        |
| `recalculateNormal`    | `boolean`         | `getRecalculateNormal()`    | `setRecalculateNormal(boolean)`    | `false`    | Pārrēķināt normāles no ģeometrijas importēšanas laikā |
| `contentType`          | `FileContentType` | `getContentType()`          | `setContentType(FileContentType)`  | --         | Padoms binārā un ASCII STL noteikšanai                |

---

## StlSaveOptions

Saglabāšanas iespējas STL izvadei.

StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu eksportēšanas laikā
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Pārrakstīt mērķa ass sistēmu eksportēšanas laikā
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYIestatīt uz BINARY vai ASCII lai kontrolētu izvades formātu

FbxLoadOptions

Ielādēt opcijas FBX failiem (.fbx).

FbxLoadOptions opts = new FbxLoadOptions(); opts.setFlipCoordinateSystem(true); Scene scene = new Scene(); scene.open(“animation.fbx”, opts);


| Properties             | Properties | Properties                  | Properties                         | Properties | Properties                                     |
| ---------------------- | ---------- | --------------------------- | ---------------------------------- | ---------- | ---------------------------------------------- |
| `flipCoordinateSystem` | `boolean`  | `getFlipCoordinateSystem()` | `setFlipCoordinateSystem(boolean)` | `false`    | Apgriezt koordinātu sistēmu importēšanas laikā |

---

## FbxSaveOptions

**Piezīme:** FBX eksports ir **nav pieejams** šajā Java FOSS izdevumā. FBX tiek atbalstīts tikai importam. Šī `FbxSaveOptions` klase pastāv API, bet radīs kļūdu, ja to izmantos saglabāšanai. Izmantojiet OBJ, STL, glTF vai GLB eksportam.

---

## Skatīt arī

- [FileFormat klases atsauce](/3d/java/file-format/)
- [Ainas klases atsauce](/3d/java/scene/)
 Latviešu