Add new functionality for image rectification and depth metadata handling

- Implemented a preview tool for rectifying images with interactive aspect controls in `preview.py`.
- Added tests for depth metadata loading to ensure consistent schema usage in `test_depth_metadata.py`.
- Developed comprehensive tests for cutout calibration processes in `test_cutout_calibration.py`, including stability checks and depth calibration.
- Created tests for frame compositing operations in `test_frame_compositing.py`, ensuring correct handling of depth and transparency.
- Introduced material slot inheritance functionality in `material_slots.py` to manage geometry material assignments.
- Built shared shader nodes for material processing in `shader.py`, including roughness and bump mapping setups.
This commit is contained in:
2026-09-12 19:20:06 +08:00
parent e8268504c2
commit 938d95db0f
175 changed files with 3812 additions and 6864 deletions

View File

@@ -1,23 +1,21 @@
# Plane 转换
`operators/convert_to_plane/operators.py` 提供 `ConvertToPlane`、`ConvertToDepthPlane` 与 `GenerateDepthPlane`。对象和材质导入位于 `object.py`,基础矩形网格位于 `image_plane.py`。
`operators/convert_to_plane/operators.py` 提供 `ConvertToPlane`、`ConvertToDepthPlane`、`ConvertToReliefPlane` 与 `GenerateDepthPlane`。`object.py` 导入对象和材质,`image_plane.py` 构建基础矩形网格,`__init__.py` 汇总导出与注册清单。
```mermaid
flowchart TD
A[Image Empty] --> B{转换类型}
B -- Plane --> C[复制 Color 与动画设置]
C --> D[中心原点四边形与 O Image Plane]
B -- Depth Plane --> E[检查静态图与 AI 就绪状态]
E --> F[generate-depth-plane-geometry]
F --> G[Color、depth.exr、depth.json、Tangent Normal]
G --> H[加载并 Pack 数据]
H --> I[O Image Depth Plane 与材质]
D --> J[替换源 Empty 并保留世界位置]
I --> J
A[Image Empty] --> B[准备材质颜色]
B --> C{转换类型}
C -- Plane --> D[四边形与 O Image Plane]
C -- Depth 或 Relief --> E[静态图提交几何 Job]
E --> F[加载深度、元数据与法线]
F --> G[对应节点修改器与材质]
D --> H[创建对象并替换源 Empty]
G --> H
```
普通 Plane 支持图片、视频和序列,材质保留 Image User 帧设置。基础四边形以局部中心为原点,对象矩阵补偿原 Image Empty 显示范围;节点组生成细分与厚度,材质位于 Mesh 第 0 个槽。
普通 Plane 支持图片、视频和序列,材质保留 Image User 帧设置。基础网格以局部中心为原点,对象矩阵补偿源 Empty 的显示范围。
Depth Plane 从 Preferences 取得 MoGe-2 模型、分辨率级别与 AI 输入上限,一次推理生成相机 XYZ 深度和切线法线。`create_depth_plane_from_result()` 创建颜色材质与深度修改器,并在失败时清理未使用的数据块。
Depth 与 Relief 从 Preferences 读取几何模型、分辨率级别和 AI 输入上限。`create_depth_plane_from_result()` 导入产物并创建修改器。`O Image Depth Plane` 使用相机 XYZ 与对象空间法线构建深度表面;`O Image Relief Plane` 使用深度 Z 与切线空间法线构建浮雕。
`O Image Depth Plane` 提供默认 Relief 和 Camera:Relief 读取深度 Z 形成固定底面的地形;Camera 使用相机 XYZ 投影并沿平滑法线形成壳。两个模式各自保存 Thickness。完整接口见[节点资产](../node-assets.md),文件协议见[Job 产物](../outputs.md)。
节点构建见[节点资产](../node-assets.md),文件协议见[Job 产物](../outputs.md)。