Files
workinf_Blender_Wasm/docs/status/N-016.md
2026-08-14 18:08:29 -04:00

63 lines
4.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# N-016 Grease Pencil
状态:`BLOCKED`(协议、有限 reader/Main transaction、当前帧及相邻帧 onion preview 已落地;
完整 2D canvas/Dope 编辑、modifier 语义和桌面 golden 仍阻断)
## 已验证切片
1. N-016-ASceneIR 中提供 Layer/Frame/Drawing/Stroke/Point/Attribute schema校验
finite position、radius、opacity、vertex color、cyclic、material index并以
1024 layer、100k frame、1M stroke、1M point、65,536 attribute 预算拒绝越界输入。
超预算只允许 `blocked + GREASE_PENCIL_BUDGET_EXCEEDED` 摘要。
2. N-016-ABlender 5.2 Main reader 输出真实 Grease Pencil layer/frame/drawing/stroke
数据,稳定映射 `grease-pencil:*``grease-pencil-layer:*` ID对象 dataId 不再降级
为 Empty。
3. N-016-BMain 支持有界 create/remove/reorder layer、insert/remove frame以及整帧
`setGreasePencilStrokes` transaction空 stroke 数组用于擦除)。命令要求单用户数据块,
使用既有 authoritative Main、undo/redo 和 save/reopen 流程。
4. N-016-C部分radius、opacity、vertex color、cyclic stroke 和 material index
已读写;开启 layer onion skin 时只取最近前一帧和后一帧,使用独立色调、透明材质和关闭
depth write 的有界 preview当前 drawing 不被替换。
5. N-016-D部分共享 Three.js 适配器按当前 frame 选择每个可见 layer 最近的有效
drawing渲染真实 3D stroke/闭环Chromium 主线程与 OffscreenCanvas 均通过非空像素门。
6. N-016-Deditor 部分editor context schema 绑定 data/layer/frame、onion 开关、stroke/
point selection 和 revision拒绝 stale/重复/超 1M selectionProperties 面板已连接真实 Main
layer create/remove、当前 frame insert/remove 和整帧 clear transaction。完整 2D stroke/point
画布选择和 dope sheet integration 仍阻断。
7. N-016-D点编辑部分Properties 面板可在当前 layer/frame 选择实际 stroke/point执行
有界 X 轴平移;协议先校验 point identity、revision、有限坐标和 1M 点预算,再保留 radius、
opacity、vertex color、cyclic、material index 并合并为一个 `setGreasePencilStrokes` Main
transaction。它是点级整帧原子写回不等同于完整 2D 画布选择或连续 gizmo。
8. N-016-D视口点编辑部分当前 drawing 为每条 stroke 建立独立 Three `Points` 代理,
主线程和 OffscreenCanvas 使用 data/layer/frame/stroke/point 五级身份 raycastEdit Mode
可高亮、Shift/Ctrl 多选同一 drawing 的点,并由轴向 gizmo 合并为一个 revision-bound
`setGreasePencilStrokes` Main transaction。跨 drawing 追加会重置选择,避免错误混写。
9. N-016-D连续预览部分轴向 gizmo 的 pointer move 从当前 SceneIR 绝对计算选中点坐标,
同时更新真实 stroke 线和隐藏 point raycast proxypointer cancel/commit 均恢复预览基线,
pointer up 才提交一次 Main。主线程与 OffscreenCanvas 重复回归一致。
10. N-016-D时间线部分现有 Dope Sheet 在活动 Grease Pencil 对象上显示真实 layer drawing
frame 并通过既有 `setFrame` Main 命令导航;不提供帧拖拽、重排或插值伪语义。
11. N-016-D重启部分真实 Grease Pencil fixture 经首个 WebEngine Worker 点编辑和 `.blend`
保存后,终止 Worker 并由全新 Worker 重开data/layer/drawing identity、位置、radius、opacity
均重新解析验证。
## 仍然阻断
- N-016-Cmaterial datablock 事务、onion fade/range 完整语义和完整 Grease Pencil modifier reader。
- N-016-D完整 2D canvas/marquee 和完整 timeline/dope 编辑3D current-frame 点 raycast、
多点高亮、连续 preview、单次 gizmo commit、有界 drawing frame 导航和 worker restart 已完成。
- N-016-Edesktop drawing hash、Chromium 像素 golden、GLB/USD loss report 和 OPFS。
## 验收
```bash
npm --prefix web run typecheck
npm --prefix web run lint
npm --prefix web run test:grease-pencil
WEB_TEST_PORT=5205 npm --prefix web run test:grease-pencil-editor
WEB_TEST_PORT=5202 npm --prefix web run test:e2e -- --grep "N-016 Grease Pencil"
```
`test:grease-pencil` 使用 `modifier_grease_pencil_scene.blend`,覆盖 reader、layer/frame/stroke
Main transaction、undo/redo 和保存重开。它不替代桌面 drawing hash。