FileFormat

Methods

FileFormat dient zowel als een formatbeschrijving als een register van alle ondersteunde 3D‑bestandsformaten. Elk format wordt weergegeven als een FileFormat instance die toegankelijk is als een klasse‑attribuut of via statische fabrieksmethoden. Je geeft FileFormat instances aan Scene.save() om een specifiek format af te dwingen, of gebruik FileFormat.detect() om het format van een onbekend bestand te identificeren.

Methods: com.aspose.threed

import com.aspose.threed.FileFormat;

Ondersteunde Formaatconstanten

Formaatconstanten die actief worden ondersteund (importeurs en/of exporteurs geregistreerd) in de FOSS-release worden hieronder weergegeven.

Actief Ondersteund (FOSS-release)

NameTypeAccessDescription
formatsList<FileFormat>ReadGets the formats.
versionVersionReadGets the version.
canImportbooleanReadGets the can import.
canExportbooleanReadGets the can export.
extensionStringReadGets the extension.
extensionsString[]ReadGets the extensions.
contentTypeFileContentTypeReadGets the content type.
fileFormatTypeFileFormatTypeReadGets the file format type.
FBX6100ASCIIFileFormatReadGets the fbx6100 ascii.
FBX6100_BINARYFileFormatReadGets the fbx6100 binary.
FBX7200ASCIIFileFormatReadGets the fbx7200 ascii.
FBX7200_BINARYFileFormatReadGets the fbx7200 binary.
FBX7300ASCIIFileFormatReadGets the fbx7300 ascii.
FBX7300_BINARYFileFormatReadGets the fbx7300 binary.
FBX7400ASCIIFileFormatReadGets the fbx7400 ascii.
FBX7400_BINARYFileFormatReadGets the fbx7400 binary.
FBX7500ASCIIFileFormatReadGets the fbx7500 ascii.
FBX7500_BINARYFileFormatReadGets the fbx7500 binary.
FBX7600ASCIIFileFormatReadGets the fbx7600 ascii.
FBX7600_BINARYFileFormatReadGets the fbx7600 binary.
FBX7700ASCIIFileFormatReadGets the fbx7700 ascii.
FBX7700_BINARYFileFormatReadGets the fbx7700 binary.
MAYAASCIIFileFormatReadGets the mayaascii.
MAYA_BINARYFileFormatReadGets the maya binary.
STL_BINARYFileFormatReadGets the stl binary.
STLASCIIFileFormatReadGets the stlascii.
WAVEFRONTOBJFileFormatReadGets the wavefrontobj.
DISCREET3DSFileFormatReadGets the discreet3 ds.
COLLADAFileFormatReadGets the collada.
UNIVERSAL3DFileFormatReadGets the universal3 d.
GLTFFileFormatReadGets the gltf.
GLTF2FileFormatReadGets the gltf2.
GLTF_BINARYFileFormatReadGets the gltf binary.
GLTF2_BINARYFileFormatReadGets the gltf2 binary.
PDFPdfFormatReadGets the pdf.
BLENDERFileFormatReadGets the blender.
DXFFileFormatReadGets the dxf.
PLYPlyFormatReadGets the ply.
X_BINARYFileFormatReadGets the x binary.
X_TEXTFileFormatReadGets the x text.
DRACODracoFormatReadGets the draco.
MICROSOFT3MFMicrosoft3MFFormatReadGets the microsoft3 mf.
RVM_TEXTRvmFormatReadGets the rvm text.
RVM_BINARYRvmFormatReadGets the rvm binary.
ASEFileFormatReadGets the ase.
IFCFileFormatReadGets the ifc.
SIEMENSJT8FileFormatReadGets the siemensjt8.
SIEMENSJT9FileFormatReadGets the siemensjt9.
AMFFileFormatReadGets the amf.
VRMLFileFormatReadGets the vrml.
ASPOSE3D_WEBFileFormatReadGets the aspose3d web.
HTML5FileFormatReadGets the html5.
ZIPFileFormatReadGets the zip.
USDFileFormatReadGets the usd.
USDAFileFormatReadGets the usda.
USDZFileFormatReadGets the usdz.
XYZFileFormatReadGets the xyz.
PCDFileFormatReadGets the pcd.
PCD_BINARYFileFormatReadGets the pcd binary.

