Load and Save Options

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

Properties

Všetky operácie importu a exportu akceptujú voliteľný objekt options odvodený od LoadOptions alebo SaveOptions. Odovzdajte vhodnú podtriedu do Scene.open() alebo Scene.save() na riadenie formátovo špecifického správania.

Properties: com.aspose.threed

import com.aspose.threed.*;

LoadOptions

Základná trieda pre všetky objekty load-option. Extends A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formát, s ktorým je táto konfigurácia spojená (iba na čítanie)

SaveOptions

Základná trieda pre všetky objekty save-option. Extends A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formát, s ktorým je táto konfigurácia spojená (iba na čítanie)

ObjLoadOptions

Možnosti načítania pre súbory 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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePreklopiť súradnicový systém pri importe
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueNačítať pripojený .mtl súbor materiálu
scaledoublegetScale()setScale(double)1.0Jednotná mierka aplikovaná na všetku importovanú geometriu
normalizeNormalbooleangetNormalizeNormal()setNormalizeNormal(boolean)trueNormalizovať importované normálové vektory na jednotkovú dĺžku

ObjSaveOptions

Možnosti ukladania pre súbory Wavefront OBJ.

import com.aspose.threed.*;

ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falsePoužiť faktor jednotkovej mierky scény na exportované súradnice
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseExportovať len vrcholy (žiadne polygonové plochy)
verbosebooleangetVerbose()setVerbose(boolean)falseZahrnúť ďalšie OBJ komentáre do výstupu
serializeWbooleangetSerializeW()setSerializeW(boolean)falseZapísať komponentu W riadiacich bodov
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueZapísať a .mtl súbor materiálu a odkazovať naň z .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePreklopiť súradnicový systém pri exporte

GltfLoadOptions

Možnosti načítania pre súbory glTF 2.0 a GLB (.gltf, .glb).

import com.aspose.threed.*;

GltfLoadOptions opts = new GltfLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("model.gltf", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePreklopiť súradnicový systém pri importe
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormátovať výstupný JSON s odsadením pre čitateľnosť

GltfSaveOptions

Možnosti ukladania pre výstup glTF 2.0 a 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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.ASCIINastaviť na FileContentType.BINARY pre vytvorenie samostatného GLB súboru; nastaviť na FileContentType.ASCII pre JSON .gltf s externým bufferom
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePrevrátiť súradnicový systém pri exporte
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormátovať výstupný JSON s odsadením pre lepšiu čitateľnosť
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullPredpona pre názvy externých bufferových súborov
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullVlastné extra dáta, ktoré sa majú zahrnúť do výstupu glTF

StlLoadOptions

Možnosti načítania pre STL súbory (.stl).

import com.aspose.threed.*;

StlLoadOptions opts = new StlLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("part.stl", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePreklopiť súradnicový systém pri importe
recalculateNormalbooleangetRecalculateNormal()setRecalculateNormal(boolean)falsePrepočítať normály z geometrie pri importe
contentTypeFileContentTypegetContentType()setContentType(FileContentType)Nápoveda pre detekciu binárneho vs ASCII STL

StlSaveOptions

Možnosti ukladania pre výstup STL.

import com.aspose.threed.*;

StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePreklopiť súradnicový systém pri exporte
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Prepísať cieľový osový systém pri exporte
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYNastaviť na BINARY alebo ASCII na ovládanie výstupného formátu

FbxLoadOptions

Načítať možnosti pre súbory FBX (.fbx).

import com.aspose.threed.*;

FbxLoadOptions opts = new FbxLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("animation.fbx", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falsePreklopiť súradnicový systém pri importe

FbxSaveOptions

Poznámka: Export FBX je nedostupný v edícii Java FOSS. FBX je podporovaný iba pre import. FbxSaveOptions trieda existuje v API, ale pri použití na uloženie spôsobí chybu. Namiesto toho použite OBJ, STL, glTF alebo GLB na export.


Pozri tiež

 Slovenčina