- 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.
83 lines
3.1 KiB
Python
83 lines
3.1 KiB
Python
"""Place projection fields above the rectangular surface and shell stages."""
|
|
|
|
from cutout_layout import route_geometry, layout_stage
|
|
|
|
|
|
def layout_camera_plane(group, previous):
|
|
stage = layout_stage(group, previous, {
|
|
"Group": (0, 0),
|
|
"Named Attribute": (-240, 760),
|
|
"Image Texture": (0, 760),
|
|
"Vector Math": (220, 760),
|
|
"Separate XYZ": (440, 760),
|
|
"Math": (660, 980),
|
|
"Math.001": (1320, 980),
|
|
"Math.002": (660, 620),
|
|
"Combine XYZ": (880, 760),
|
|
"Position": (880, 420),
|
|
"Mix": (1100, 760),
|
|
"Separate XYZ.001": (1320, 760),
|
|
"Combine XYZ.001": (1540, 880),
|
|
"Set Position": (1760, 0),
|
|
"Position.001": (1760, 400),
|
|
"Store Named Attribute": (2020, 0),
|
|
"Vector Math.001": (2020, 400),
|
|
"Set Position.001": (2280, 0),
|
|
"Index": (2280, 400),
|
|
"Store Named Attribute.001": (2540, 0),
|
|
"Combine XYZ.002": (3970, 820),
|
|
"Integer Math": (3750, 1220),
|
|
"Named Attribute.001": (3500, 1220),
|
|
"Integer Math.001": (3750, 980),
|
|
"Named Attribute.002": (3500, 980),
|
|
"Extrude Mesh": (2820, 0),
|
|
"Combine XYZ.003": (2540, 440),
|
|
"Separate Geometry": (3090, 0),
|
|
"Combine XYZ.004": (2820, -350),
|
|
"Set Position.002": (3090, -350),
|
|
"Flip Faces": (3370, -350),
|
|
"Flip Faces.001": (3370, 0),
|
|
"Join Geometry": (3650, 0),
|
|
"Set Position.003": (3970, 0),
|
|
"Merge by Distance": (4230, 0),
|
|
"Normal": (1540, -340),
|
|
"Blur Attribute": (1760, -340),
|
|
"Vector Math.003": (2020, -340),
|
|
"Store Named Attribute.002": (2020, 0),
|
|
"Vector Math.004": (4990, 700),
|
|
"Named Attribute.004": (4710, 1080),
|
|
"Position.002": (4230, 700),
|
|
"Separate XYZ.002": (4450, 700),
|
|
"Math.003": (4710, 700),
|
|
"Vector Math.002": (5210, 700),
|
|
"Named Attribute.003": (4990, 1080),
|
|
"Set Position.004": (5430, 0),
|
|
"Position.003": (3500, 620),
|
|
"Separate XYZ.003": (3750, 620),
|
|
"Math.004": (5430, 500),
|
|
"Switch": (5700, 0),
|
|
"Remove Named Attribute": (5960, 0),
|
|
"Set Shade Smooth": (6220, 0),
|
|
"Group Output": (6480, 0),
|
|
}, (
|
|
(("Group",), (-250, 0)),
|
|
(("Image Texture",), (-240, 1100)),
|
|
(("Vector Math",), (0, 1100)),
|
|
(("Math",), (440, 1120)),
|
|
(("Math.001", "Mix"), (880, 1160)),
|
|
(("Math.003",), (4450, 1040)),
|
|
(("Math.004",), (5210, 500)),
|
|
(("Blur Attribute",), (1540, -540)),
|
|
))
|
|
for name, node in stage.items():
|
|
if node.location.x >= 2020 and name not in {
|
|
"Store Named Attribute.002", "Vector Math.003"
|
|
}:
|
|
node.location.x += 260
|
|
base = route_geometry(group, stage["Store Named Attribute.001"].outputs["Geometry"],
|
|
((2770, 180), (3600, 180)))
|
|
group.links.new(base, stage["Join Geometry"].inputs["Geometry"])
|
|
bypass = route_geometry(group, stage["Set Position"].outputs["Geometry"],
|
|
((1970, -760), (5650, -760)))
|
|
group.links.new(bypass, stage["Switch"].inputs["False"])
|