Methods

FBX‑versies 6100-7700 (binair), Maya ASCII/Binary, Discreet 3DS, Universal 3D, GLTF 1.0, GLTF binary, PDF, Blender, DXF, PLY, X (binair/tekst), Draco, RVM, ASE, IFC, Siemens JT, AMF, VRML, HTML5, ZIP, USD/USDA/USDZ, XYZ, PCD, PCD binary.

Statische Methoden

SignatureDescription
FileFormat(type: FileFormatType, version: Version, contentType: FileContentType, extension: String, extensions: String[], canImport: boolean, canExport: boolean)Calls FileFormat(type, version, contentType, extension, extensions, canImport, canExport) on this FileFormat instance.
getFormats()List<FileFormat>Returns the formats.
getVersion()VersionReturns the version.
getFormatByExtension(filePath: String)FileFormatCalls getFormatByExtension(filePath) on this FileFormat instance.
getCanImport()booleanReturns the can import.
getCanExport()booleanReturns the can export.
getExtension()StringReturns the extension.
getExtensions()String[]Returns the extensions.
getContentType()FileContentTypeReturns the content type.
getFileFormatType()FileFormatTypeReturns the file format type.
createLoadOptions()LoadOptionsCalls createLoadOptions on this FileFormat instance.
createSaveOptions()SaveOptionsCalls createSaveOptions on this FileFormat instance.
canDetect(stream: Stream, fileName: String)booleanCalls canDetect(stream, fileName) on this FileFormat instance.
detect(stream: Stream, fileName: String)FileFormatCalls detect(stream, fileName) on this FileFormat instance.
detect(fileName: String)FileFormatCalls detect(fileName) on this FileFormat instance.
registerFormat(format: FileFormat)Calls registerFormat(format) on this FileFormat instance.
toString()StringCalls toString on this FileFormat instance.

Instantie‑eigenschappen

MethodsMethodsMethodsMethods
extensionStringgetExtension()Primaire bestandsextensie (zonder de voorlooppunt)
extensionsList<String>getExtensions()Alle extensies die door dit formaat worden ondersteund
contentTypeStringgetContentType()MIME-type tekenreeks
canExportbooleangetCanExport()Of exporteren naar dit formaat wordt ondersteund
canImportbooleangetCanImport()Of importeren vanuit dit formaat wordt ondersteund
versionStringgetVersion()Formaatversiestring

Instantie‑methoden

MethodsRetourtypeMethods
createLoadOptions()LoadOptionsCreëert de juiste format‑specifieke LoadOptions subklasse
createSaveOptions()SaveOptionsCreëert de juiste format‑specifieke SaveOptions subklasse

Methods

import com.aspose.threed.Scene;
import com.aspose.threed.FileFormat;
import com.aspose.threed.*;

// Auto-detect and load
Scene scene = Scene.fromFile("model.obj");

// Save with explicit format (force GLB binary)
GltfSaveOptions opts = new GltfSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.glb", opts);

// Get format by extension
FileFormat fmt = FileFormat.getFormatByExtension(".fbx");
if (fmt != null) {
    System.out.println(fmt.getCanImport());   // true
    System.out.println(fmt.getCanExport());   // false (FBX export not available)
}

// Create options from a format instance
FileFormat fmtObj = FileFormat.getFormatByExtension(".obj");
LoadOptions loadOpts = fmtObj.createLoadOptions();   // ObjLoadOptions
SaveOptions saveOpts = fmtObj.createSaveOptions();   // ObjSaveOptions

// Detect format from file stream
try (FileInputStream fis = new FileInputStream("unknown_file.bin")) {
    FileFormat detected = FileFormat.detect(fis, "unknown_file.bin");
    if (detected != null) {
        System.out.println(detected.getClass().getSimpleName());
    }
}

Zie ook

 Nederlands