- Implemented viewport.py for handling 3D view projections, gestures, and overlay drawing. - Created refine_image_selection.py to manage the refinement of gesture masks and output image bounds. - Added selection module with refine_selection.py to process and crop images based on alpha channel visibility. - Introduced __init__.py for selection module to expose refine_selection function.
2.0 KiB
2.0 KiB
1. AI 与业务模块命名
- 1.1 将
ai_job.py迁移为ai.py,并从image_interaction.py迁入draw_ai_setup()与draw_ai_property();运行相关 Operator 导入测试并用rg确认 AI 公共函数只定义于ai.py。 - 1.2 将
image_data.py、image_region.py、depth_data.py分别迁移为image.py、region.py、depth.py,保持函数体和签名不变;运行uv run pytest tests/test_image_data.py tests/test_cutout_geometry.py tests/test_cutout_objects.py验证行为。 - 1.3 将移除 AI UI 后的
image_interaction.py迁移为viewport.py,集中 View3D 坐标投影、点击解析、工具设置、手势与 Overlay 绘制;运行uv run pytest tests/test_cutout_interaction.py tests/test_blender_addon.py验证视口交互函数和模块导入。
2. Material 与 Object 边界
- 2.1 建立
material.py,从object.py迁移材质颜色空间、Node Group、材质构建和 Displacement 配置函数;运行uv run pytest tests/test_image_data.py tests/test_cutout_objects.py验证材质结果。 - 2.2 收窄
object.py为 Object 与 Modifier 构建收尾,并保持node.py不变;运行 Object、Convert to Plane 与 Cutout 相关测试验证 Modifier 输入和结果 Object。
3. 调用方、文档与验证
- 3.1 更新
operators/、menu.py和测试的全部直接导入,删除ai_job.py、image_data.py、image_region.py、image_interaction.py与depth_data.py;使用rg确认不存在旧模块导入、重导出或兼容转发。 - 3.2 更新 Common 模块结构测试,验证八个目标模块可导入、AI UI 定义位置唯一且
common/__init__.py不重导出;运行该测试确认边界规则生效。 - 3.3 按八个业务模块更新
docs/internals/common.md和docs/internals/architecture.md;人工核对文档索引与生产源码一致,不构建文档产物。 - 3.4 运行
uv run pytest完成全量回归,确认所有 Operator、Job、节点资产、打包和文档检查通过。