- 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.
48 lines
1.2 KiB
Python
48 lines
1.2 KiB
Python
from pathlib import Path
|
|
import sys
|
|
|
|
import bpy
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).parents[2]
|
|
sys.path.insert(0, str(Path(__file__).parent))
|
|
sys.path.insert(0, str(PROJECT_ROOT / "src"))
|
|
sys.path.insert(
|
|
0,
|
|
str(next((PROJECT_ROOT / "src" / "anyimage" / "wheels").glob("blendjob-*.whl"))),
|
|
)
|
|
|
|
from cutout import (
|
|
CUTOUT_NODE_GROUP_NAMES,
|
|
build_cutout_group,
|
|
)
|
|
from depth_plane import build_depth_plane_group
|
|
from material_layers import build_material_layer_group
|
|
from image_plane import build_image_plane_group
|
|
from shadeless import build_shadeless_group
|
|
OUTPUT_PATH = (
|
|
PROJECT_ROOT
|
|
/ "src"
|
|
/ "anyimage"
|
|
/ "assets"
|
|
/ "O_AnyImage.blend"
|
|
)
|
|
|
|
|
|
def main():
|
|
bpy.ops.wm.read_factory_settings(use_empty=True)
|
|
bpy.context.preferences.filepaths.save_version = 0
|
|
image_plane = build_image_plane_group()
|
|
build_depth_plane_group(image_plane)
|
|
build_material_layer_group()
|
|
build_material_layer_group(depth_plane=True)
|
|
build_shadeless_group()
|
|
for shape in CUTOUT_NODE_GROUP_NAMES:
|
|
build_cutout_group(shape)
|
|
OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True)
|
|
bpy.ops.wm.save_as_mainfile(filepath=str(OUTPUT_PATH), check_existing=False)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|