FileFormat

Methods

FileFormat berfungsi sebagai deskripsi format sekaligus registri semua format file 3D yang didukung. Setiap format direpresentasikan sebagai a FileFormat instance yang dapat diakses sebagai atribut kelas atau melalui metode pabrik statis. Anda mengirim FileFormat instance ke Scene.save() untuk memaksa format tertentu, atau gunakan FileFormat.detect() untuk mengidentifikasi format file yang tidak diketahui.

Methods: com.aspose.threed

import com.aspose.threed.FileFormat;

Konstanta Format yang Didukung

Konstanta format yang secara aktif didukung (importir dan/atau pengekspor terdaftar) dalam rilis FOSS ditampilkan di bawah.

Didukung Secara Aktif (rilis FOSS)

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 versi 6100-7700 (biner), Maya ASCII/Biner, Discreet 3DS, Universal 3D, GLTF 1.0, GLTF biner, PDF, Blender, DXF, PLY, X (biner/teks), Draco, RVM, ASE, IFC, Siemens JT, AMF, VRML, HTML5, ZIP, USD/USDA/USDZ, XYZ, PCD, PCD biner.

Metode Statis

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.

Properti Instansi

MethodsMethodsMethodsMethods
extensionStringgetExtension()Ekstensi file utama (tanpa titik di depan)
extensionsList<String>getExtensions()Semua ekstensi yang didukung oleh format ini
contentTypeStringgetContentType()String tipe MIME
canExportbooleangetCanExport()Apakah mengekspor ke format ini didukung
canImportbooleangetCanImport()Apakah mengimpor dari format ini didukung
versionStringgetVersion()String versi format

Metode Instansi

MethodsTipe PengembalianMethods
createLoadOptions()LoadOptionsMembuat format-spesifik yang sesuai LoadOptions subkelas
createSaveOptions()SaveOptionsMembuat format-spesifik yang sesuai SaveOptions subkelas

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());
    }
}

Lihat Juga

 Bahasa Indonesia