Add 3d control buttons to linear mode#8178
Conversation
📝 WalkthroughWalkthroughExtended the useLoad3dViewer composable public API by adding three new properties (hasSkeleton, intensity, showSkeleton). Updated Preview3d.vue to wrap the viewer instance in a ref and introduced a new Load3DControls component integrated into the template with reactive bindings. Changes
Possibly related PRs
Suggested reviewers
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Tests:
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 01/20/2026, 05:22:49 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.4 kB (baseline 22.4 kB) • 🔴 +34 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.02 MB (baseline 1.02 MB) • 🔴 +1.07 kBGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 80.7 kB (baseline 80.7 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 11 added / 11 removed Panels & Settings — 430 kB (baseline 430 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 19 added / 19 removed User & Accounts — 3.94 kB (baseline 3.94 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 3 added / 3 removed Editors & Dialogs — 2.8 kB (baseline 2.8 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 32.8 kB (baseline 32.8 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed Data & Services — 3.04 MB (baseline 3.04 MB) • 🔴 +114 BStores, services, APIs, and repositories
Status: 8 added / 8 removed Utilities & Hooks — 18.7 kB (baseline 18.7 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 5 added / 5 removed Vendor & Third-Party — 10.4 MB (baseline 10.4 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 6.25 MB (baseline 6.25 MB) • 🔴 +1.05 kBBundles that do not match a named category
Status: 75 added / 74 removed |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/renderer/extensions/linearMode/Preview3d.vue`:
- Around line 33-43: The v-models on Load3DControls are currently passing the
entire viewer composable (viewer) which will be replaced by config-shaped
payloads and lose methods; create computed getters/setters for each config
(e.g., sceneConfig, modelConfig, cameraConfig, lightConfig) that read the
relevant fields from viewer.value in the getter and merge/assign back into
viewer.value in the setter, then change v-model:scene-config,
v-model:model-config, v-model:camera-config and v-model:light-config to use
those computed refs (keep the existing event handlers like
viewer.handleBackgroundImageUpdate and viewer.exportModel unchanged).
| <Load3DControls | ||
| v-model:scene-config="viewer" | ||
| v-model:model-config="viewer" | ||
| v-model:camera-config="viewer" | ||
| v-model:light-config="viewer" | ||
| :is-splat-model="viewer.isSplatModel" | ||
| :is-ply-model="viewer.isPlyModel" | ||
| :has-skeleton="viewer.hasSkeleton" | ||
| @update-background-image="viewer.handleBackgroundImageUpdate" | ||
| @export-model="viewer.exportModel" | ||
| /> |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find src -name "Load3DControls.vue" -o -name "*load3d*" -o -name "*Load3d*" | head -20Repository: Comfy-Org/ComfyUI_frontend
Length of output: 553
🏁 Script executed:
find src -name "*load3d*" -o -name "*Load3d*" -type f | grep -E "\.(vue|ts)$"Repository: Comfy-Org/ComfyUI_frontend
Length of output: 463
🏁 Script executed:
rg -l "useLoad3dViewer" src --type vue --type tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 97
🏁 Script executed:
cat -n src/components/load3d/Load3DControls.vueRepository: Comfy-Org/ComfyUI_frontend
Length of output: 7265
🏁 Script executed:
cat -n src/composables/useLoad3dViewer.tsRepository: Comfy-Org/ComfyUI_frontend
Length of output: 21869
🏁 Script executed:
find src -name "Preview3d.vue" -type fRepository: Comfy-Org/ComfyUI_frontend
Length of output: 118
🏁 Script executed:
cat -n src/renderer/extensions/linearMode/Preview3d.vue | head -60Repository: Comfy-Org/ComfyUI_frontend
Length of output: 2325
Binding individual config properties instead of the full viewer object.
The v-model bindings pass the entire viewer composable to Load3DControls, but the component's emitted update:* events expect Config-shaped payloads. This would replace viewer.value with a config object, losing composable methods. Create computed getters/setters for each config or bind individual properties instead:
const sceneConfig = computed({
get: () => ({ showGrid: viewer.value.showGrid, backgroundColor: viewer.value.backgroundColor, backgroundImage: viewer.value.backgroundImage, backgroundRenderMode: viewer.value.backgroundRenderMode }),
set: (config) => Object.assign(viewer.value, config)
})Then use v-model:scene-config="sceneConfig" (similarly for model, camera, light configs).
🤖 Prompt for AI Agents
In `@src/renderer/extensions/linearMode/Preview3d.vue` around lines 33 - 43, The
v-models on Load3DControls are currently passing the entire viewer composable
(viewer) which will be replaced by config-shaped payloads and lose methods;
create computed getters/setters for each config (e.g., sceneConfig, modelConfig,
cameraConfig, lightConfig) that read the relevant fields from viewer.value in
the getter and merge/assign back into viewer.value in the setter, then change
v-model:scene-config, v-model:model-config, v-model:camera-config and
v-model:light-config to use those computed refs (keep the existing event
handlers like viewer.handleBackgroundImageUpdate and viewer.exportModel
unchanged).
Adds control buttons to the top left of the 3d preview in linear mode. <img width="460" alt="image" src="https://github.com/user-attachments/assets/35a83b9c-65af-46c3-a910-be5ad30c428e" /> This was deprioritized because I forgot the secret to magically unwrapping a set of refs (wrap them in another ref). ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8178-Add-3d-control-buttons-to-linear-mode-2ee6d73d3650816ab1a8e73ace1bdbc7) by [Unito](https://www.unito.io)
|
@AustinMroz Successfully backported to #8289 |
Backport of #8178 to `cloud/1.37` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8289-backport-cloud-1-37-Add-3d-control-buttons-to-linear-mode-2f26d73d3650817290ebf575f5f7a7a4) by [Unito](https://www.unito.io) Co-authored-by: AustinMroz <austin@comfy.org> Co-authored-by: Alexander Brown <drjkl@comfy.org>
Adds control buttons to the top left of the 3d preview in linear mode.

This was deprioritized because I forgot the secret to magically unwrapping a set of refs (wrap them in another ref).
┆Issue is synchronized with this Notion page by Unito