From f3da916905e3bd70d50f9864494459c35d864447 Mon Sep 17 00:00:00 2001 From: yiling Date: Tue, 13 Oct 2026 11:38:25 +0800 Subject: [PATCH] fix(asset): remove unbundled GLTF format from supported 3D models --- README.md | 2 +- README_CN.md | 2 +- docs/using-shumai/3d-asset-support.mdx | 2 +- packages/core/src/utils/mime.test.ts | 4 ++-- packages/core/src/utils/mime.ts | 6 ++++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a7e6a7dc..aee5e288 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Shumai is an open-source Frame.io alternative built for creative teams to collab * **Custom Asset Metadata**: Define dynamic metadata fields tailored to your production pipeline. * **Share Link Watermarking**: Protect shared media with customizable text and image watermarks, and save watermark as reusable templates. * **Wide File Format Support**: Preview common creative file formats, including images (with PSD support), videos, audio, and documents, while allowing any file type to be uploaded and stored. -* **3D Asset Turntable Previews**: Generate interactive 3D model turntable previews and videos for formats like GLB, GLTF, FBX, OBJ, STL, USD, and DAE using [turntable-renderer](https://docs.shumai.one/using-shumai/3d-asset-support). +* **3D Asset Turntable Previews**: Generate interactive 3D model turntable previews and videos for formats like GLB, FBX, OBJ, STL, USD, and DAE using [turntable-renderer](https://docs.shumai.one/using-shumai/3d-asset-support). * **Office & Document PDF Proxying via Gotenberg**: Convert Word, PowerPoint, Excel, Markdown, HTML, and CSV documents to high-quality PDF proxies for in-browser previewing using [Gotenberg](https://docs.shumai.one/using-shumai/gotenberg). * **NLE Export & Premiere Pro Plugin (Experimental)**: Export timestamped review comments to your favorite non-linear editor (Premiere Pro XML, DaVinci Resolve EDL, Final Cut Pro, Avid Media Composer) or use the experimental Premiere Pro UXP plugin to import media assets and auto-sync comments directly to sequence timeline markers. See [documentation](https://docs.shumai.one/using-shumai/nle-and-premiere). diff --git a/README_CN.md b/README_CN.md index bd649501..090a552f 100644 --- a/README_CN.md +++ b/README_CN.md @@ -33,7 +33,7 @@ Shumai 是一个开源的 Frame.io 替代方案,专为创意团队打造,让 * **自定义素材元数据**:可以按你的制作流程,自由定义动态元数据字段。 * **分享链接水印**:通过可自定义的文字和图片水印保护共享媒体,并将水印配置保存为模板以便重复使用。 * **丰富的文件格式支持**:支持预览常见创意文件格式,包括图片(支持 PSD)、视频、音频和文档,同时可上传和存储任意类型的文件。 -* **基于转盘渲染服务的 3D 资产预览**:通过集成 [turntable-renderer](https://docs.shumai.one/using-shumai/3d-asset-support) 支持为 GLB、GLTF、FBX、OBJ、STL、USD 和 DAE 等 3D 模型生成高质量的交互式转盘预览与视频。 +* **基于转盘渲染服务的 3D 资产预览**:通过集成 [turntable-renderer](https://docs.shumai.one/using-shumai/3d-asset-support) 支持为 GLB、FBX、OBJ、STL、USD 和 DAE 等 3D 模型生成高质量的交互式转盘预览与视频。 * **基于 Gotenberg 的文档 PDF 转码代理**:通过集成 [Gotenberg](https://docs.shumai.one/using-shumai/gotenberg) 支持将 Word、PowerPoint、Excel、Markdown、HTML 和 CSV 文档高质量转换为 PDF 代理文件进行在线预览。 * **非编剪辑导出与 Premiere 插件(实验性)**:支持将时间戳审阅评论导出至常用非编软件(Premiere Pro XML、DaVinci Resolve EDL、Final Cut Pro、Avid Media Composer),或使用实验性的 Premiere Pro 原生 UXP 插件导入媒体素材并将评论自动同步为时间轴标记。详见[相关文档](https://docs.shumai.one/using-shumai/nle-and-premiere)。 diff --git a/docs/using-shumai/3d-asset-support.mdx b/docs/using-shumai/3d-asset-support.mdx index 3558d2db..f76710c9 100644 --- a/docs/using-shumai/3d-asset-support.mdx +++ b/docs/using-shumai/3d-asset-support.mdx @@ -20,7 +20,7 @@ When turntable-renderer is configured, Shumai automatically generates 3D turntab | Format / Standard | Extensions | | --------------------------- | --------------------------------- | -| glTF / Binary glTF | `.glb`, `.gltf` | +| Binary glTF | `.glb` | | Universal Scene Description | `.usd`, `.usda`, `.usdc`, `.usdz` | | Autodesk FBX | `.fbx` | | Wavefront OBJ | `.obj` | diff --git a/packages/core/src/utils/mime.test.ts b/packages/core/src/utils/mime.test.ts index 69add7d5..4c2ba670 100644 --- a/packages/core/src/utils/mime.test.ts +++ b/packages/core/src/utils/mime.test.ts @@ -128,9 +128,7 @@ describe('getProxyType', () => { it('should detect 3d proxyType for supported 3D models', () => { expect(getProxyType('model/gltf-binary', 'model.glb')).toBe('3d') - expect(getProxyType('model/gltf+json', 'model.gltf')).toBe('3d') expect(getProxyType(null, 'model.glb')).toBe('3d') - expect(getProxyType(null, 'model.gltf')).toBe('3d') expect(getProxyType(null, 'character.fbx')).toBe('3d') expect(getProxyType('model/obj', 'mesh.obj')).toBe('3d') expect(getProxyType(null, 'mesh.obj')).toBe('3d') @@ -147,5 +145,7 @@ describe('getProxyType', () => { it('should return null for unsupported files', () => { expect(getProxyType('application/zip', 'archive.zip')).toBeNull() expect(getProxyType(null, 'unknown.bin')).toBeNull() + expect(getProxyType('model/gltf+json', 'model.gltf')).toBeNull() + expect(getProxyType(null, 'model.gltf')).toBeNull() }) }) diff --git a/packages/core/src/utils/mime.ts b/packages/core/src/utils/mime.ts index 3962a096..aa1f9632 100644 --- a/packages/core/src/utils/mime.ts +++ b/packages/core/src/utils/mime.ts @@ -6,9 +6,12 @@ export function is3dModel(mediaType?: string | null, filename?: string | null): const lowerMediaType = mediaType?.toLowerCase() || '' const lowerFilename = filename?.toLowerCase() || '' + if (lowerMediaType === 'model/gltf+json' || lowerFilename.endsWith('.gltf')) { + return false + } + const modelExtensions = [ '.glb', - '.gltf', '.usd', '.usda', '.usdc', @@ -25,7 +28,6 @@ export function is3dModel(mediaType?: string | null, filename?: string | null): if ( lowerMediaType.startsWith('model/') || lowerMediaType === 'model/gltf-binary' || - lowerMediaType === 'model/gltf+json' || lowerMediaType === 'model/obj' || lowerMediaType === 'model/stl' || lowerMediaType === 'model/vnd.usdz+zip' ||