Files
AnyImage/openspec/changes/configure-material-view-adaptation/tasks.md
nan 7e55af6722 Add comprehensive tests for edge depth extension, empty image edits, and material view adaptation
- Introduced `test_edge_depth.py` to validate the functionality of edge depth extension, ensuring core alpha preservation, proper depth handling, and edge padding behavior.
- Created `test_empty_image_edits.py` to verify the behavior of image edits in Blender, focusing on shared edits, preservation of image properties, and handling of failed operations.
- Developed `test_material_view_adaptation.py` to test material adaptation preferences, ensuring color space and alpha settings are correctly applied and preserved across various scenarios.
2026-09-06 21:43:47 +08:00

33 lines
2.7 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.
## 1. 着色偏好
- [x] 1.1 在 `preferences.py` 增加默认关闭的 `adapt_material_to_view_transform`、统一读取入口和 Shading 分组。
- [x] 1.2 补充偏好默认值、读取回退、UI 展示测试,并检查 `__init__.py` 注册和逆序注销。
## 2. 材质配置
- [x] 2.1 在 `common/material.py` 集中颜色空间与 Alpha 配对:inverse + STRAIGHT,sRGB + PREMUL;实现映射、回退和设置失败处理。
- [x] 2.2 在材质专属配置入口设置 Alpha,复用现有业务像素读取能力,验证颜色空间与 Alpha 连续切换的数据完整性。
- [x] 2.3 接入公共材质与剪贴板 Mesh 入口,审查 Plane、Depth Plane、Cutout 的独立 Color 所有权及最终交付模式。
- [x] 2.4 确保新建材质使用独立 Color 图片,隔离共享源对已有材质及其他用途的影响。
## 3. 验证
- [x] 3.1 覆盖开关两种状态、全部既有视图映射、Standard、场景缺失、inverse 不可用及 sRGB 设置失败。
- [x] 3.2 覆盖各材质入口及 Shadeless,验证切换偏好后已有材质 Color 保持原值,新建材质读取当前设置,创建和回退均保持偏好值。
- [ ] 3.3 更新现有材质 PREMUL 断言,验证 byte、float、generated、dirty、packed Color 的 RGB/Alpha、透明 RGB、Pack、保存重载和再次编辑。
- [x] 3.4 在实际 Blender 中用半透明边缘复核 inverse + STRAIGHT 与 sRGB + PREMUL 的效果,并记录验证结果。
- [x] 3.5 运行 `uv run pytest`,修复相关回归。
- [x] 3.6 验证仅材质 Color 受影响:共享源、Empty、Mask/Frame/Rectify、图片编辑 Job、Depth、Normal 和非目标材质保持原有行为与数据。
## 4. 规格收敛
- [ ] 4.1 归档时协调 `enable-image-alpha-blending-and-premul` 的 Mesh Color 需求,使最终主规格统一采用本变更的颜色空间与 Alpha 配对。
## 验证记录
2026-09-05:`uv run --no-sync pytest -q --tb=short`:562 passed、2 xfailed、56 subtests passed。`--no-sync` 使用本轮已同步的项目环境。OpenSpec strict 校验通过。
Blender 4.5.3 LTS / Cycles CPU、AgX、16 samples:渲染 64×64 橙色圆形贴图的渐变 Alpha 边缘,192×192 输出。sRGB + PREMUL 和 AgX Base sRGB + STRAIGHT 均正常显示连续半透明边缘;后者中心色更接近输入橙色。该检查确认两种策略可用。
3.3 部分完成:byte、generated byte、dirty、文件和 packed 图片的业务像素及保存重载通过;原生浮点图片在保存重载后的 RGB 不满足原值断言,两种设置均可复现,已用严格 xfail 保留检查。即时配置和共享源保留通过。此项尚未解决,因此保留未完成状态。4.1 留待归档阶段处理。