Repository navigation
feat(ui-plugins): add Product 3D Showcase (product-3d-showcase) - #251
Open
ppppp2005-p wants to merge 10 commits into
Open
ppppp2005-p wants to merge 10 commits into
ppppp2005-p wants to merge 10 commits into
Conversation
Author
|
ZCode desktop demo (ZCode 4.0.0, macOS arm64) product-3d-showcase-demo.mp4Flow shown:
Found and fixed while testing in ZCode: the 9 MB model used to go to the panel as one ~12 MB message, which is over ZCode's 10 MB stdio limit, so the plugin server was dropped as soon as the panel opened. 演示流程:本地 marketplace 安装 → |
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
product-3d-showcase(UI Plugin, new)What / 改动内容
New community UI plugin Product 3D Showcase / 产品 3D 展示: glTF/GLB product model → multi-angle product images, a 360° turntable video and an offline web 3D viewer, all with one consistent studio look.
showcase_open: model plus optional settings. Reports meshes, materials, textures and size, and reusesshowcase.jsonwhen present.showcase_save.showcase_export: the panel renders and saves; the result is reported back withupdateModelContext.model_data,save_output(only.png/.webmwith a magic-byte check, inside the output folder; WebM → MP4 via ffmpeg when available),save_viewer,workspace_files..gltfexternal buffers and images are inlined server-side.<img>and decodes data: buffers directly, so nothing needsfetchunder the panel CSP (connect-src 'none').index.html+viewer.js(a separate IIFE build) +model.js, which works over file://, with OrbitControls and auto-rotate.Network / API / side effects:
Third-party: three.js (MIT), MCP SDK / ext-apps (MIT), zod (MIT).
Tests:
.gltfinlining (Khronos Avocado, CC0) with byte-length checks.save_outputpath and magic-byte guards.validate.py,build_dist.py,git diff --checkandtscpass.A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。
Self-check / 自查清单
external_plugins/<name>/categoryis set (productivity)version0.1.0 in bothplugin.jsonandmarketplace.jsonREADME.md(EN) andREADME_CN.md(中文) both provided and equivalentdescription_i18nhas bothenandzh-CNpython3 scripts/validate.pyandpython3 scripts/build_dist.pypass locallymodels/WaterBottle.glbwith the saved settings; the agent calledshowcase_open, then "导出全部" (Export all) was clicked in the panel, which renderedfront.png,three-quarter-left.png,top.png(2000×2000, white background, studio lighting) andviewer/index.htmlintoshowcase/WaterBottle/; demo video in the comments)Note on large models:
model_datasends the model to the panel in parts of at most 4 Mi characters (offset/total), because ZCode Desktop closes a stdio MCP server when a single message is over 10 MB (a 9 MB GLB is about 12 MB as base64). Covered bytest/model-parts.test.ts.