Files
AnyImage/docs/guides/cutout.md
nan 32bcd45d7b Add new node asset scripts for geometry and shader operations
- Implemented `build_mesh_plane.py` to create a geometry node group for mesh planes with customizable parameters.
- Created `build_shadeless.py` for a shader node group that displays color without scene lighting while preserving shadows and reflections.
- Added `validate.py` to validate the integrity of the newly created node groups and their inputs.
- Introduced `validate_cutout.py` to ensure the functionality of cutout node groups and their dependencies.
- Developed `validate_mesh_plane.py` to test the mesh plane creation and its modifier settings.
2026-08-30 00:17:29 +08:00

4.2 KiB
Raw Blame History

Cutout

Cutout 用套索从一张 Image Empty 中选择区域,再生成 Surface、Balloon、Depth Balloon 或 Depth Surface。它适合从图片局部制作薄片、鼓包或带透视深度的网格。

创建

  1. 在 Object Mode 的 3D Viewport 左侧工具栏选择 Cutout。
  2. 沿 Image Empty 按住左键绘制;双击图片可选择完整画面。
  3. 松开左键后,从饼菜单选择 Shape。

绘制时按 F 切换反选,右键或 Esc 取消。Cutout 使用非零环绕填充:反向绘制的内环可以形成孔洞。

选择 Shape

Shape 结果特点 是否需要深度模型
Surface 保持平面轮廓,可增加真实厚度 否
Balloon 按轮廓平滑鼓起 否
Depth Balloon 在 Balloon 上加入图片深度高度 是,固定使用 MoGe-2
Depth Surface 使用相机点形成透视表面 是,使用 Preferences 中的 Mesh Depth Model

四种结果都保留源 Image Empty,并在同一位置创建新网格。它们共享选区轮廓、UV、材质和基础三角网格,因此可以从同一张图多次生成不同 Shape 进行比较。

无论是否启用 Refine Selection,套索超出图片的部分都不会生成网格,源图中 Alpha <= 0.1 的像素也始终从几何中排除。双击选择完整画面时同样只为 Alpha > 0.1 的区域生成网格。

工具设置

  • Point Spacing:相邻网格点大约对应多少源图像素。数值越小,网格越密,轮廓和变形细节越多。
  • Normal:使用 MoGe-2 生成法线贴图。默认关闭。
  • Refine Selection:用 BEN2 把几何套索收紧到其中的前景内容。默认关闭。

Surface 与 Balloon 在 Normal、Refine 都关闭时完全在 Blender 中生成,不需要 AI Environment。开启任一 AI 选项,或选择 Depth Shape 时,会提交后台任务。

Point Spacing 先按完整源图换算基础密度;选区裁切后的长边若超过全局 Maximum AI Input Size,网格密度会按分析图的等比缩放比例降低。颜色贴图始终保留原裁切分辨率,不会使用限制后的临时分析图。建议先用默认 32 观察形状;轮廓需要更细时再逐步减小。

调整修改器

四个 Shape 都使用同一个 O Image Cutout Geometry Nodes 修改器。创建时 Shape 菜单已经设为饼菜单所选类型;切换 Shape 后,Blender 只显示该类型实际使用的输入。常用参数包括:

  • Thickness:Surface / Depth Surface 使用场景距离;Balloon / Depth Balloon 使用鼓起高度倍率。
  • Cleanup:绝对面积阈值;创建时根据 Point Spacing 和图片平面尺寸自动写入,面积小于该值的 Mesh Island 会在生成任意 Shape 前移除。
  • Smooth Iterations:位于外层,控制平滑次数,默认 0;Smooth 位于 Options 中,控制每次平滑的混合强度。四种 Shape 都可使用。
  • Depth Scale:Depth Shape 的深度强度;0 回到基础平面或 Balloon。

两个 Depth Shape 共用 Reference Depth;Depth Balloon 还提供 Depth Direction。插件自动写入的 Depth Image 与 Uniform Scale 位于折叠的 Data 面板,一般无需手动修改。

Balloon 的轮廓高度算法由扩展 Preferences 中的 Balloon Profile 控制:Poisson 更平滑,Teddy 更强调轮廓骨架。修改默认值只影响之后创建的 Shape。

Refine 与 Normal

Refine Selection 只在“套索与源图可见 Alpha 的交集”内收紧用于建网格的最终选择,不把 AI 生成的颜色写回原图。材质继续使用当前 Image Empty 的源颜色和原 Alpha。

Normal 关闭时使用几何法线;开启后,Surface、Balloon 与 Depth Balloon 使用适配成品网格的 Tangent Space 法线,Depth Surface 使用 Object Space 法线。Cutout 始终使用 MoGe-2;Depth 与 Normal 同时需要时共享同一次 Prediction,不会重复运行模型。

当前范围

Cutout 只支持静态图片。图片工具创建的透明结果和 Upscale 结果都可以继续作为输入;Cutout 始终以当前 Image Empty 的实际图片为颜色来源。

轮廓、深度场、节点资产与法线空间的实现见 Cutout Tool 实现原理。