Files
AnyImage/openspec/changes/standardize-blender-object-coordinates/proposal.md
nan 4035f5c9e4 Refactor geometry generation to standardize Blender object coordinates
- Unified the canonical local frame for generated geometries (Plane, Depth Plane, Relief Plane, Cutout, Depth Cutout) to align with Blender's object coordinate system, setting X as horizontal, Z as up, and +Y as depth.
- Removed the `Depth Axis` parameter from `O Image Cutout` and `O Image Depth Cutout`, simplifying the geometry generation process.
- Updated the depth direction defaults to use +Y instead of -Z for `O Image Relief Plane` and Depth Symmetry.
- Adjusted the geometry nodes to ensure thickness, projection, and shell displacements operate along the Y-axis.
- Implemented new capabilities for handling object space normals to align with the new canonical frame.
- Enhanced the Depth Symmetry functionality to mirror across the canonical Y-axis and perform a final rotation to maintain the correct orientation.
- Added tests to validate the new coordinate system and ensure compatibility with existing assets.
2026-09-15 13:33:37 +08:00

29 lines
2.0 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.
## Why
AnyImage 生成对象的局部坐标系仍沿用 Image Empty 的 `XY + depth -Z`,与 Blender 常规对象坐标 `up=Z`、`front=-Y` 不一致。Cutout 因此需要额外的 `Depth Axis` 来把结果转到左右轴,但没有真正解决对称轴、深度方向和 Object Space Normal 的耦合问题。
## What Changes
- 统一所有生成几何的 canonical local frame:X 为图片水平、Z 为图片 up、+Y 为图片纸内深度、front 为 -Y。
- BaseShape 与 Plane、Depth Plane、Relief Plane、Cutout、Depth Cutout 的未修改网格统一位于 XZ 平面,`Y=0`。
- **BREAKING**:删除 `O Image Cutout` 与 `O Image Depth Cutout` 的 `Depth Axis` 输入及最终轴向旋转逻辑。
- `O Image Cutout Symmetry` 在 canonical 坐标中沿 Y 轴镜像,最后绕 Z 旋转使对称轴指向 +X,并保持 up=+Z。
- Depth Symmetry 最终对象允许 front 从 -Y 改变为 -X,以换取左右对称轴为 X。
- Object Space Normal 的生成与着色转换随新 canonical frame 和最终对称朝向同步调整。
## Capabilities
### New Capabilities
- `canonical-object-frame`: 定义所有生成几何共用的 Blender 对象局部坐标系、BaseShape 平面、UV 映射与深度方向。
- `depth-symmetry-orientation`: 定义 Depth Symmetry 的 canonical 镜像轴、最终对称轴和 up 轴约束,以及允许 front 改变的最终朝向。
- `object-space-normal-alignment`: 定义 Object Space Normal 如何随 canonical frame、Depth Symmetry 镜像与最终朝向保持对齐。
### Modified Capabilities
无。当前 `openspec/specs/` 中没有既有 capability 规格。
## Impact
影响 `src/anyimage/operators/cutout_tool/geometry.py`、`object.py`、`depth_calibration.py`,`src/anyimage/operators/convert_to_plane/`,`tools/nodes/groups/` 下的 Plane、Depth Plane、Relief Plane、Cutout、Depth Cutout、Symmetry 与材质节点,`tools/nodes/common/` 的深度表面、Cutout 和法线映射辅助,以及相关测试与 `src/anyimage/assets/O_AnyImage.blend`。不新增依赖。