feat(web): add an interactive Geometry Nodes canvas
- Render the active mesh node graph with React Flow: add/remove nodes, drag/connect sockets, edit defaults and commit through setGeometryNodeGraph. - Keep the Properties form editor as an alternate entry. - Add canvas E2E for add/connect/commit and OPFS save/reopen. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -65,22 +65,34 @@
|
||||
- 画布中心像素由原图变为红色(绘制)、撤销后恢复;
|
||||
- OPFS 保存 → reload → 最近项目恢复 → 重开后中心像素仍为红色。
|
||||
|
||||
### 5. Geometry Nodes 画布
|
||||
|
||||
- 新 `web/app/src/app/ui/GeometryNodeCanvas.tsx`:React Flow 画布,读取当前网格的
|
||||
`geometryNodeGraphs[0]`,支持添加/移除 allowlist 节点、端口拖拽连线、节点拖拽布局、socket 默认值编辑、
|
||||
提交 `setGeometryNodeGraph`;替换 Geometry Nodes 工作区的只读节点列表。
|
||||
- 保留 Properties 的表单式图编辑器作为备用入口;两者都提交同一原生命令。
|
||||
- 验证:
|
||||
`DISPLAY=:1 CHROME_PATH=/usr/bin/google-chrome GPU_MODE=hardware npx playwright test --config playwright.config.ts tests/e2e/web-geonodes-canvas.spec.ts --workers=1`
|
||||
→ **2/2 PASS(25.1s)**:
|
||||
- 添加 Transform、从 Group Input 拖拽连接到 Transform,提交后 3 节点/2 连线,graphCount=1;
|
||||
- OPFS 保存 → reload → 最近项目恢复 → 重开后仍是 3 节点/2 连线。
|
||||
|
||||
## 待实现(按计划顺序)
|
||||
|
||||
1. **Geometry Nodes 画布**:共享图状态、React Flow 画布、位置/rename/属性、结果面板;
|
||||
需要一次 WASM 重建(location/properties)。
|
||||
2. **Spreadsheet 交互式只读表**:数据源/过滤/行列/列重排/CSV;原生属性值读取需 WASM。
|
||||
3. **Compositor 节点画布**:协议+React Flow+执行/Viewer;原生 writer/reader 缺失,需要最大的一次
|
||||
1. **Spreadsheet 交互式只读表**:数据源/过滤/行列/列重排/CSV;原生属性值读取需 WASM。
|
||||
2. **Compositor 节点画布**:协议+React Flow+执行/Viewer;原生 writer/reader 缺失,需要最大的一次
|
||||
WASM 工作。
|
||||
4. 其余缺口:Area 编辑器选择/⋮、Camera Perspective、Preferences、Outliner、Graph Editor。
|
||||
5. 15 模块课程、15 个短视频、OPFS 保存重开流程、增量发布到 `https://49.232.250.35:58014/`。
|
||||
3. 其余缺口:Area 编辑器选择/⋮、Camera Perspective、Preferences、Outliner、Graph Editor。
|
||||
4. 15 模块课程、15 个短视频、OPFS 保存重开流程、增量发布到 `https://49.232.250.35:58014/`。
|
||||
|
||||
## 已知限制 / 未验证
|
||||
|
||||
- 纹理绘制只支持本地 packed 图像;库链接图像(直接分配的 RE 材质贴图)被原生
|
||||
`packImage cannot modify linked library images` 拒绝。课程通过导入 RE 派生的本地 PNG 并设为
|
||||
Base Color 来绘制;后续可加“Make Local”入口。
|
||||
- Compositor 画布、GN 画布、Spreadsheet 尚未实现;课程/视频尚未开始。
|
||||
- GN 画布节点位置目前只在会话内保存;`GeometryNodeIR` 尚无 `location`,原生 writer/reader 未写
|
||||
`locx/locy`,保存重开保留节点/连线但不保留布局。Properties 表单与画布各自持有 draft,未完全共享。
|
||||
- Compositor 画布、Spreadsheet 尚未实现;课程/视频尚未开始。
|
||||
- 本轮只验证 Chromium + RTX 4060;未验证其他浏览器。
|
||||
- 既有保存下载型 spec 尚未迁移;在迁移完成前不要把这些旧 spec 的失败当作产品回归。
|
||||
- 远端首次 wasm 加载 154–193 秒;课程录制只做本地,页面需提示首载时间。
|
||||
|
||||
Reference in New Issue
Block a user