Load and Save Options — Aspose.3D FOSS for Java
Properties
การดำเนินการนำเข้าและส่งออกทั้งหมดรับอ็อบเจ็กต์ options ที่เป็นตัวเลือกเพิ่มเติมซึ่งสืบทอดมาจาก LoadOptions หรือ SaveOptions. ส่งคลาสย่อยที่เหมาะสมไปยัง Scene.open() หรือ Scene.save() เพื่อควบคุมพฤติกรรมที่เฉพาะเจาะจงต่อรูปแบบ.
Properties: com.aspose.threed
import com.aspose.threed.*;LoadOptions
คลาสฐานสำหรับอ็อบเจ็กต์ load-option ทั้งหมด. Extends A3DObject.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | รูปแบบที่การกำหนดค่านี้เชื่อมโยงด้วย (อ่านอย่างเดียว) |
SaveOptions
คลาสฐานสำหรับอ็อบเจ็กต์ save-option ทั้งหมด. Extends A3DObject.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | รูปแบบที่การกำหนดค่านี้เชื่อมโยงกับ (อ่านอย่างเดียว) |
ObjLoadOptions
ตัวเลือกการโหลดสำหรับไฟล์ 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 | พลิกระบบพิกัดเมื่อทำการนำเข้า |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | โหลดไฟล์ที่แนบมาด้วย .mtl ไฟล์วัสดุ |
scale | double | getScale() | setScale(double) | 1.0 | สเกลแบบสม่ำเสมอที่ใช้กับเรขาคณิตทั้งหมดที่นำเข้า |
normalizeNormal | boolean | getNormalizeNormal() | setNormalizeNormal(boolean) | true | ทำให้เวกเตอร์ปกติที่นำเข้ามีความยาวเป็นหน่วย |
ObjSaveOptions
ตัวเลือกการบันทึกสำหรับไฟล์ 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 | ใช้ตัวคูณสเกลหน่วยของฉากกับพิกัดที่ส่งออก |
pointCloud | boolean | getPointCloud() | setPointCloud(boolean) | false | ส่งออกเฉพาะจุดยอด (ไม่มีหน้าพอลิกอน) |
verbose | boolean | getVerbose() | setVerbose(boolean) | false | รวมคอมเมนต์ OBJ เพิ่มเติมในผลลัพธ์ |
serializeW | boolean | getSerializeW() | setSerializeW(boolean) | false | เขียนส่วนประกอบ W ของจุดควบคุม |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | เขียน a .mtl ไฟล์วัสดุและอ้างอิงจาก the .obj |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | พลิกระบบพิกัดในการส่งออก |
GltfLoadOptions
โหลดตัวเลือกสำหรับไฟล์ glTF 2.0 และ 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 | พลิกระบบพิกัดในการนำเข้า |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | จัดรูปแบบ JSON ผลลัพธ์ด้วยการเยื้องเพื่อให้อ่านง่าย |
GltfSaveOptions
ตัวเลือกการบันทึกสำหรับผลลัพธ์ glTF 2.0 และ 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 | ตั้งค่าเป็น FileContentType.BINARY เพื่อสร้างไฟล์ GLB ที่เป็นอิสระ; ตั้งค่าเป็น FileContentType.ASCII สำหรับ JSON .gltf พร้อมบัฟเฟอร์ภายนอก |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | พลิกระบบพิกัดเมื่อส่งออก |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | จัดรูปแบบ JSON ผลลัพธ์ด้วยการเยื้องเพื่อให้อ่านง่าย |
bufferFilePrefix | String | getBufferFilePrefix() | setBufferFilePrefix(String) | null | คำนำหน้าสำหรับชื่อไฟล์บัฟเฟอร์ภายนอก |
saveExtras | String | getSaveExtras() | setSaveExtras(String) | null | ข้อมูลพิเศษที่กำหนดเองเพื่อรวมในผลลัพธ์ glTF |
StlLoadOptions
ตัวเลือกการโหลดสำหรับไฟล์ 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 | พลิกระบบพิกัดเมื่อทำการนำเข้า |
recalculateNormal | boolean | getRecalculateNormal() | setRecalculateNormal(boolean) | false | คำนวณนอร์มใหม่จากเรขาคณิตเมื่อทำการนำเข้า |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | – | คำแนะนำสำหรับการตรวจจับ STL แบบไบนารีหรือ ASCII |
StlSaveOptions
ตัวเลือกการบันทึกสำหรับผลลัพธ์ 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 | พลิกระบบพิกัดเมื่อทำการส่งออก |
axisSystem | AxisSystem | getAxisSystem() | setAxisSystem(AxisSystem) | – | บังคับใช้ระบบแกนเป้าหมายเมื่อทำการส่งออก |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.BINARY | ตั้งค่าเป็น BINARY หรือ ASCII เพื่อควบคุมรูปแบบผลลัพธ์ |
FbxLoadOptions
โหลดตัวเลือกสำหรับไฟล์ 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 | พลิกระบบพิกัดเมื่อทำการนำเข้า |
FbxSaveOptions
หมายเหตุ: การส่งออก FBX คือ ไม่พร้อมใช้งาน ในรุ่น FOSS ของ Java. FBX รองรับสำหรับการนำเข้าเท่านั้น. The FbxSaveOptions คลาสนี้มีอยู่ใน API แต่จะทำให้เกิดข้อผิดพลาดหากใช้เพื่อบันทึก. ใช้ OBJ, STL, glTF หรือ GLB สำหรับการส่งออกแทน.