Files
AnyImage/tools/node_assets/plane_layouts.py
nan 4c902ed7db feat(node_assets): add image plane geometry nodes and validation scripts
- Implemented `image_plane.py` to build the Image Plane Geometry Nodes group with customizable parameters for geometry, subdivide, and thickness.
- Created `image_plane_validation.py` to validate the functionality of the image plane, ensuring correct geometry generation and material assignment.
- Developed `material_layers.py` to construct shader node groups for image materials, including depth and normal handling.
- Authored `plane_layouts.py` to define node arrangements for image geometry assets.
- Introduced `shadeless.py` to create a shadeless shader node group that displays color without scene lighting while preserving shadows and reflections.
2026-09-08 23:24:27 +08:00

119 lines
4.2 KiB
Python

"""Authored processing stages for the shared image geometry assets."""
from node_layout import arrange_nodes
LAYOUTS = {
"O Image Plane": (
{
"Bounding Box": (-2320, 440),
"Vector Math": (-2100, 650),
"Separate XYZ": (-1870, 650),
"Math": (-1870, 990),
"Math.001": (-1650, 850),
"Math.002": (-1430, 850),
"Math.003": (-1200, 850),
"Math.004": (-980, 850),
"Math.005": (-760, 850),
"Math.006": (-1650, 510),
"Math.007": (-1430, 510),
"Math.008": (-1200, 510),
"Math.009": (-980, 510),
"Math.010": (-760, 510),
"Grid": (520, 340),
"Position": (-950, -480),
"Separate XYZ.001": (-720, -480),
"Math.011": (-500, -340),
"Math.012": (-280, -340),
"Math.013": (-500, -610),
"Math.014": (-280, -610),
"Combine XYZ": (0, -340),
"Store Named Attribute": (770, 340),
"Vector Math.001": (740, 710),
"Vector Math.002": (960, 710),
"Transform Geometry": (1030, 340),
"Bounding Box.001": (-1170, -990),
"Vector Math.003": (-950, -990),
"Separate XYZ.002": (-720, -990),
"Bounding Box.002": (-330, 140),
"Vector Math.004": (-100, 140),
"Separate XYZ.003": (120, 270),
"Math.015": (-520, 1390),
"Math.016": (-290, 1390),
"Math.017": (-520, 1160),
"Math.018": (-290, 1160),
"Math.019": (-70, 1390),
"Math.020": (150, 1390),
"Math.021": (380, 1390),
"Math.022": (600, 1390),
"Math.023": (830, 1390),
"Math.024": (1050, 1390),
"Combine XYZ.001": (280, 0),
"Cube": (520, -170),
"Store Named Attribute.001": (770, -170),
"Transform Geometry.001": (1030, -170),
"Compare": (1320, 410),
"Switch": (1360, 0),
"Capture Attribute": (1320, -580),
"Join Geometry": (1720, 0),
"Set Material Index": (1940, 0),
"Delete Geometry": (2170, 0),
"Group Output": (2390, 0),
},
(
(("Bounding Box",), (-2550, 440)),
(("Math",), (-2100, 1020)),
(("Math.021",), (150, 1600)),
(("Combine XYZ.001",), (120, 60)),
(("Compare",), (1140, 540)),
(("Capture Attribute",), (1140, -580)),
(("Bounding Box.001",), (-1390, -990)),
(("Bounding Box.002",), (-550, 140)),
),
),
"O Image Depth Plane": (
{
"Group": (0, 0),
"Transform Geometry": (520, 0),
"Set Position": (2470, 0),
"Set Shade Smooth": (2730, 0),
"Group Output": (2990, 0),
"Math": (60, 340),
"Combine XYZ": (240, 340),
"Named Attribute": (240, -450),
"Image Texture": (460, -450),
"Separate XYZ": (640, -450),
"Math.001": (820, -450),
"Math.002": (1000, -450),
"Math.003": (1180, -450),
"Math.004": (1180, -660),
"Math.005": (1380, -450),
"Math.006": (1740, -1060),
"Switch": (1760, -450),
"Position": (820, -820),
"Separate XYZ.001": (1000, -820),
"Math.007": (1180, -820),
"Math.008": (1380, -820),
"Math.009": (1560, -820),
"Switch.001": (1760, -820),
"Math.010": (1970, -520),
"Combine XYZ.001": (2150, -520),
},
(
(("Group",), (-240, 0)),
(("Math",), (-120, 340)),
(("Image Texture",), (240, -310)),
(("Math.001",), (640, -310)),
(("Math.002", "Math.003"), (820, -590)),
(("Math.004",), (1000, -660)),
(("Math.006",), (1560, -1060)),
(("Math.007",), (1000, -980)),
),
),
}
def layout_geometry(group):
"""Apply the authored layout for one geometry asset."""
positions, inputs = LAYOUTS[group.name]
arrange_nodes(group, positions, inputs)