Commit Graph

57 Commits

Author SHA1 Message Date
Terry Jia
afa10f7a1e [refactor] refactor load3d (#5765)
Summary

Fully Refactored the Load3D module to improve architecture and
maintainability by consolidating functionality into a
centralized composable pattern and simplifying component structure. and
support VueNodes system

  Changes

- Architecture: Introduced new useLoad3d composable to centralize 3D
loading logic and state
  management
- Component Simplification: Removed redundant components
(Load3DAnimation.vue, Load3DAnimationScene.vue,
  PreviewManager.ts) 
- Support VueNodes
- improve config store
- remove lineart output due Animation doesnot support it, may add it
back later
- remove Preview screen and keep scene in fixed ratio in load3d (not
affect preview3d)
- improve record video feature which will already record video by same
ratio as scene
Need BE change https://github.com/comfyanonymous/ComfyUI/pull/10025


https://github.com/user-attachments/assets/9e038729-84a0-45ad-b0f2-11c57d7e0c9a



┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5765-refactor-refactor-load3d-2796d73d365081728297cc486e2e9052)
by [Unito](https://www.unito.io)
2025-10-31 16:19:35 -04:00
Johnpaul Chiwetelu
c642ed5703 Complete context menu migration for Load3D, Preview3D, and SaveGLB (#6454)
This pull request refactors how export menu options are added to
3D-related nodes, updating the API to use a new `getNodeMenuItems` hook
and simplifying the menu item creation logic. The changes improve
consistency and maintainability across extensions handling 3D nodes, and
clarify the expected return types for menu item hooks.

**Refactoring and API updates for node menu items:**

* Replaced usage of the legacy `createExportMenuOptions` function with
the new `createExportMenuItems` function in `load3d.ts`, `saveMesh.ts`,
and related imports, aligning all 3D node extensions to the new API.
[[1]](diffhunk://#diff-a5c612d9322ca4cbbeda097d13e2fa1ef017d4c3076d23fc228afee5a79a56e3L6-R12)
[[2]](diffhunk://#diff-7dede72060130d77ce5191fc86d115bd9b93311cb0438400730d8e20b2aa8e43L4-R7)
* Introduced and implemented the `getNodeMenuItems` hook in the
extension registration for `Load3D`, `Preview3D`, and `SaveGLB` nodes,
ensuring export menu items are only shown for the appropriate node
types.
[[1]](diffhunk://#diff-a5c612d9322ca4cbbeda097d13e2fa1ef017d4c3076d23fc228afee5a79a56e3R293-R302)
[[2]](diffhunk://#diff-a5c612d9322ca4cbbeda097d13e2fa1ef017d4c3076d23fc228afee5a79a56e3R521-R530)
[[3]](diffhunk://#diff-7dede72060130d77ce5191fc86d115bd9b93311cb0438400730d8e20b2aa8e43R48-R57)
* Removed assignment of `getExtraMenuOptions` to nodes, fully migrating
to the new menu item hook approach for context menus.
[[1]](diffhunk://#diff-a5c612d9322ca4cbbeda097d13e2fa1ef017d4c3076d23fc228afee5a79a56e3L301-L302)
[[2]](diffhunk://#diff-a5c612d9322ca4cbbeda097d13e2fa1ef017d4c3076d23fc228afee5a79a56e3L548-L549)
[[3]](diffhunk://#diff-7dede72060130d77ce5191fc86d115bd9b93311cb0438400730d8e20b2aa8e43L64-L67)

**Menu item creation logic simplification:**

* Refactored `createExportMenuOptions` to `createExportMenuItems` in
`exportMenuHelper.ts`, changing it to directly return an array of menu
items (with separators) instead of a function, simplifying its usage and
reducing boilerplate.
[[1]](diffhunk://#diff-42404da1a87a52d304371a13d5f021bdad837765b94d86d186abb2d99a8cb707L14-R22)
[[2]](diffhunk://#diff-42404da1a87a52d304371a13d5f021bdad837765b94d86d186abb2d99a8cb707L59-R58)

**Type and documentation improvements:**

* Updated the `ComfyExtension` interface in `comfy.ts` to clarify that
menu item hooks (`getCanvasMenuItems`, `getNodeMenuItems`) now return
arrays that may include `null` values as separators, improving type
safety and documentation.

See before and after below
<img width="1459" height="897" alt="Screenshot 2025-10-30 at 07 08 04"
src="https://github.com/user-attachments/assets/ec4464c9-f733-4b4c-87c4-bb5060ccaa68"
/>

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6454-Complete-context-menu-migration-for-Load3D-Preview3D-and-SaveGLB-29c6d73d3650819995b4c4dc1582cd86)
by [Unito](https://www.unito.io)
2025-10-30 07:26:05 +01:00
Terry Jia
c76f017f92 add save option for 3d node on context menu (#6319)
## Summary

add save option for 3d node on context menu

## Changes
allow to export model from context menu, supported in
preview3d/load3d/saveMesh




https://github.com/user-attachments/assets/1f0f1a93-9cdb-477f-8bd3-e298c7e3892b

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6319-add-save-option-for-3d-node-on-context-menu-2996d73d365081f7853cd2ae9c69fe4d)
by [Unito](https://www.unito.io)
2025-10-29 20:52:02 -04:00
snomiao
cbb0f765b8 feat: enable verbatimModuleSyntax in TypeScript config (#5533)
## Summary
- Enable `verbatimModuleSyntax` compiler option in TypeScript
configuration
- Update all type imports to use explicit `import type` syntax
- This change will Improve tree-shaking and bundler compatibility

## Motivation
The `verbatimModuleSyntax` option ensures that type-only imports are
explicitly marked with the `type` keyword. This:
- Makes import/export intentions clearer
- Improves tree-shaking by helping bundlers identify what can be safely
removed
- Ensures better compatibility with modern bundlers
- Follows TypeScript best practices for module syntax

## Changes
- Added `"verbatimModuleSyntax": true` to `tsconfig.json`
- Updated another 48+ files to use explicit `import type` syntax for
type-only imports
- No functional changes, only import/export syntax improvements

## Test Plan
- [x] TypeScript compilation passes
- [x] Build completes successfully  
- [x] Tests pass
- [ ] No runtime behavior changes

🤖 Generated with [Claude Code](https://claude.ai/code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-5533-feat-enable-verbatimModuleSyntax-in-TypeScript-config-26d6d73d36508190b424ef9b379b5130)
by [Unito](https://www.unito.io)
2025-09-18 21:05:56 -07:00
Christian Byrne
27ab355f9c [refactor] Improve updates/notifications domain organization (#5590)
* [refactor] Move update-related functionality to platform/updates domain

Reorganizes release management, version compatibility, and notification functionality
following Domain-Driven Design principles, mirroring VSCode's architecture pattern.

- Move releaseService.ts to platform/updates/common/
- Move releaseStore.ts to platform/updates/common/
- Move versionCompatibilityStore.ts to platform/updates/common/
- Move useFrontendVersionMismatchWarning.ts to platform/updates/common/
- Move toastStore.ts to platform/updates/common/
- Move ReleaseNotificationToast.vue to platform/updates/components/
- Move WhatsNewPopup.vue to platform/updates/components/
- Update 25+ import paths across codebase and tests

This creates a cohesive "updates" domain containing all functionality related to
software updates, version checking, release notifications, and user communication
about application state changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix imports

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-15 04:34:37 -07:00
Terry Jia
d22d62b670 [3d] initial version of 3d viewer (#3968)
Co-authored-by: github-actions <github-actions@github.com>
2025-08-10 21:09:19 -07:00
Benjamin Lu
fef02e5f56 [refactor] Migrate litegraph imports from npm package to local subtree
- Updated all imports from '@comfyorg/litegraph' to '@/lib/litegraph/src/'
- Replaced deep dist imports with direct source paths
- Updated CSS import in main.ts
- All imports now use the @ alias consistently
2025-08-03 22:06:29 -04:00
Terry Jia
ed1d944e0e [3d] remove unnecessary uploadTexture (#4357) 2025-07-19 11:38:49 -07:00
Terry Jia
35ff882ff2 [3d] better solution to support reading extra resource/texture (#4209) 2025-07-01 21:25:18 -07:00
Terry Jia
8209765eec [3d] improve mtl support logic (#3965) 2025-05-23 18:22:13 -07:00
Terry Jia
b531d34027 [3d] performance improve (#3961) 2025-05-21 21:29:52 -04:00
filtered
3aea2c120a Update widget types to match Litegraph changes (#3808) 2025-05-08 06:56:53 +10:00
filtered
b9d9ce78f9 [TS] Widget typing (#3804) 2025-05-08 04:38:17 +10:00
Terry Jia
db81b62274 [3d] add record video support for load3d animation node (#3798) 2025-05-07 10:12:33 -04:00
filtered
0da6be5cdc [Refactor] Update Litegraph widget types / cleanup (#3782) 2025-05-06 19:40:30 +10:00
Terry Jia
77ac4a415c [3d] add recording video support (#3749)
Co-authored-by: github-actions <github-actions@github.com>
2025-05-03 23:00:07 -04:00
Terry Jia
40d08a890d [3d] move default values of backgroundColor, LightIntensity, LightMaximum, LightMinimum, LightStep to settings panel (#3536)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-20 23:08:23 -04:00
Chenlei Hu
cd35f1d86d [Refactor] Generate DOM widget id in constructor (#3508) 2025-04-18 13:47:16 -04:00
Terry Jia
1a066c7062 [3d] move default values of showPreview, showGrid, cameraType to settings panel (#3443)
Co-authored-by: github-actions <github-actions@github.com>
2025-04-13 19:44:47 -04:00
Terry Jia
e660e1d678 [3d] add support to output camera state (#3421) 2025-04-12 11:27:05 -04:00
Chenlei Hu
24dcaa7f72 [i18n] Translate toast messages (#3228)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-24 22:22:17 -04:00
Terry Jia
abe65e58a0 [3d] add support to upload texture (#3224)
Co-authored-by: github-actions <github-actions@github.com>
2025-03-24 16:58:45 -04:00
Terry Jia
afdb94f12f [3d] refactor legacy code by using new vue style (#3161) 2025-03-20 10:28:35 -04:00
Terry Jia
44edec7ad2 [TS] ts-strict for 3D components (#3135) 2025-03-18 22:40:13 -04:00
Terry Jia
52bad3d0d1 [3d] support output normal and lineart at once (#3122) 2025-03-18 10:51:53 -04:00
Chenlei Hu
7af003fcab [TS] Enable noUnusedParameters (#3110) 2025-03-17 16:47:45 -04:00
Terry Jia
0cfd6a487a [3d] apply new vue desige (#3018) 2025-03-13 20:37:54 -04:00
Chenlei Hu
09ab14ac81 [Type] Disallow type upcasting for node input spec (#2790) 2025-03-01 16:58:45 -05:00
Terry Jia
d033640927 [3d] redesign UI (#2686)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chenlei Hu <huchenlei@proton.me>
2025-02-23 10:14:52 -05:00
Terry Jia
c502b86c31 [3d] refactor load3d nodes (#2683)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-22 18:36:47 -05:00
Terry Jia
c3c6ec627b [3d] support using image as background (#2657)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-20 20:05:54 -05:00
Terry Jia
b2375a150c [3d] fully convert load 3d nodes into vue (#2590) 2025-02-16 20:15:49 -05:00
Terry Jia
29cd693335 [3d] add tooltip (#2524)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-11 22:28:24 -05:00
Terry Jia
8cfe814daa [3d] refactor load3d (#2521) 2025-02-11 17:43:36 -05:00
Chenlei Hu
8052b2a02a Type LGraphNode.getInnerNodes (#2498) 2025-02-10 16:35:26 -05:00
Terry Jia
aaca5191ab Light fov UI change (#2492) 2025-02-10 11:23:33 -05:00
Terry Jia
83cc49a42b [3d] use vue to rewrite the UI for load3d (#2467) 2025-02-09 12:05:42 -05:00
Chenlei Hu
88a969df07 Update litegraph 0.8.72 (#2470) 2025-02-08 17:51:37 -05:00
kvick-games
f5c5a95bdc Refresh Preview3D node with node.onMouseEnter (#2439) 2025-02-05 21:26:45 -05:00
Terry Jia
55d63a8aef [3d] move change background color button (#2365) 2025-01-27 17:06:01 -08:00
Terry Jia
28b163cdd5 [3d] animation node UI change (#2347) 2025-01-25 11:41:05 -05:00
Terry Jia
326839db88 [3d] add preview 3d animation node (#2341) 2025-01-24 22:35:28 -05:00
Terry Jia
3f787e2dbf [3d] improve storing Camera State logic (#2328) 2025-01-23 14:26:13 -05:00
Terry Jia
b54e270b10 [3d] refactor code (#2326) 2025-01-23 11:26:27 -05:00
Terry Jia
76d5f39607 [3d] use threejs native viewHelper (#2230) 2025-01-12 13:23:23 -05:00
Terry Jia
f4b5677901 [3d] support for fov and mask (#2116) 2025-01-02 15:45:37 -05:00
Chenlei Hu
d8f074fea0 [Lint] Sort imports (#2104) 2024-12-30 17:26:37 -05:00
Terry Jia
ac952fbee3 [3d] fix file path issue for preview 3d node (#2005) 2024-12-22 16:13:15 -05:00
Terry Jia
a376503a7b [3d] improve Preview 3d node (#1918) 2024-12-16 11:56:20 -08:00
Terry Jia
7b64bfa173 [3d] Set view only when object exists (#1912)
* [3d] Set view only when object exists

* Update locales [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-15 10:57:34 -08:00