Load and Save Options — Aspose.3D FOSS for Java
Properties
Toate operaţiunile de import şi export acceptă un obiect opţiuni opţional derivat din LoadOptions sau SaveOptions. Transmite subclasa corespunzătoare către Scene.open() sau Scene.save() pentru a controla comportamentul format-specific.
Properties: com.aspose.threed
import com.aspose.threed.*;LoadOptions
Clasă de bază pentru toate obiectele load‑option. Extinde A3DObject.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | Formatul cu care este asociat acest config (doar citire) |
SaveOptions
Clasă de bază pentru toate obiectele save‑option. Extinde A3DObject.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | Formatul cu care este asociată această configurație (doar citire) |
ObjLoadOptions
Opțiuni de încărcare pentru fișiere 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);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inversează sistemul de coordonate la import |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Încarcă fișierul însoțitor .mtl fișier de material |
scale | double | getScale() | setScale(double) | 1.0 | Scalare uniformă aplicată tuturor geometriei importate |
normalizeNormal | boolean | getNormalizeNormal() | setNormalizeNormal(boolean) | true | Normalizează vectorii normali importați la lungime unitară |
ObjSaveOptions
Opțiuni de salvare pentru fișiere Wavefront OBJ.
import com.aspose.threed.*;
ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
applyUnitScale | boolean | getApplyUnitScale() | setApplyUnitScale(boolean) | false | Aplică factorul de scară al unității scenei la coordonatele exportate |
pointCloud | boolean | getPointCloud() | setPointCloud(boolean) | false | Exportă doar vârfurile (fără fețe poligonale) |
verbose | boolean | getVerbose() | setVerbose(boolean) | false | Include comentarii suplimentare OBJ în ieșire |
serializeW | boolean | getSerializeW() | setSerializeW(boolean) | false | Scrie componenta W a punctelor de control |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Scrie un .mtl fișier material și referențiază-l din .obj |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inversează sistemul de coordonate la export |
GltfLoadOptions
Încarcă opțiunile pentru fișiere 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);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inversează sistemul de coordonate la import |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Formatează JSON-ul de ieșire cu indentare pentru lizibilitate |
GltfSaveOptions
Opțiuni de salvare pentru ieșirea 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);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.ASCII | Setează la FileContentType.BINARY pentru a produce un fișier GLB autonom; setează la FileContentType.ASCII pentru JSON .gltf cu un buffer extern |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inversează sistemul de coordonate la export |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Formatați JSON-ul de ieșire cu indentare pentru lizibilitate |
bufferFilePrefix | String | getBufferFilePrefix() | setBufferFilePrefix(String) | null | Prefix pentru numele fișierelor de buffer externe |
saveExtras | String | getSaveExtras() | setSaveExtras(String) | null | Date suplimentare personalizate de inclus în ieșirea glTF |
StlLoadOptions
Încărcați opțiunile pentru fișiere STL (.stl).
import com.aspose.threed.*;
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 | Inversează sistemul de coordonate la import |
recalculateNormal | boolean | getRecalculateNormal() | setRecalculateNormal(boolean) | false | Recalculează normalele din geometrie la import |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | – | Sugestie pentru detectarea STL binar vs ASCII |
StlSaveOptions
Opțiuni de salvare pentru ieșirea STL.
import com.aspose.threed.*;
StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Inversează sistemul de coordonate la export |
axisSystem | AxisSystem | getAxisSystem() | setAxisSystem(AxisSystem) | – | Suprascrie sistemul de axe țintă la export |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.BINARY | Setează la BINARY sau ASCII pentru a controla formatul de ieșire |
FbxLoadOptions
Încarcă opțiunile pentru fișiere FBX (.fbx).
import com.aspose.threed.*;
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 | Inversează sistemul de coordonate la import |
FbxSaveOptions
Notă: Exportul FBX este nu este disponibil în ediția Java FOSS. FBX este acceptat doar pentru import. The FbxSaveOptions clasa există în API, dar va genera o eroare dacă este folosită pentru salvare. Folosiți OBJ, STL, glTF sau GLB pentru export în schimb.