feat(selection): separate selection geometry from image content processing

- Introduced a new design for selection rasterization that decouples the selection geometry from the image content, ensuring that the SelectionMask is independent of the source image's alpha and color.
- Updated the `rasterize_selection_path` function to only accept selection paths and image dimensions, removing parameters related to source alpha and alpha thresholds.
- Implemented a new approach for handling selection paths using non-zero winding fill, ensuring overlapping areas are preserved.
- Enhanced performance by utilizing a scanline algorithm for rasterization, significantly reducing processing time for high-resolution images.
- Updated internal documentation and added comprehensive tests to validate the new behavior and performance improvements.
- Ensured backward compatibility by maintaining existing interfaces where necessary while introducing breaking changes in the selection processing logic.
This commit is contained in:
2026-09-01 22:36:20 +08:00
parent 2ff7b04f56
commit 7f6e47432e
54 changed files with 2831 additions and 634 deletions

View File

@@ -1,33 +0,0 @@
# 五分钟上手
这个流程会把一张静态图片转换为可继续编辑的 Depth Plane。
## 1. 导入图片
在 3D View 中选择 **Add > Image > Reference**,导入一张主体清晰、前后关系明确的图片。Blender 会创建一个 Image Empty。
## 2. 检查深度设置
打开 **Edit > Preferences > Extensions > AnyImage**。第一次使用建议保持默认:
- **Depth & Normal Model**:MoGe-2 ViT-S Normal
- **MoGe Resolution Level**:5
- **Device**:使用自动列出的首选设备
转换直接使用这些扩展级默认值。
## 3. 开始转换
选中 Image Empty,在 3D View 中右键选择 **AnyImage > Convert to Depth Plane**。如果环境或必需模型尚未就绪,AnyImage 会先引导完成安装或下载。
任务运行时,状态栏会显示准备输入、模型推理和结果导入进度。转换完成后,源 Image Empty 会被新的网格对象替代。
## 4. 调整结果
打开对象的 `O Image Depth Plane` Geometry Nodes 修改器:
- **Subdivide** 控制网格密度;
- **Thickness** 增加背面和侧壁,`0` 保持单面;
- **Depth Amount** 控制深度位移强度。
建议先用较低 Subdivide 调整 Depth Amount,再按成品需要增加细分。