Format Load and Save Options
패키지: @aspose/3d (v24.12.0)
포맷 옵션 클래스는 어떻게 @aspose/3d 특정 3D 파일 포맷을 읽고 씁니다. 옵션 인스턴스를 두 번째 인수로 전달하십시오 scene.open() (load options) 또는 scene.save() (save options). 모든 옵션 클래스는 다음 중 하나를 확장합니다 LoadOptions 또는 SaveOptions.
// Load with options
import { Scene } from '@aspose/3d';
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
const opts = new ObjLoadOptions();
opts.enableMaterials = false;
scene.open('mesh.obj', opts);
// Save with options
import { GltfSaveOptions } from '@aspose/3d/formats/gltf';
const saveOpts = new GltfSaveOptions();
saveOpts.binaryMode = true;
scene.save('output.glb', saveOpts);GltfSaveOptions
glTF 2.0 JSON 저장 옵션 (.gltf) 및 바이너리 GLB (.glb) 출력.
import { GltfSaveOptions } from '@aspose/3d/formats/gltf';
// or
import { GltfSaveOptions } from '@aspose/3d';SaveOptions
| SaveOptions | SaveOptions | SaveOptions | SaveOptions |
|---|---|---|---|
binaryMode | boolean | false | SaveOptions true, 익스포터는 자체 포함된 바이너리 GLB 파일을 씁니다. 언제 false, JSON 파일을 씁니다 .gltf 동반 파일과 함께 .bin 버퍼. |
flipTexCoordV | boolean | true | SaveOptions true, UV V 좌표가 뒤집힙니다 (v = 1 - v). glTF 2.0 사양은 좌상단 UV 원점을 사용하므로, 이 플래그는 true 기본적으로 대부분의 DCC 툴 관행에 맞추어 설정됩니다. |
SaveOptions
UV 좌표를 그대로 유지한 채 씬을 바이너리 GLB로 내보냅니다.
import { Scene } from '@aspose/3d';
import { GltfSaveOptions } from '@aspose/3d/formats/gltf';
const scene = new Scene();
scene.open('model.obj');
const opts = new GltfSaveOptions();
opts.binaryMode = true;
opts.flipTexCoordV = false;
scene.save('output.glb', opts);
console.log('Saved as binary GLB without UV flip.');GltfLoadOptions
glTF 2.0 JSON에 대한 로드 옵션 (.gltf) 및 바이너리 GLB (.glb) 파일.
import { GltfLoadOptions } from '@aspose/3d/formats/gltf';GltfLoadOptions 확장 LoadOptions. 현재 버전에서는 추가 사용자 노출 속성을 제공하지 않습니다; 권장 기본값을 사용하려면 기본 인스턴스를 전달하십시오.
SaveOptions
import { Scene } from '@aspose/3d';
import { GltfLoadOptions } from '@aspose/3d/formats/gltf';
const scene = new Scene();
scene.open('model.glb', new GltfLoadOptions());ObjLoadOptions
Wavefront OBJ 로드 옵션 (.obj) 파일.
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
// or
import { ObjLoadOptions } from '@aspose/3d';SaveOptions
| SaveOptions | SaveOptions | SaveOptions | SaveOptions |
|---|---|---|---|
enableMaterials | boolean | true | SaveOptions true, 가져오기 프로그램은 .mtl 재질 라이브러리를 참조하는 mtllib 지시문이며 메시 노드에 재질 속성을 채웁니다. 다음으로 설정 false 재질 로드를 건너뛰려면. |
flipCoordinateSystem | boolean | false | SaveOptions true, 가져오기 중 Y축과 Z축이 교환되어 Y-up과 Z-up 좌표계 간 변환이 이루어집니다. |
normalizeNormal | boolean | true | SaveOptions true, 파일에서 읽은 정점 법선이 가져오기 중 단위 길이로 정규화됩니다. |
scale | number | 1.0 | 가져오기 중 모든 기하에 적용되는 균일 스케일 팩터. |
SaveOptions
재질 라이브러리를 해석하지 않고 OBJ 파일을 로드합니다.
import { Scene } from '@aspose/3d';
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
const opts = new ObjLoadOptions();
opts.enableMaterials = false;
const scene = new Scene();
scene.open('mesh.obj', opts);
console.log(`Root children: ${scene.rootNode.childNodes.length}`);ObjSaveOptions
Wavefront OBJ 저장 옵션 (.obj) 출력.
import { ObjSaveOptions } from '@aspose/3d/formats/obj';참고: OBJ 내보내기 (canExport: false)는 이 라이브러리 버전에서 완전히 지원되지 않습니다. OBJ로 저장을 시도하면 지원되지 않는 작업 오류가 발생할 수 있습니다.
SaveOptions
| SaveOptions | SaveOptions | SaveOptions | SaveOptions |
|---|---|---|---|
enableMaterials | boolean | true | SaveOptions true, 동반자 .mtl 재질 라이브러리 파일이 그와 함께 작성됩니다 .obj 출력. |
pointCloud | boolean | false | SaveOptions true, 기하학은 포인트 클라우드(정점만, 면 정의 없음)로 내보내집니다. |
verbose | boolean | false | SaveOptions true, 추가 진단 주석이 OBJ 출력에 포함됩니다. |
serializeW | boolean | false | SaveOptions true, 균일 정점 좌표의 W 구성 요소가 파일에 기록됩니다. |
flipCoordinateSystem | boolean | false | SaveOptions true, 내보내기 시 Y축과 Z축이 교환됩니다. |
applyUnitScale | boolean | false | SaveOptions true, 내보내기 시 씬의 단위 스케일이 모든 기하 좌표에 적용됩니다. |
StlSaveOptions
STL 저장 옵션 (.stl) 출력.
import { StlSaveOptions } from '@aspose/3d/formats/stl';
// or
import { StlSaveOptions } from '@aspose/3d';SaveOptions
| SaveOptions | SaveOptions | SaveOptions | SaveOptions |
|---|---|---|---|
binaryMode | boolean | false | SaveOptions true, 출력이 바이너리 STL(컴팩트하고 사람이 읽을 수 없음)로 기록됩니다. When false, ASCII STL이 기록됩니다. |
flipCoordinateSystem | boolean | false | SaveOptions true, 내보내기 시 Y축과 Z축이 교환됩니다. |
scale | number | 1.0 | 균일 스케일 팩터가 내보내기 시 모든 기하에 적용됩니다. |
SaveOptions
메시를 바이너리 STL 형식으로 저장합니다.
import { Scene } from '@aspose/3d';
import { StlSaveOptions } from '@aspose/3d/formats/stl';
const scene = new Scene();
scene.open('model.obj');
const opts = new StlSaveOptions();
opts.binaryMode = true;
scene.save('output.stl', opts);
console.log('Saved binary STL.');StlLoadOptions
STL 로드 옵션 (.stl) 파일. ASCII와 바이너리 STL이 자동으로 지원됩니다; 감지를 제어하는 속성이 없습니다.
import { StlLoadOptions } from '@aspose/3d/formats/stl';StlLoadOptions extends LoadOptions 그리고 현재 버전에서는 추가 사용자 노출 속성을 제공하지 않습니다.
FbxSaveOptions
FBX 저장 옵션 (.fbx) 출력.
import { FbxSaveOptions } from '@aspose/3d/formats/fbx';
// or
import { FbxSaveOptions } from '@aspose/3d';SaveOptions
| SaveOptions | SaveOptions | SaveOptions | SaveOptions |
|---|---|---|---|
embedTextures | boolean | false | SaveOptions true, 참조된 텍스처 이미지가 FBX 바이너리 아카이브 내부에 포함됩니다. 때 false, 텍스처 경로가 외부 참조로 기록됩니다. |
SaveOptions
모든 텍스처가 포함된 FBX 파일을 내보냅니다.
import { Scene } from '@aspose/3d';
import { FbxSaveOptions } from '@aspose/3d/formats/fbx';
const scene = new Scene();
scene.open('character.gltf');
const opts = new FbxSaveOptions();
opts.embedTextures = true;
scene.save('character-embedded.fbx', opts);
console.log('Saved FBX with embedded textures.');FbxLoadOptions
FBX 로드 옵션 (.fbx) 파일. 바이너리와 ASCII FBX 모두를 지원합니다.
import { FbxLoadOptions } from '@aspose/3d/formats/fbx';FbxLoadOptions 확장합니다 LoadOptions 그리고 현재 버전에서는 추가적인 사용자에게 노출되는 속성을 제공하지 않습니다.
기본 클래스
LoadOptions
모든 로드 옵션 객체의 기본 클래스입니다.
import { LoadOptions } from '@aspose/3d';전달하십시오 LoadOptions 서브클래스 인스턴스를 scene.open(filePath, options) 또는 scene.openFromBuffer(buffer, options).
SaveOptions
모든 저장 옵션 객체의 기본 클래스입니다.
import { SaveOptions } from '@aspose/3d';전달하십시오 SaveOptions 서브클래스 인스턴스를 scene.save(filePath, options).