From a4b73b56c41f12d1107d9b4c1880801d0e223bd5 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Sat, 27 Jul 2024 23:25:18 -0400 Subject: [PATCH 01/15] Update to python==3.11 bpy==4.2 --- .github/workflows/checks.yml | 4 +-- Dockerfile | 2 +- docs/Installation.md | 2 +- .../constraint_language/geometry.py | 2 +- infinigen/core/execute_tasks.py | 2 +- pyproject.toml | 5 ++-- scripts/install/interactive_blender.sh | 26 +++++++++---------- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6d962e8fd..97b46fc08 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -36,10 +36,10 @@ jobs: # default set of ruff rules with GitHub Annotations ruff check --output-format=github . - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Install infinigen & dependencies run: | diff --git a/Dockerfile b/Dockerfile index 37cca12c5..a51b9547d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,6 @@ WORKDIR /opt/infinigen COPY . . RUN conda init bash && \ . ~/.bashrc && \ - conda create --name infinigen python=3.10 -y && \ + conda create --name infinigen python=3.11 -y && \ conda activate infinigen && \ pip install -e ".[dev]" diff --git a/docs/Installation.md b/docs/Installation.md index 1fbad7bf8..a7d9ac7e1 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -61,7 +61,7 @@ First, download the repo and set up a conda environment (you may need to [instal ```bash git clone https://github.com/princeton-vl/infinigen.git cd infinigen -conda create --name infinigen python=3.10 +conda create --name infinigen python=3.11 conda activate infinigen ``` diff --git a/infinigen/core/constraints/constraint_language/geometry.py b/infinigen/core/constraints/constraint_language/geometry.py index 5448d4982..aa15002d6 100644 --- a/infinigen/core/constraints/constraint_language/geometry.py +++ b/infinigen/core/constraints/constraint_language/geometry.py @@ -20,7 +20,7 @@ class center_stable_surface_dist(ScalarExpression): class accessibility_cost(ScalarExpression): objs: ObjectSetExpression others: ObjectSetExpression - normal: np.array = field(default=np.array([1, 0, 0])) + normal: np.array = field(default_factory=lambda: np.array([1, 0, 0])) dist: float = 1.0 def __post_init__(self): diff --git a/infinigen/core/execute_tasks.py b/infinigen/core/execute_tasks.py index 1436b5b13..a7d8e53d9 100644 --- a/infinigen/core/execute_tasks.py +++ b/infinigen/core/execute_tasks.py @@ -347,7 +347,7 @@ def execute_tasks( def main(input_folder, output_folder, scene_seed, task, task_uniqname, **kwargs): - version_req = ["3.6.0"] + version_req = ["3.6.0", "4.2.0"] assert bpy.app.version_string in version_req, ( f"You are using blender={bpy.app.version_string} which is " f"not supported. Please use {version_req}" diff --git a/pyproject.toml b/pyproject.toml index 5f9a973eb..0ad95e6ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,12 +17,11 @@ keywords = [ classifiers = [ "Framework :: Blender", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10" ] -requires-python = "==3.10.*" +requires-python = "==3.11.*" dependencies = [ - "bpy==3.6.0", + "bpy==4.2.0", "frozendict", # TODO remove "geomdl", # used only for creatures "gin_config>=0.5.0", diff --git a/scripts/install/interactive_blender.sh b/scripts/install/interactive_blender.sh index a64fb9ad4..495cecc60 100644 --- a/scripts/install/interactive_blender.sh +++ b/scripts/install/interactive_blender.sh @@ -12,33 +12,33 @@ OS=$(uname -s) ARCH=$(uname -m) if [ "${OS}" = "Linux" ]; then - BLENDER_WGET_LINK='https://download.blender.org/release/Blender3.6/blender-3.6.0-linux-x64.tar.xz' + BLENDER_WGET_LINK='https://download.blender.org/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz' BLENDER_WGET_FILE='blender.tar.xz' - BLENDER_UNTAR_DIR='blender-3.6.0-linux-x64' + BLENDER_UNTAR_DIR='blender-4.2.0-linux-x64' BLENDER_DIR='blender' - BLENDER_PYTHON="${BLENDER_DIR}/3.6/python/bin/python3.10" - BLENDER_INCLUDE="${BLENDER_DIR}/3.6/python/include/python3.10" - BLENDER_PACKAGES="${BLENDER_DIR}/3.6/python/lib/python3.10/site-packages" - BLENDER_ADDONS="${BLENDER_DIR}/3.6/scripts/addons" + BLENDER_PYTHON="${BLENDER_DIR}/4.2/python/bin/python3.11" + BLENDER_INCLUDE="${BLENDER_DIR}/4.2/python/include/python3.11" + BLENDER_PACKAGES="${BLENDER_DIR}/4.2/python/lib/python3.11/site-packages" + BLENDER_ADDONS="${BLENDER_DIR}/4.2/scripts/addons" BLENDER_EXE="${BLENDER_DIR}/blender" elif [ "${OS}" = "Darwin" ]; then if [ "${ARCH}" = "arm64" ]; then - BLENDER_WGET_LINK='https://download.blender.org/release/Blender3.6/blender-3.6.0-macos-arm64.dmg' + BLENDER_WGET_LINK='https://download.blender.org/release/Blender4.2/blender-4.2.0-macos-arm64.dmg' else - BLENDER_WGET_LINK='https://download.blender.org/release/Blender3.6/blender-3.6.0-macos-x64.dmg' + BLENDER_WGET_LINK='https://download.blender.org/release/Blender4.2/blender-4.2.0-macos-x64.dmg' fi BLENDER_WGET_FILE='blender.dmg' BLENDER_VOLM='/Volumes/Blender' BLENDER_DIR='./Blender.app' - BLENDER_PYTHON="${BLENDER_DIR}/Contents/Resources/3.6/python/bin/python3.10" - BLENDER_INCLUDE="${BLENDER_DIR}/Contents/Resources/3.6/python/include/python3.10" - BLENDER_PACKAGES="${BLENDER_DIR}/Contents/Resources/3.6/python/lib/python3.10/site-packages" - BLENDER_ADDONS="${BLENDER_DIR}/Contents/Resources/3.6/scripts/addons" + BLENDER_PYTHON="${BLENDER_DIR}/Contents/Resources/4.2/python/bin/python3.11" + BLENDER_INCLUDE="${BLENDER_DIR}/Contents/Resources/4.2/python/include/python3.11" + BLENDER_PACKAGES="${BLENDER_DIR}/Contents/Resources/4.2/python/lib/python3.11/site-packages" + BLENDER_ADDONS="${BLENDER_DIR}/Contents/Resources/4.2/scripts/addons" BLENDER_EXE="${BLENDER_DIR}/Contents/MacOS/Blender" else @@ -66,4 +66,4 @@ fi # Install Blender dependencies "${BLENDER_PYTHON}" -m ensurepip -CFLAGS="-I/usr/include/python3.10 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e . \ No newline at end of file +CFLAGS="-I/usr/include/python3.11 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e . \ No newline at end of file From 6638a815ccfedf8452b34050e0f1ce74c8336651 Mon Sep 17 00:00:00 2001 From: pvl-bot Date: Fri, 23 Aug 2024 10:49:53 -0400 Subject: [PATCH 02/15] Move addon calls --- infinigen/assets/objects/rocks/blender_rock.py | 2 -- infinigen/assets/scatters/snow_layer.py | 4 ---- infinigen/assets/utils/object.py | 12 ------------ infinigen/core/init.py | 15 ++++----------- .../tools/terrain/generate_terrain_assets.py | 2 -- tests/test_terrain_basic.py | 5 ++--- 6 files changed, 6 insertions(+), 34 deletions(-) diff --git a/infinigen/assets/objects/rocks/blender_rock.py b/infinigen/assets/objects/rocks/blender_rock.py index 52ae0aba3..aee61f6e2 100644 --- a/infinigen/assets/objects/rocks/blender_rock.py +++ b/infinigen/assets/objects/rocks/blender_rock.py @@ -12,8 +12,6 @@ from infinigen.core.tagging import tag_object from infinigen.core.util import blender as butil -bpy.ops.preferences.addon_enable(module="add_mesh_extra_objects") - class BlenderRockFactory(AssetFactory): def __init__(self, factory_seed, detail=1): diff --git a/infinigen/assets/scatters/snow_layer.py b/infinigen/assets/scatters/snow_layer.py index 7915effdd..3eb555feb 100644 --- a/infinigen/assets/scatters/snow_layer.py +++ b/infinigen/assets/scatters/snow_layer.py @@ -11,10 +11,6 @@ class Snowlayer: - def __init__(self): - bpy.ops.preferences.addon_enable(module="real_snow") - pass - def apply(self, obj, **kwargs): bpy.context.scene.snow.height = 0.1 with butil.SelectObjects(obj): diff --git a/infinigen/assets/utils/object.py b/infinigen/assets/utils/object.py index 2359010b4..219db59d2 100644 --- a/infinigen/assets/utils/object.py +++ b/infinigen/assets/utils/object.py @@ -205,15 +205,3 @@ def separate_loose(obj): objs.remove(obj) butil.delete(objs) return obj - - -def print3d_clean_up(obj): - bpy.ops.preferences.addon_enable(module="object_print3d_utils") - with butil.ViewportMode(obj, "EDIT"), butil.Suppress(): - bpy.ops.mesh.select_all(action="SELECT") - bpy.ops.mesh.quads_convert_to_tris(quad_method="BEAUTY", ngon_method="BEAUTY") - bpy.ops.mesh.fill_holes() - bpy.ops.mesh.quads_convert_to_tris(quad_method="BEAUTY", ngon_method="BEAUTY") - bpy.ops.mesh.normals_make_consistent() - bpy.ops.mesh.print3d_clean_distorted() - bpy.ops.mesh.print3d_clean_non_manifold() diff --git a/infinigen/core/init.py b/infinigen/core/init.py index 774d5958c..f78bf83fc 100644 --- a/infinigen/core/init.py +++ b/infinigen/core/init.py @@ -20,7 +20,7 @@ from numpy.random import randint import infinigen -from infinigen.core.util.logging import LogLevel, Suppress +from infinigen.core.util.logging import LogLevel from infinigen.core.util.math import int_hash from infinigen.core.util.organization import Task @@ -198,15 +198,6 @@ def find_config(p): ) -def import_addons(names): - for name in names: - try: - with Suppress(): - bpy.ops.preferences.addon_enable(module=name) - except Exception: - logger.warning(f'Could not load addon "{name}"') - - @gin.configurable def configure_render_cycles( # supplied by gin.config @@ -303,4 +294,6 @@ def configure_blender( bpy.context.scene.cycles.motion_blur_position = "START" bpy.context.scene.render.motion_blur_shutter = motion_blur_shutter - import_addons(["ant_landscape", "real_snow"]) + bpy.ops.preferences.addon_enable(module="add_mesh_extra_objects") + bpy.ops.preferences.addon_enable(module="real_snow") + bpy.ops.preferences.addon_enable(module="ant_landscape") diff --git a/infinigen/tools/terrain/generate_terrain_assets.py b/infinigen/tools/terrain/generate_terrain_assets.py index 2de487569..53cf14ff6 100644 --- a/infinigen/tools/terrain/generate_terrain_assets.py +++ b/infinigen/tools/terrain/generate_terrain_assets.py @@ -92,8 +92,6 @@ def asset_generation( parser.add_argument("--device", type=str, default="cpu") args = init.parse_args_blender(parser) - bpy.ops.preferences.addon_enable(module="add_mesh_extra_objects") - bpy.ops.preferences.addon_enable(module="ant_landscape") butil.clear_scene(targets=[bpy.data.objects]) asset_generation( Path(args.folder), diff --git a/tests/test_terrain_basic.py b/tests/test_terrain_basic.py index 2ff9c5013..5e7bfd09f 100644 --- a/tests/test_terrain_basic.py +++ b/tests/test_terrain_basic.py @@ -4,10 +4,10 @@ # Authors: Zeyu Ma -import bpy import gin import pytest +from infinigen.core.init import configure_blender from infinigen.core.surface import registry from infinigen.core.util.organization import Task from infinigen.core.util.test_utils import setup_gin @@ -34,8 +34,7 @@ def test_terrain_runs(): ], ) - bpy.ops.preferences.addon_enable(module="add_mesh_extra_objects") - bpy.ops.preferences.addon_enable(module="ant_landscape") + configure_blender() terrain = Terrain( 0, registry, task=Task.Coarse, on_the_fly_asset_folder="/tmp/terrain_tests" From c2dc8f7485aab58c392ad25ee324469690895684 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Sun, 8 Sep 2024 14:30:30 -0400 Subject: [PATCH 03/15] + Fix Add on installation and enabling + Fix Musgrave deprecation + Fix Capture Attribute new socket failure + Fix Nodegroup Interface changes + Remove deprecated NodeSocketFloatFactor, NodeSocketFloatDistance, NodeSocketVectorEuler + Fix PrincipledBSDF interfaces in specular, subsurface, clearcoat + Fix nodes used as both geometry and shader + Lazy fix all subsurface colors + Lazy fix all different IOR for subsurface and transmission + Fix lava NoiseTexture unused W + Fix whitewater unused sheen tint --- infinigen/assets/fluid/fluid.py | 3 +- .../assets/fluid/liquid_particle_material.py | 6 +- infinigen/assets/materials/bark_random.py | 8 +- infinigen/assets/materials/basic_bsdf.py | 2 +- .../materials/beverage_fridge_shaders.py | 4 +- infinigen/assets/materials/bird.py | 12 ++- .../assets/materials/bumpy_rubber_floor.py | 4 +- infinigen/assets/materials/ceramic.py | 8 +- infinigen/assets/materials/cobble_stone.py | 8 +- infinigen/assets/materials/cracked_ground.py | 6 +- .../assets/materials/dishwasher_shaders.py | 4 +- .../materials/fabrics/coarse_knit_fabric.py | 8 +- .../materials/fabrics/general_fabric.py | 2 +- .../assets/materials/fabrics/sofa_fabric.py | 2 +- infinigen/assets/materials/fabrics/velvet.py | 5 +- infinigen/assets/materials/fish_eye_shader.py | 6 +- infinigen/assets/materials/fishbody.py | 4 +- infinigen/assets/materials/glass_volume.py | 3 +- infinigen/assets/materials/ice.py | 2 +- infinigen/assets/materials/lamp_shaders.py | 5 +- infinigen/assets/materials/lava.py | 8 +- .../assets/materials/metal/brushed_metal.py | 2 +- .../materials/metal/galvanized_metal.py | 2 +- .../metal/grained_and_polished_metal.py | 2 +- .../assets/materials/metal/hammered_metal.py | 2 +- .../assets/materials/metal/metal_basic.py | 2 +- infinigen/assets/materials/mud.py | 2 +- infinigen/assets/materials/new_whitewater.py | 7 +- .../materials/reptile_two_color_attr.py | 2 +- infinigen/assets/materials/river_water.py | 6 +- infinigen/assets/materials/sandstone.py | 2 +- infinigen/assets/materials/scale.py | 2 +- infinigen/assets/materials/slimy.py | 4 +- infinigen/assets/materials/snake_plant.py | 2 +- infinigen/assets/materials/snake_scale.py | 4 +- infinigen/assets/materials/snake_shaders.py | 6 +- infinigen/assets/materials/soil.py | 2 +- infinigen/assets/materials/spider_plant.py | 2 +- .../assets/materials/spot_sparse_attr.py | 2 +- .../materials/stone_and_concrete/concrete.py | 4 +- infinigen/assets/materials/succulent.py | 36 ++++---- infinigen/assets/materials/table_marble.py | 2 +- infinigen/assets/materials/table_materials.py | 2 +- infinigen/assets/materials/text.py | 2 +- infinigen/assets/materials/tiger_attr.py | 2 +- .../assets/materials/tiles/advanced_tiles.py | 2 +- .../assets/materials/tiles/basket_weave.py | 4 +- infinigen/assets/materials/tiles/brick.py | 4 +- infinigen/assets/materials/tiles/cheveron.py | 4 +- infinigen/assets/materials/tiles/diamond.py | 4 +- .../assets/materials/tiles/herringbone.py | 4 +- infinigen/assets/materials/tiles/hexagon.py | 4 +- infinigen/assets/materials/tiles/shell.py | 8 +- .../assets/materials/tiles/spanish_bound.py | 4 +- infinigen/assets/materials/tiles/star.py | 12 +-- infinigen/assets/materials/tiles/triangle.py | 4 +- infinigen/assets/materials/tongue.py | 2 +- infinigen/assets/materials/twocolorz.py | 2 +- infinigen/assets/materials/vase_shaders.py | 9 +- infinigen/assets/materials/water.py | 2 +- .../assets/materials/waterfall_material.py | 6 +- .../wear_tear/procedural_edge_wear.py | 4 +- infinigen/assets/materials/woods/wood.py | 2 +- .../objects/appliances/beverage_fridge.py | 10 +-- .../assets/objects/appliances/dishwasher.py | 10 +-- .../assets/objects/appliances/microwave.py | 2 +- infinigen/assets/objects/appliances/oven.py | 14 +-- infinigen/assets/objects/cactus/generate.py | 2 +- infinigen/assets/objects/cactus/spike.py | 4 +- infinigen/assets/objects/corals/generate.py | 4 +- infinigen/assets/objects/corals/tentacles.py | 4 +- .../assets/objects/creatures/crustacean.py | 8 +- .../insects/parts/body/dragonfly_body.py | 2 +- .../insects/parts/eye/dragonfly_eye.py | 2 +- .../insects/parts/head/dragonfly_head.py | 6 +- .../insects/parts/tail/dragonfly_tail.py | 6 +- .../creatures/insects/utils/geom_utils.py | 18 ++-- .../creatures/insects/utils/shader_utils.py | 2 +- .../objects/creatures/parts/chameleon.py | 18 ++-- .../assets/objects/creatures/parts/eye.py | 2 +- .../assets/objects/creatures/parts/eye_new.py | 52 ++++++----- .../assets/objects/creatures/parts/foot.py | 4 +- .../assets/objects/creatures/parts/head.py | 10 +-- .../objects/creatures/parts/head_detail.py | 10 +-- .../assets/objects/creatures/parts/horn.py | 2 +- .../assets/objects/creatures/parts/wings.py | 4 +- .../creatures/util/animation/curve_slither.py | 2 +- .../objects/fruits/cross_section_lib.py | 4 +- .../assets/objects/fruits/fruit_utils.py | 8 +- infinigen/assets/objects/fruits/stem_lib.py | 22 ++--- .../fruits/surfaces/blackberry_surface.py | 6 +- .../fruits/surfaces/coconutgreen_surface.py | 6 +- .../objects/fruits/surfaces/durian_surface.py | 4 +- .../fruits/surfaces/pineapple_surface.py | 2 +- .../fruits/surfaces/starfruit_surface.py | 2 +- .../fruits/surfaces/strawberry_surface.py | 4 +- .../objects/fruits/surfaces/surface_utils.py | 2 +- .../assets/objects/grassland/dandelion.py | 6 +- infinigen/assets/objects/grassland/flower.py | 2 +- .../objects/lamp/ceiling_classic_lamp.py | 8 +- .../assets/objects/lamp/ceiling_lights.py | 2 +- infinigen/assets/objects/lamp/lamp.py | 14 +-- infinigen/assets/objects/leaves/leaf_pine.py | 8 +- infinigen/assets/objects/mollusk/generate.py | 2 +- infinigen/assets/objects/monocot/grasses.py | 6 +- infinigen/assets/objects/monocot/growth.py | 6 +- infinigen/assets/objects/monocot/pinecone.py | 2 +- infinigen/assets/objects/monocot/veratrum.py | 6 +- infinigen/assets/objects/mushroom/cap.py | 24 ++--- .../assets/objects/organizer/plate_rack.py | 4 +- infinigen/assets/objects/particles/lichen.py | 2 +- infinigen/assets/objects/particles/moss.py | 2 +- .../assets/objects/particles/pine_needle.py | 2 +- infinigen/assets/objects/seating/sofa.py | 4 +- infinigen/assets/objects/shelves/cabinet.py | 2 +- infinigen/assets/objects/shelves/doors.py | 2 +- infinigen/assets/objects/shelves/drawers.py | 2 +- .../assets/objects/shelves/large_shelf.py | 4 +- .../assets/objects/shelves/simple_bookcase.py | 4 +- .../assets/objects/shelves/simple_desk.py | 2 +- .../assets/objects/small_plants/succulent.py | 2 +- .../assets/objects/table_decorations/sink.py | 10 +-- .../assets/objects/table_decorations/utils.py | 4 +- .../assets/objects/tables/legs/square.py | 6 +- infinigen/assets/objects/tables/lofting.py | 4 +- infinigen/assets/objects/tables/table_top.py | 2 +- .../assets/objects/tables/table_utils.py | 4 +- infinigen/assets/objects/trees/branch.py | 2 +- infinigen/assets/objects/trees/tree_flower.py | 2 +- .../objects/trees/utils/geometrynodes.py | 2 +- .../assets/objects/trees/utils/materials.py | 6 +- .../objects/tropic_plants/coconut_tree.py | 8 +- .../assets/objects/tropic_plants/palm_tree.py | 4 +- .../assets/objects/underwater/seaweed.py | 4 +- infinigen/assets/objects/underwater/urchin.py | 4 +- .../wall_decorations/skirting_board.py | 2 +- infinigen/assets/objects/windows/window.py | 52 +++++------ infinigen/assets/utils/nodegroups/attach.py | 10 +-- infinigen/assets/utils/nodegroups/curve.py | 2 +- infinigen/assets/utils/nodegroups/geometry.py | 2 +- infinigen/core/init.py | 21 ++++- infinigen/core/nodes/compatibility.py | 90 ++++++++++++++++++- infinigen/core/nodes/node_wrangler.py | 90 ++++--------------- infinigen/core/nodes/utils.py | 81 +++++++++++++++++ infinigen/core/surface.py | 17 ++-- infinigen/tools/export.py | 26 +++--- 146 files changed, 642 insertions(+), 481 deletions(-) create mode 100644 infinigen/core/nodes/utils.py diff --git a/infinigen/assets/fluid/fluid.py b/infinigen/assets/fluid/fluid.py index 6d9c8f748..cb7ff93c3 100644 --- a/infinigen/assets/fluid/fluid.py +++ b/infinigen/assets/fluid/fluid.py @@ -24,9 +24,8 @@ from infinigen.core.nodes.node_wrangler import ( Nodes, NodeWrangler, - infer_input_socket, - infer_output_socket, ) +from infinigen.core.nodes.utils import infer_input_socket, infer_output_socket from infinigen.core.util import blender as butil from infinigen.core.util.blender import deep_clone_obj from infinigen.core.util.logging import Timer diff --git a/infinigen/assets/fluid/liquid_particle_material.py b/infinigen/assets/fluid/liquid_particle_material.py index 4196256e2..ed7978306 100644 --- a/infinigen/assets/fluid/liquid_particle_material.py +++ b/infinigen/assets/fluid/liquid_particle_material.py @@ -17,12 +17,12 @@ def liquid_particle_material(nw: NodeWrangler): input_kwargs={ "Base Color": (1.0000, 1.0000, 1.0000, 1.0000), "Subsurface Color": (0.7147, 0.6062, 0.8000, 1.0000), - "Specular": 0.0886, + "Specular IOR Level": 0.0886, "Roughness": 0.2705 + (0.1 * normal()), "Sheen Tint": 0.0000, - "Clearcoat Roughness": 0.0000, + "Coat Roughness": 0.0000, "IOR": 1.2000, - "Transmission": 0.2818 + (0.1 * normal()), + "Transmission Weight": 0.2818 + (0.1 * normal()), }, attrs={"distribution": "MULTI_GGX"}, ) diff --git a/infinigen/assets/materials/bark_random.py b/infinigen/assets/materials/bark_random.py index f32850d27..6ce11d8c0 100644 --- a/infinigen/assets/materials/bark_random.py +++ b/infinigen/assets/materials/bark_random.py @@ -243,7 +243,7 @@ def nodegroup_primary_voronoi(nw): expose_input=[ ("NodeSocketVector", "Coordinate", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Texture Scale", 20.0), - ("NodeSocketFloatFactor", "Randomness", 1.0), + ("NodeSocketFloat", "Randomness", 1.0), ], ) @@ -401,7 +401,7 @@ def nodegroup_voronoi(nw): expose_input=[ ("NodeSocketVector", "Coordinate", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Texture Scale", 5.0), - ("NodeSocketFloatFactor", "Randomness", 1.0), + ("NodeSocketFloat", "Randomness", 1.0), ], ) @@ -525,7 +525,7 @@ def nodegroup_random_bark_geo(nw): ("NodeSocketFloat", "Noise Scale", 2.0), ("NodeSocketFloat", "Noise Amount", 1.0), ("NodeSocketFloat", "Texture Scale", 30.0), - ("NodeSocketFloatFactor", "Randomness", 1.0), + ("NodeSocketFloat", "Randomness", 1.0), ("NodeSocketFloat", "Value", 0.05), ("NodeSocketFloat", "Mix Weight", 0.1), ("NodeSocketFloat", "Scale", 15.0), @@ -814,7 +814,7 @@ def geo_bark_random(nw, base_color, geo_params, selection=None): geo_params["Primary Voronoi Scale"], ), ( - "NodeSocketFloatFactor", + "NodeSocketFloat", "Primary Voronoi Randomness", geo_params["Primary Voronoi Randomness"], ), diff --git a/infinigen/assets/materials/basic_bsdf.py b/infinigen/assets/materials/basic_bsdf.py index 9e8a4bdb0..4e851d918 100644 --- a/infinigen/assets/materials/basic_bsdf.py +++ b/infinigen/assets/materials/basic_bsdf.py @@ -22,7 +22,7 @@ def shader_basic_bsdf(nw): "Base Color": color, "Roughness": np.clip(normal(0.6, 0.3), 0.05, 0.95), "Metallic": uniform(0, 1) if uniform() < 0.3 else 0, - "Subsurface": 0 if uniform() < 0.8 else uniform(0, 0.2), + "Subsurface Weight": 0 if uniform() < 0.8 else uniform(0, 0.2), }, attrs={"subsurface_method": "BURLEY"}, ) diff --git a/infinigen/assets/materials/beverage_fridge_shaders.py b/infinigen/assets/materials/beverage_fridge_shaders.py index 571a224a8..d56966c67 100644 --- a/infinigen/assets/materials/beverage_fridge_shaders.py +++ b/infinigen/assets/materials/beverage_fridge_shaders.py @@ -70,10 +70,10 @@ def shader_white_metal_001(nw: NodeWrangler): "Base Color": colorramp.outputs["Color"], "Subsurface Color": (1.0000, 1.0000, 1.0000, 1.0000), "Metallic": 1.0000, - "Specular": 1.0000, + "Specular IOR Level": 1.0000, "Roughness": 0.1000, "Anisotropic": 0.9182, - "Sheen": 0.0455, + "Sheen Weight": 0.0455, "Sheen Tint": 0.4948, }, attrs={"subsurface_method": "BURLEY"}, diff --git a/infinigen/assets/materials/bird.py b/infinigen/assets/materials/bird.py index 643ebcf80..9b20d5c66 100644 --- a/infinigen/assets/materials/bird.py +++ b/infinigen/assets/materials/bird.py @@ -395,8 +395,8 @@ def shader_bird_body(nw: NodeWrangler, rand=True, kind="duck", **input_kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": group, - "Subsurface IOR": 0.0, - "Specular": 0.0, + "IOR": 0.0, + "Specular IOR Level": 0.0, "Roughness": 1.0, }, ) @@ -487,7 +487,11 @@ def shader_bird_feather( principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": (mix, "Result"), "Specular": 0.0, "Roughness": 1.0}, + input_kwargs={ + "Base Color": (mix, "Result"), + "Specular IOR Level": 0.0, + "Roughness": 1.0, + }, attrs={"subsurface_method": "BURLEY"}, ) @@ -605,7 +609,7 @@ def shader_bird_claw(nw: NodeWrangler, rand=True, **input_kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": (0.0091, 0.0091, 0.0091, 1.0), - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": 0.4409, }, ) diff --git a/infinigen/assets/materials/bumpy_rubber_floor.py b/infinigen/assets/materials/bumpy_rubber_floor.py index f3b488a81..d86dc7741 100644 --- a/infinigen/assets/materials/bumpy_rubber_floor.py +++ b/infinigen/assets/materials/bumpy_rubber_floor.py @@ -24,7 +24,7 @@ def nodegroup_node_group(nw: NodeWrangler): ("NodeSocketColor", "Base Color", (0.8000, 0.8000, 0.8000, 1.0000)), ("NodeSocketFloat", "Scale", 1.0000), ("NodeSocketFloat", "Seed", 0.0000), - ("NodeSocketFloatFactor", "Roughness", 0.4000), + ("NodeSocketFloat", "Roughness", 0.4000), ], ) @@ -71,7 +71,7 @@ def nodegroup_node_group(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": hue_saturation_value, - "Specular": 0.9, + "Specular IOR Level": 0.9, "Roughness": group_input.outputs["Roughness"], }, ) diff --git a/infinigen/assets/materials/ceramic.py b/infinigen/assets/materials/ceramic.py index 7341271c3..9cb8a278f 100644 --- a/infinigen/assets/materials/ceramic.py +++ b/infinigen/assets/materials/ceramic.py @@ -30,11 +30,11 @@ def shader_ceramic( Nodes.PrincipledBSDF, input_kwargs={ "Roughness": roughness, - "Clearcoat": 1, - "Clearcoat Roughness": clearcoat_roughness, - "Specular": 1, + "Coat Weight": 1, + "Coat Roughness": clearcoat_roughness, + "Specular IOR Level": 1, "Base Color": color, - "Subsurface": uniform(0.02, 0.05), + "Subsurface Weight": uniform(0.02, 0.05), "Subsurface Radius": (0.02, 0.02, 0.02), }, ) diff --git a/infinigen/assets/materials/cobble_stone.py b/infinigen/assets/materials/cobble_stone.py index 0971462d4..f6ff056e3 100644 --- a/infinigen/assets/materials/cobble_stone.py +++ b/infinigen/assets/materials/cobble_stone.py @@ -102,10 +102,6 @@ def geo_cobblestone(nw: NodeWrangler, selection=None, random_seed=0, geometry=Tr # depth of stone dep_sto = nw.new_value(U(0.02, 0.04), "dep_sto") - group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketGeometry", "Geometry", None)] - ) - noise_texture = nw.new_node( Nodes.NoiseTexture, input_kwargs={ @@ -196,6 +192,10 @@ def geo_cobblestone(nw: NodeWrangler, selection=None, random_seed=0, geometry=Tr if not geometry: return colorramp + group_input = nw.new_node( + Nodes.GroupInput, expose_input=[("NodeSocketGeometry", "Geometry", None)] + ) + multiply_1 = nw.new_node( Nodes.VectorMath, input_kwargs={0: colorramp.outputs["Color"], 1: normal}, diff --git a/infinigen/assets/materials/cracked_ground.py b/infinigen/assets/materials/cracked_ground.py index a9a2d9762..cca06fe00 100644 --- a/infinigen/assets/materials/cracked_ground.py +++ b/infinigen/assets/materials/cracked_ground.py @@ -134,7 +134,11 @@ def shader_cracked_ground(nw: NodeWrangler, random_seed=0): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix_2, "Specular": 0.2000, "Roughness": 0.9000}, + input_kwargs={ + "Base Color": mix_2, + "Specular IOR Level": 0.2000, + "Roughness": 0.9000, + }, ) material_output = nw.new_node( diff --git a/infinigen/assets/materials/dishwasher_shaders.py b/infinigen/assets/materials/dishwasher_shaders.py index e70ab1e1a..f06540b63 100644 --- a/infinigen/assets/materials/dishwasher_shaders.py +++ b/infinigen/assets/materials/dishwasher_shaders.py @@ -149,10 +149,10 @@ def shader_white_metal_002(nw: NodeWrangler): "Base Color": colorramp.outputs["Color"], "Subsurface Color": (1.0000, 1.0000, 1.0000, 1.0000), "Metallic": 1.0000, - "Specular": 1.0000, + "Specular IOR Level": 1.0000, "Roughness": 0.1000, "Anisotropic": 0.9182, - "Sheen": 0.0455, + "Sheen Weight": 0.0455, "Sheen Tint": 0.4948, }, attrs={"subsurface_method": "BURLEY"}, diff --git a/infinigen/assets/materials/fabrics/coarse_knit_fabric.py b/infinigen/assets/materials/fabrics/coarse_knit_fabric.py index ebb9dda0c..24449bffa 100644 --- a/infinigen/assets/materials/fabrics/coarse_knit_fabric.py +++ b/infinigen/assets/materials/fabrics/coarse_knit_fabric.py @@ -148,7 +148,11 @@ def shader_fabric_base( principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": reroute, "Specular": 0.6309, "Roughness": 0.9945}, + input_kwargs={ + "Base Color": reroute, + "Specular IOR Level": 0.6309, + "Roughness": 0.9945, + }, ) combine_color = nw.new_node( @@ -160,7 +164,7 @@ def shader_fabric_base( Nodes.PrincipledBSDF, input_kwargs={ "Base Color": combine_color, - "Specular": 0.6309, + "Specular IOR Level": 0.6309, "Roughness": 0.9945, }, ) diff --git a/infinigen/assets/materials/fabrics/general_fabric.py b/infinigen/assets/materials/fabrics/general_fabric.py index 89299619c..d8ac97a23 100644 --- a/infinigen/assets/materials/fabrics/general_fabric.py +++ b/infinigen/assets/materials/fabrics/general_fabric.py @@ -153,7 +153,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): input_kwargs={ "Base Color": mix_3.outputs[2], "Roughness": map_range_2.outputs["Result"], - "Sheen": 1.0000, + "Sheen Weight": 1.0000, "Sheen Tint": 1.0000, }, ) diff --git a/infinigen/assets/materials/fabrics/sofa_fabric.py b/infinigen/assets/materials/fabrics/sofa_fabric.py index 4d77ffdf2..b4397b467 100644 --- a/infinigen/assets/materials/fabrics/sofa_fabric.py +++ b/infinigen/assets/materials/fabrics/sofa_fabric.py @@ -46,7 +46,7 @@ def shader_sofa_fabric(nw: NodeWrangler, scale=1, **kwargs): input_kwargs={ "Base Color": brick_texture.outputs["Color"], "Roughness": 0.8624, - "Sheen": 1.0000, + "Sheen Weight": 1.0000, }, ) diff --git a/infinigen/assets/materials/fabrics/velvet.py b/infinigen/assets/materials/fabrics/velvet.py index eed291ecd..22bf81978 100644 --- a/infinigen/assets/materials/fabrics/velvet.py +++ b/infinigen/assets/materials/fabrics/velvet.py @@ -84,12 +84,11 @@ def shader_velvet(nw: NodeWrangler, **kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix_2.outputs[2], - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": uniform(0.4, 0.9), "Anisotropic": 0.7614, "Anisotropic Rotation": 1.0000, - "Sheen": 16.2273, - "Sheen Tint": 1.0000, + "Sheen Weight": 16.2273, }, ) diff --git a/infinigen/assets/materials/fish_eye_shader.py b/infinigen/assets/materials/fish_eye_shader.py index 190865169..48c0b8e6d 100644 --- a/infinigen/assets/materials/fish_eye_shader.py +++ b/infinigen/assets/materials/fish_eye_shader.py @@ -403,7 +403,11 @@ def shader_eyeball_fish(nw: NodeWrangler): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix_8, "Specular": 0.0000, "Roughness": 0.0000}, + input_kwargs={ + "Base Color": mix_8, + "Specular IOR Level": 0.0000, + "Roughness": 0.0000, + }, ) glossy_bsdf = nw.new_node("ShaderNodeBsdfGlossy") diff --git a/infinigen/assets/materials/fishbody.py b/infinigen/assets/materials/fishbody.py index 776560e3e..e5dfe6098 100644 --- a/infinigen/assets/materials/fishbody.py +++ b/infinigen/assets/materials/fishbody.py @@ -902,7 +902,7 @@ def shader_fish_body_regular(nw: NodeWrangler, rand=True, **input_kwargs): "Subsurface Radius": (0.36, 0.46, 0.6), "Subsurface Color": (1.0, 0.9405, 0.7747, 1.0), "Metallic": 0.8, - "Specular": 0.9, + "Specular IOR Level": 0.9, "Roughness": 0.3, "IOR": 1.69, }, @@ -1099,7 +1099,7 @@ def shader_fish_body_gold(nw: NodeWrangler, rand=True, **input_kwargs): "Subsurface Radius": (0.36, 0.46, 0.6), "Subsurface Color": (1.0, 0.9405, 0.7747, 1.0), "Metallic": 0.5, - "Specular": 0.5273, + "Specular IOR Level": 0.5273, "Roughness": 0.1, "IOR": 1.69, }, diff --git a/infinigen/assets/materials/glass_volume.py b/infinigen/assets/materials/glass_volume.py index 884458ae4..d03a3b00a 100644 --- a/infinigen/assets/materials/glass_volume.py +++ b/infinigen/assets/materials/glass_volume.py @@ -20,7 +20,8 @@ def shader_glass_volume(nw: NodeWrangler, color=None, density=100.0, **kwargs): color = hsv2rgba(uniform(0, 1), uniform(0.5, 0.9), uniform(0.6, 0.9)) principled_bsdf = nw.new_node( - Nodes.PrincipledBSDF, input_kwargs={"Roughness": 0.0000, "Transmission": 1.0000} + Nodes.PrincipledBSDF, + input_kwargs={"Roughness": 0.0000, "Transmission Weight": 1.0000}, ) volume_absorption = nw.new_node( diff --git a/infinigen/assets/materials/ice.py b/infinigen/assets/materials/ice.py index e6c1df207..ce12b8102 100644 --- a/infinigen/assets/materials/ice.py +++ b/infinigen/assets/materials/ice.py @@ -46,7 +46,7 @@ def shader_ice(nw: NodeWrangler): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, input_kwargs={ - "Subsurface": 1.0000, + "Subsurface Weight": 1.0000, "Subsurface Radius": (0.0010, 0.0010, 0.0020), "Subsurface Color": tuple(col_ice), "Roughness": color_ramp.outputs["Color"], diff --git a/infinigen/assets/materials/lamp_shaders.py b/infinigen/assets/materials/lamp_shaders.py index 25b68de8f..22f389736 100644 --- a/infinigen/assets/materials/lamp_shaders.py +++ b/infinigen/assets/materials/lamp_shaders.py @@ -50,12 +50,11 @@ def shader_lampshade(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix.outputs[2], - "Subsurface": U(0.03, 0.08), + "Subsurface Weight": U(0.03, 0.08), "Subsurface Radius": (0.1000, 0.1000, 0.1000), - "Subsurface IOR": 1.6029, "Roughness": U(0.5, 0.8), "IOR": 4.0000, - "Transmission": U(0.05, 0.2), + "Transmission Weight": U(0.05, 0.2), "Transmission Roughness": 1.0000, }, ) diff --git a/infinigen/assets/materials/lava.py b/infinigen/assets/materials/lava.py index a501b87e5..293011c95 100644 --- a/infinigen/assets/materials/lava.py +++ b/infinigen/assets/materials/lava.py @@ -218,7 +218,9 @@ def lava_shader(nw): ) noise_emission = nw.new_node( - Nodes.NoiseTexture, input_kwargs={"W": uniform(0, 10), "Scale": 0.5} + Nodes.NoiseTexture, + input_kwargs={"W": uniform(0, 10), "Scale": 0.5}, + attrs={"noise_dimensions": "4D"}, ) strength_emission = nw.new_node( @@ -282,10 +284,6 @@ def lava_geo(nw, selection=None, random_seed=0, geometry=True): dir_x = nw.new_value(dir_x, "dir_x") # print(f"{wave_sca=} {dir_x=} {dir_y=}") - group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketGeometry", "Geometry", None)] - ) - noise_texture_1 = nw.new_node( Nodes.NoiseTexture, attrs={"noise_dimensions": "4D"}, diff --git a/infinigen/assets/materials/metal/brushed_metal.py b/infinigen/assets/materials/metal/brushed_metal.py index 3ae66bc9d..ae19dfe63 100644 --- a/infinigen/assets/materials/metal/brushed_metal.py +++ b/infinigen/assets/materials/metal/brushed_metal.py @@ -128,7 +128,7 @@ def nodegroup_brushed_metal(nw: NodeWrangler): input_kwargs={ "Base Color": hue_saturation_value, "Metallic": 1.0000, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": map_range_1.outputs["Result"], }, ) diff --git a/infinigen/assets/materials/metal/galvanized_metal.py b/infinigen/assets/materials/metal/galvanized_metal.py index ffcdb5744..68debfd48 100644 --- a/infinigen/assets/materials/metal/galvanized_metal.py +++ b/infinigen/assets/materials/metal/galvanized_metal.py @@ -83,7 +83,7 @@ def nodegroup_galvanized_metal(nw: NodeWrangler): input_kwargs={ "Base Color": group_input.outputs["Base Color"], "Metallic": 1.0000, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": map_range.outputs["Result"], }, ) diff --git a/infinigen/assets/materials/metal/grained_and_polished_metal.py b/infinigen/assets/materials/metal/grained_and_polished_metal.py index 73e0dea0f..b81c58f18 100644 --- a/infinigen/assets/materials/metal/grained_and_polished_metal.py +++ b/infinigen/assets/materials/metal/grained_and_polished_metal.py @@ -36,7 +36,7 @@ def nodegroup_grained_metal(nw: NodeWrangler): input_kwargs={ "Base Color": group_input.outputs["Base Color"], "Metallic": 1.0000, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": map_range.outputs["Result"], }, ) diff --git a/infinigen/assets/materials/metal/hammered_metal.py b/infinigen/assets/materials/metal/hammered_metal.py index e7e329e54..bf808caba 100644 --- a/infinigen/assets/materials/metal/hammered_metal.py +++ b/infinigen/assets/materials/metal/hammered_metal.py @@ -32,7 +32,7 @@ def nodegroup_hammered_metal(nw: NodeWrangler): input_kwargs={ "Base Color": group_input.outputs["Base Color"], "Metallic": 1.0000, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": 0.1000, }, ) diff --git a/infinigen/assets/materials/metal/metal_basic.py b/infinigen/assets/materials/metal/metal_basic.py index 6f938baa3..615e6c1be 100644 --- a/infinigen/assets/materials/metal/metal_basic.py +++ b/infinigen/assets/materials/metal/metal_basic.py @@ -21,7 +21,7 @@ def shader_metal(nw: NodeWrangler, color=None, **kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Metallic": 1.0, - "Specular": uniform(0.5, 1.0), + "Specular IOR Level": uniform(0.5, 1.0), "Base Color": color, "Roughness": roughness, }, diff --git a/infinigen/assets/materials/mud.py b/infinigen/assets/materials/mud.py index f757c3974..ab9874c40 100644 --- a/infinigen/assets/materials/mud.py +++ b/infinigen/assets/materials/mud.py @@ -100,7 +100,7 @@ def shader_mud(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp_3.outputs["Color"], - "Specular": colorramp_6.outputs["Color"], + "Specular IOR Level": colorramp_6.outputs["Color"], "Roughness": mix_3, }, ) diff --git a/infinigen/assets/materials/new_whitewater.py b/infinigen/assets/materials/new_whitewater.py index 7f0986413..0b2056c99 100644 --- a/infinigen/assets/materials/new_whitewater.py +++ b/infinigen/assets/materials/new_whitewater.py @@ -20,12 +20,11 @@ def new_whitewater(nw: NodeWrangler): "Subsurface Color": random_color_neighbour( (0.7147, 0.6062, 0.8000, 1.0000), 0.05, 0.05, 0.05 ), - "Specular": 0.0886 + 0.01 * normal(), + "Specular IOR Level": 0.0886 + 0.01 * normal(), "Roughness": 0.1500, - "Sheen Tint": 0.0000, - "Clearcoat Roughness": 0.0000, + "Coat Roughness": 0.0000, "IOR": 1.1000, - "Transmission": 0.5000, + "Transmission Weight": 0.5000, }, attrs={"distribution": "MULTI_GGX"}, ) diff --git a/infinigen/assets/materials/reptile_two_color_attr.py b/infinigen/assets/materials/reptile_two_color_attr.py index 833665e7b..09089cc35 100644 --- a/infinigen/assets/materials/reptile_two_color_attr.py +++ b/infinigen/assets/materials/reptile_two_color_attr.py @@ -163,7 +163,7 @@ def shader_two_color(nw: NodeWrangler, rand=True, **input_kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix_1, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": colorramp_2.outputs["Color"], }, ) diff --git a/infinigen/assets/materials/river_water.py b/infinigen/assets/materials/river_water.py index a7e88e773..27a24afa4 100644 --- a/infinigen/assets/materials/river_water.py +++ b/infinigen/assets/materials/river_water.py @@ -25,7 +25,11 @@ def shader_river_water(nw: NodeWrangler): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Roughness": 0.0000, "IOR": 1.3300, "Transmission": 1.0000}, + input_kwargs={ + "Roughness": 0.0000, + "IOR": 1.3300, + "Transmission Weight": 1.0000, + }, ) mix_shader = nw.new_node( diff --git a/infinigen/assets/materials/sandstone.py b/infinigen/assets/materials/sandstone.py index 886c698c6..fbe19650d 100644 --- a/infinigen/assets/materials/sandstone.py +++ b/infinigen/assets/materials/sandstone.py @@ -391,7 +391,7 @@ def shader(nw: NodeWrangler, color=("palette", "sandstone")): input_kwargs={ "Base Color": colorramp_1.outputs["Color"], "Roughness": 0.9, - "Specular": 0.1, + "Specular IOR Level": 0.1, }, ) diff --git a/infinigen/assets/materials/scale.py b/infinigen/assets/materials/scale.py index bb3caf349..826fa259a 100644 --- a/infinigen/assets/materials/scale.py +++ b/infinigen/assets/materials/scale.py @@ -134,7 +134,7 @@ def shader_scale(nw, rand=True, **input_kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colormap, - "Subsurface": 0.2, + "Subsurface Weight": 0.2, "Subsurface Radius": (0.36, 0.46, 0.6), "Subsurface Color": (1.0, 0.9405, 0.7747, 1.0), "Metallic": 0.8, diff --git a/infinigen/assets/materials/slimy.py b/infinigen/assets/materials/slimy.py index 04fe95196..1b7bbff42 100644 --- a/infinigen/assets/materials/slimy.py +++ b/infinigen/assets/materials/slimy.py @@ -73,9 +73,9 @@ def shader_slimy(nw, rand=False, **input_kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": (0.6605, 0.0279, 0.0359, 1.0), - "Subsurface": 0.2, + "Subsurface Weight": 0.2, "Subsurface Color": (0.4621, 0.0213, 0.0265, 1.0), - "Specular": 0.8591, + "Specular IOR Level": 0.8591, "Roughness": mix_1, }, ) diff --git a/infinigen/assets/materials/snake_plant.py b/infinigen/assets/materials/snake_plant.py index 666c19fcf..cd7417088 100644 --- a/infinigen/assets/materials/snake_plant.py +++ b/infinigen/assets/materials/snake_plant.py @@ -140,7 +140,7 @@ def shader_snake_plant(nw: NodeWrangler): input_kwargs={ "Base Color": mix, "Roughness": U(8.0, 15.0), - "Clearcoat Roughness": 0.0, + "Coat Roughness": 0.0, }, ) diff --git a/infinigen/assets/materials/snake_scale.py b/infinigen/assets/materials/snake_scale.py index 329e6b8e7..451994118 100644 --- a/infinigen/assets/materials/snake_scale.py +++ b/infinigen/assets/materials/snake_scale.py @@ -168,9 +168,9 @@ def nodegroup_scale(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.040000000000000001), + ("NodeSocketFloat", "Radius", 0.040000000000000001), ("NodeSocketFloat", "thickness", 0.10000000000000001), - ("NodeSocketVectorEuler", "Rotation", (0.0, -0.17449999999999999, 0.0)), + ("NodeSocketVector", "Rotation", (0.0, -0.17449999999999999, 0.0)), ], ) diff --git a/infinigen/assets/materials/snake_shaders.py b/infinigen/assets/materials/snake_shaders.py index f95689a81..b05ee7180 100644 --- a/infinigen/assets/materials/snake_shaders.py +++ b/infinigen/assets/materials/snake_shaders.py @@ -77,7 +77,7 @@ def shader_black_white_snake(nw: NodeWrangler, rand=True): input_kwargs={ "Base Color": colorramp.outputs["Color"], "Metallic": 0.6, - "Specular": 0.2, + "Specular IOR Level": 0.2, "Roughness": 0.4, }, attrs={"subsurface_method": "BURLEY"}, @@ -124,7 +124,7 @@ def shader_brown(nw: NodeWrangler, rand=False): input_kwargs={ "Base Color": colorramp_2.outputs["Color"], "Metallic": 0.4, - "Specular": 0.3, + "Specular IOR Level": 0.3, "Roughness": 1, }, attrs={"subsurface_method": "BURLEY"}, @@ -289,7 +289,7 @@ def shader_golden(nw: NodeWrangler, rand=False): input_kwargs={ "Base Color": colorramp.outputs["Color"], "Metallic": 0.4, - "Specular": 0.2, + "Specular IOR Level": 0.2, "Roughness": 0.4, }, attrs={"subsurface_method": "BURLEY"}, diff --git a/infinigen/assets/materials/soil.py b/infinigen/assets/materials/soil.py index d0a5d9503..5e4a083ea 100644 --- a/infinigen/assets/materials/soil.py +++ b/infinigen/assets/materials/soil.py @@ -208,7 +208,7 @@ def shader_soil(nw, random_seed=0): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix, - "Specular": 0.2, + "Specular IOR Level": 0.2, "Roughness": colorramp_2.outputs["Color"], }, ) diff --git a/infinigen/assets/materials/spider_plant.py b/infinigen/assets/materials/spider_plant.py index 239e87f47..d38b4dc3b 100644 --- a/infinigen/assets/materials/spider_plant.py +++ b/infinigen/assets/materials/spider_plant.py @@ -20,7 +20,7 @@ def shader_spider_plant(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": main_color, - "Subsurface IOR": 1.01, + "IOR": 1.01, "Roughness": 2.0, }, ) diff --git a/infinigen/assets/materials/spot_sparse_attr.py b/infinigen/assets/materials/spot_sparse_attr.py index 7ae76b972..ff7880986 100644 --- a/infinigen/assets/materials/spot_sparse_attr.py +++ b/infinigen/assets/materials/spot_sparse_attr.py @@ -69,7 +69,7 @@ def getcolor(): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": colorramp.outputs["Color"], }, ) diff --git a/infinigen/assets/materials/stone_and_concrete/concrete.py b/infinigen/assets/materials/stone_and_concrete/concrete.py index cae4f3c0b..89e1c7f32 100644 --- a/infinigen/assets/materials/stone_and_concrete/concrete.py +++ b/infinigen/assets/materials/stone_and_concrete/concrete.py @@ -23,7 +23,7 @@ def nodegroup_crack(nw: NodeWrangler): ("NodeSocketFloat", "Seed", 0.0000), ("NodeSocketFloat", "Amount", 1.0000), ("NodeSocketFloat", "Scale", 0.0000), - ("NodeSocketFloatFactor", "Snake Crack", 0.3000), + ("NodeSocketFloat", "Snake Crack", 0.3000), ], ) @@ -189,7 +189,7 @@ def nodegroup_concrete(nw: NodeWrangler): ("NodeSocketFloat", "Roughness", 0.0000), ("NodeSocketFloat", "Crack Amount", 0.0000), ("NodeSocketFloat", "Crack Scale", 0.0000), - ("NodeSocketFloatFactor", "Snake Crack", 0.3000), + ("NodeSocketFloat", "Snake Crack", 0.3000), ], ) diff --git a/infinigen/assets/materials/succulent.py b/infinigen/assets/materials/succulent.py index fd586ccda..7892a6fea 100644 --- a/infinigen/assets/materials/succulent.py +++ b/infinigen/assets/materials/succulent.py @@ -71,14 +71,12 @@ def shader_green_transition_succulent(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp_1.outputs["Color"], - "Subsurface": uniform(0.01, 0.03), + "Subsurface Weight": uniform(0.01, 0.03), "Subsurface Radius": (0.01, 0.1, 0.1), "Subsurface Color": colorramp_1.outputs["Color"], - "Subsurface IOR": 0.0, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": 2.0, - "Sheen Tint": 0.0, - "Clearcoat Roughness": 0.0, + "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, }, @@ -153,14 +151,13 @@ def shader_pink_transition_succulent(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp_1.outputs["Color"], - "Subsurface": uniform(0.01, 0.05), + "Subsurface Weight": uniform(0.01, 0.05), "Subsurface Radius": (0.01, 0.03, 0.03), "Subsurface Color": colorramp_1.outputs["Color"], - "Subsurface IOR": 0.0, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": 2.0, "Sheen Tint": 0.0, - "Clearcoat Roughness": 0.0, + "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, }, @@ -231,14 +228,13 @@ def shader_green_succulent(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp_1.outputs["Color"], - "Subsurface": uniform(0.01, 0.05), + "Subsurface Weight": uniform(0.01, 0.05), "Subsurface Radius": (0.1, 0.1, 0.1), "Subsurface Color": colorramp_1.outputs["Color"], - "Subsurface IOR": 0.0, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": 2.0, "Sheen Tint": 0.0, - "Clearcoat Roughness": 0.0, + "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, }, @@ -312,14 +308,13 @@ def shader_yellow_succulent(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp_1.outputs["Color"], - "Subsurface": 0.01, + "Subsurface Weight": 0.01, "Subsurface Radius": (1.0, 1.0, 1.0), "Subsurface Color": colorramp_1.outputs["Alpha"], - "Subsurface IOR": 1.3, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": 2.0, "Sheen Tint": 0.0, - "Clearcoat Roughness": 0.0, + "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, }, @@ -406,14 +401,13 @@ def shader_whitish_green_succulent(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp.outputs["Color"], - "Subsurface": 0.01, + "Subsurface Weight": 0.01, "Subsurface Radius": (1.0, 1.0, 1.0), "Subsurface Color": colorramp.outputs["Color"], - "Subsurface IOR": 1.3, - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": 2.0, "Sheen Tint": 0.0, - "Clearcoat Roughness": 0.0, + "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, }, diff --git a/infinigen/assets/materials/table_marble.py b/infinigen/assets/materials/table_marble.py index 1023d92fb..78c463495 100644 --- a/infinigen/assets/materials/table_marble.py +++ b/infinigen/assets/materials/table_marble.py @@ -138,7 +138,7 @@ def shader_marble(nw: NodeWrangler, **kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix_1.outputs[2], - "Specular": 0.6000, + "Specular IOR Level": 0.6000, "Roughness": 0.1000, "Normal": bump, }, diff --git a/infinigen/assets/materials/table_materials.py b/infinigen/assets/materials/table_materials.py index 348a04299..48dbef091 100644 --- a/infinigen/assets/materials/table_materials.py +++ b/infinigen/assets/materials/table_materials.py @@ -142,7 +142,7 @@ def shader_marble(nw: NodeWrangler, **kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix_1.outputs[2], - "Specular": 0.6000, + "Specular IOR Level": 0.6000, "Roughness": 0.1000, "Normal": bump, }, diff --git a/infinigen/assets/materials/text.py b/infinigen/assets/materials/text.py index 6fb62336c..d6f03aa53 100644 --- a/infinigen/assets/materials/text.py +++ b/infinigen/assets/materials/text.py @@ -433,7 +433,7 @@ def shader_text(nw: NodeWrangler, **kwargs): "Base Color": color, "Roughness": roughness, "Metallic": uniform(0, 0.5), - "Specular": uniform(0, 0.2), + "Specular IOR Level": uniform(0, 0.2), "Emission": emission, "Emission Strength": self.emission, }, diff --git a/infinigen/assets/materials/tiger_attr.py b/infinigen/assets/materials/tiger_attr.py index e3567b128..87d18f874 100644 --- a/infinigen/assets/materials/tiger_attr.py +++ b/infinigen/assets/materials/tiger_attr.py @@ -210,7 +210,7 @@ def shader_tiger_attr(nw: NodeWrangler): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix_5, "Specular": 0.0}, + input_kwargs={"Base Color": mix_5, "Specular IOR Level": 0.0}, attrs={"subsurface_method": "BURLEY"}, ) diff --git a/infinigen/assets/materials/tiles/advanced_tiles.py b/infinigen/assets/materials/tiles/advanced_tiles.py index 8f7a8cebb..486a6ab20 100644 --- a/infinigen/assets/materials/tiles/advanced_tiles.py +++ b/infinigen/assets/materials/tiles/advanced_tiles.py @@ -200,7 +200,7 @@ def get_connected_links(nw, input_socket): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": seam_color, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": 0.9000, }, ) diff --git a/infinigen/assets/materials/tiles/basket_weave.py b/infinigen/assets/materials/tiles/basket_weave.py index bd63dce0d..b8fca80e5 100644 --- a/infinigen/assets/materials/tiles/basket_weave.py +++ b/infinigen/assets/materials/tiles/basket_weave.py @@ -23,8 +23,8 @@ def nodegroup_basket_weave(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/brick.py b/infinigen/assets/materials/tiles/brick.py index 7418a5cb6..b27ff2673 100644 --- a/infinigen/assets/materials/tiles/brick.py +++ b/infinigen/assets/materials/tiles/brick.py @@ -106,8 +106,8 @@ def nodegroup_birck(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/cheveron.py b/infinigen/assets/materials/tiles/cheveron.py index e7994bc15..c4f612873 100644 --- a/infinigen/assets/materials/tiles/cheveron.py +++ b/infinigen/assets/materials/tiles/cheveron.py @@ -21,8 +21,8 @@ def nodegroup_cheveron(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/diamond.py b/infinigen/assets/materials/tiles/diamond.py index f6c6061e8..1343778b2 100644 --- a/infinigen/assets/materials/tiles/diamond.py +++ b/infinigen/assets/materials/tiles/diamond.py @@ -201,8 +201,8 @@ def nodegroup_diamond(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/herringbone.py b/infinigen/assets/materials/tiles/herringbone.py index e4a0ae164..7a2cd8217 100644 --- a/infinigen/assets/materials/tiles/herringbone.py +++ b/infinigen/assets/materials/tiles/herringbone.py @@ -69,8 +69,8 @@ def nodegroup_herringbone(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/hexagon.py b/infinigen/assets/materials/tiles/hexagon.py index 8eb586627..6ad8e3d9e 100644 --- a/infinigen/assets/materials/tiles/hexagon.py +++ b/infinigen/assets/materials/tiles/hexagon.py @@ -222,8 +222,8 @@ def nodegroup_hexagon(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/shell.py b/infinigen/assets/materials/tiles/shell.py index 03fb45f46..a7b416006 100644 --- a/infinigen/assets/materials/tiles/shell.py +++ b/infinigen/assets/materials/tiles/shell.py @@ -20,8 +20,8 @@ def nodegroup_half_shell(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Radius", 0.0000), - ("NodeSocketFloatFactor", "Edge", 0.0000), - ("NodeSocketFloatFactor", "3D-ness", 0.8333), + ("NodeSocketFloat", "Edge", 0.0000), + ("NodeSocketFloat", "3D-ness", 0.8333), ], ) @@ -260,8 +260,8 @@ def nodegroup_shell(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/spanish_bound.py b/infinigen/assets/materials/tiles/spanish_bound.py index 921c987ff..3f9fac4f7 100644 --- a/infinigen/assets/materials/tiles/spanish_bound.py +++ b/infinigen/assets/materials/tiles/spanish_bound.py @@ -23,8 +23,8 @@ def nodegroup_spanish_bond(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/star.py b/infinigen/assets/materials/tiles/star.py index 2303f11bf..70caf8c3a 100644 --- a/infinigen/assets/materials/tiles/star.py +++ b/infinigen/assets/materials/tiles/star.py @@ -20,8 +20,8 @@ def nodegroup_star_single(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Radius", 0.0000), - ("NodeSocketFloatFactor", "Edge", 0.0000), - ("NodeSocketFloatFactor", "3D-ness", 0.8333), + ("NodeSocketFloat", "Edge", 0.0000), + ("NodeSocketFloat", "3D-ness", 0.8333), ], ) @@ -198,8 +198,8 @@ def nodegroup_moon_single(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Radius", 0.0000), - ("NodeSocketFloatFactor", "Edge", 0.0000), - ("NodeSocketFloatFactor", "3D-ness", 0.8333), + ("NodeSocketFloat", "Edge", 0.0000), + ("NodeSocketFloat", "3D-ness", 0.8333), ], ) @@ -407,8 +407,8 @@ def nodegroup_star(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tiles/triangle.py b/infinigen/assets/materials/tiles/triangle.py index 602e80c94..3cd7af894 100644 --- a/infinigen/assets/materials/tiles/triangle.py +++ b/infinigen/assets/materials/tiles/triangle.py @@ -184,8 +184,8 @@ def nodegroup_triangle(nw: NodeWrangler): ("NodeSocketVector", "Coordinate", (0.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "Subtiles Number", 1.0000), ("NodeSocketFloat", "Aspect Ratio", 5.0000), - ("NodeSocketFloatFactor", "border", 0.1000), - ("NodeSocketFloatFactor", "Flatness", 0.9000), + ("NodeSocketFloat", "border", 0.1000), + ("NodeSocketFloat", "Flatness", 0.9000), ], ) diff --git a/infinigen/assets/materials/tongue.py b/infinigen/assets/materials/tongue.py index bec370d02..7038458dd 100644 --- a/infinigen/assets/materials/tongue.py +++ b/infinigen/assets/materials/tongue.py @@ -23,7 +23,7 @@ def shader_tongue(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": (0.8, 0.0605, 0.0437, 1.0), - "Subsurface": 0.0312, + "Subsurface Weight": 0.0312, "Subsurface Color": (0.8, 0.0, 0.2679, 1.0), "Roughness": colorramp.outputs["Color"], }, diff --git a/infinigen/assets/materials/twocolorz.py b/infinigen/assets/materials/twocolorz.py index 3e57bcdff..36d874c5e 100644 --- a/infinigen/assets/materials/twocolorz.py +++ b/infinigen/assets/materials/twocolorz.py @@ -80,7 +80,7 @@ def shader_twocolorz(nw, rand=True, **input_kwargs): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp.outputs["Color"], - "Specular": 0.0, + "Specular IOR Level": 0.0, "Roughness": colorramp_1.outputs["Color"], }, ) diff --git a/infinigen/assets/materials/vase_shaders.py b/infinigen/assets/materials/vase_shaders.py index d50b2b528..483cb13bc 100644 --- a/infinigen/assets/materials/vase_shaders.py +++ b/infinigen/assets/materials/vase_shaders.py @@ -21,15 +21,14 @@ def shader_ceramic(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": rgb, - "Subsurface": 0.3, + "Subsurface Weight": 0.3, "Subsurface Radius": (0.002, 0.002, 0.002), "Subsurface Color": rgb, - "Subsurface IOR": 1.4700, "Subsurface Anisotropy": 0.2000, - "Specular": 0.2000, + "Specular IOR Level": 0.2000, "Roughness": 0.0500, - "Clearcoat": 0.5000, - "Clearcoat Roughness": 0.0500, + "Coat Weight": 0.5000, + "Coat Roughness": 0.0500, "IOR": 1.4700, }, ) diff --git a/infinigen/assets/materials/water.py b/infinigen/assets/materials/water.py index bc678bc22..bc16177e4 100644 --- a/infinigen/assets/materials/water.py +++ b/infinigen/assets/materials/water.py @@ -267,7 +267,7 @@ def shader( "Base Color": color_of_transparent_bsdf_principled_bsdf, "Roughness": 0.0, "IOR": 1.33, - "Transmission": 1.0, + "Transmission Weight": 1.0, }, ) if mix_surface: diff --git a/infinigen/assets/materials/waterfall_material.py b/infinigen/assets/materials/waterfall_material.py index 2adb18511..002b849e1 100644 --- a/infinigen/assets/materials/waterfall_material.py +++ b/infinigen/assets/materials/waterfall_material.py @@ -24,7 +24,7 @@ def waterfall_shader(nw: NodeWrangler): "Base Color": rgb, "Roughness": 0.0, "IOR": 1.33, - "Transmission": 1.0, + "Transmission Weight": 1.0, }, ) @@ -64,10 +64,10 @@ def waterfall_shader(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Metallic": 0.2636, - "Specular": 1.0, + "Specular IOR Level": 1.0, "Roughness": 0.0, "IOR": 1.333, - "Transmission": 0.8205, + "Transmission Weight": 0.8205, "Alpha": colorramp.outputs["Color"], }, ) diff --git a/infinigen/assets/materials/wear_tear/procedural_edge_wear.py b/infinigen/assets/materials/wear_tear/procedural_edge_wear.py index fa4a8cdba..737a35a04 100644 --- a/infinigen/assets/materials/wear_tear/procedural_edge_wear.py +++ b/infinigen/assets/materials/wear_tear/procedural_edge_wear.py @@ -214,7 +214,7 @@ def shader_edge_tear_free_node_group( input_kwargs={ "Base Color": reroute, "Metallic": 0.3745, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": 0.1436, }, ) @@ -297,7 +297,7 @@ def shader_edge_tear_free_node_group( input_kwargs={ "Base Color": reroute, "Metallic": 0.3855, - "Specular": 0.0000, + "Specular IOR Level": 0.0000, "Roughness": 0.0000, }, ) diff --git a/infinigen/assets/materials/woods/wood.py b/infinigen/assets/materials/woods/wood.py index 60cbe405c..65f378e3f 100644 --- a/infinigen/assets/materials/woods/wood.py +++ b/infinigen/assets/materials/woods/wood.py @@ -182,7 +182,7 @@ def shader_wood(nw: NodeWrangler, color=None, w=None, vertical=False, **kwargs): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Clearcoat": np.clip(uniform(0, 1.4), 0, 1), + "Coat Weight": np.clip(uniform(0, 1.4), 0, 1), }, ) nw.new_node( diff --git a/infinigen/assets/objects/appliances/beverage_fridge.py b/infinigen/assets/objects/appliances/beverage_fridge.py index 20f31fd37..39ac14b7a 100644 --- a/infinigen/assets/objects/appliances/beverage_fridge.py +++ b/infinigen/assets/objects/appliances/beverage_fridge.py @@ -128,9 +128,9 @@ def nodegroup_oven_rack(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Height", 2.0000), - ("NodeSocketFloatDistance", "Radius", 0.0200), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Height", 2.0000), + ("NodeSocketFloat", "Radius", 0.0200), ("NodeSocketInt", "Amount", 5), ], ) @@ -275,7 +275,7 @@ def nodegroup_text(nw: NodeWrangler): expose_input=[ ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), - ("NodeSocketFloatDistance", "Size", 0.0500), + ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), ], ) @@ -1111,7 +1111,7 @@ def nodegroup_beverage_fridge_geometry(nw: NodeWrangler, preprocess: bool = Fals ("NodeSocketFloat", "Height", 1.0000), ("NodeSocketFloat", "DoorThickness", 0.0700), ("NodeSocketFloat", "DoorRotation", 0.0000), - ("NodeSocketFloatDistance", "RackRadius", 0.0100), + ("NodeSocketFloat", "RackRadius", 0.0100), ("NodeSocketInt", "RackDAmount", 5), ("NodeSocketInt", "RackHAmount", 2), ("NodeSocketString", "BrandName", "BrandName"), diff --git a/infinigen/assets/objects/appliances/dishwasher.py b/infinigen/assets/objects/appliances/dishwasher.py index d05483b6c..cba6d0966 100644 --- a/infinigen/assets/objects/appliances/dishwasher.py +++ b/infinigen/assets/objects/appliances/dishwasher.py @@ -137,9 +137,9 @@ def nodegroup_dish_rack(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Depth", 2.0000), - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Radius", 0.0200), + ("NodeSocketFloat", "Depth", 2.0000), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Radius", 0.0200), ("NodeSocketInt", "Amount", 5), ("NodeSocketFloat", "Height", 0.5000), ], @@ -344,7 +344,7 @@ def nodegroup_text(nw: NodeWrangler): expose_input=[ ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), - ("NodeSocketFloatDistance", "Size", 0.0500), + ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), ], ) @@ -1180,7 +1180,7 @@ def nodegroup_dishwasher_geometry(nw: NodeWrangler, preprocess: bool = False): ("NodeSocketFloat", "Height", 1.0000), ("NodeSocketFloat", "DoorThickness", 0.0700), ("NodeSocketFloat", "DoorRotation", 0.0000), - ("NodeSocketFloatDistance", "RackRadius", 0.0100), + ("NodeSocketFloat", "RackRadius", 0.0100), ("NodeSocketInt", "RackAmount", 2), ("NodeSocketString", "BrandName", "BrandName"), ("NodeSocketMaterial", "Surface", None), diff --git a/infinigen/assets/objects/appliances/microwave.py b/infinigen/assets/objects/appliances/microwave.py index e7b5d597b..859d2ad6c 100644 --- a/infinigen/assets/objects/appliances/microwave.py +++ b/infinigen/assets/objects/appliances/microwave.py @@ -163,7 +163,7 @@ def nodegroup_text(nw: NodeWrangler): expose_input=[ ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), - ("NodeSocketFloatDistance", "Size", 0.0500), + ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), ], ) diff --git a/infinigen/assets/objects/appliances/oven.py b/infinigen/assets/objects/appliances/oven.py index 685378c35..df0364147 100644 --- a/infinigen/assets/objects/appliances/oven.py +++ b/infinigen/assets/objects/appliances/oven.py @@ -837,7 +837,7 @@ def nodegroup_o(nw: NodeWrangler): ) group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketFloatDistance", "Size", 1.0000)] + Nodes.GroupInput, expose_input=[("NodeSocketFloat", "Size", 1.0000)] ) curve_circle_1 = nw.new_node( @@ -1035,9 +1035,9 @@ def nodegroup_oven_rack(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Height", 2.0000), - ("NodeSocketFloatDistance", "Radius", 0.0200), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Height", 2.0000), + ("NodeSocketFloat", "Radius", 0.0200), ("NodeSocketInt", "Amount", 5), ], ) @@ -1182,7 +1182,7 @@ def nodegroup_text(nw: NodeWrangler): expose_input=[ ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), - ("NodeSocketFloatDistance", "Size", 0.0500), + ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), ], ) @@ -1555,13 +1555,13 @@ def nodegroup_oven_geometry( ("NodeSocketFloat", "Height", 1.0000), ("NodeSocketFloat", "DoorThickness", 0.0700), ("NodeSocketFloat", "DoorRotation", 0.0000), - ("NodeSocketFloatDistance", "RackRadius", 0.0100), + ("NodeSocketFloat", "RackRadius", 0.0100), ("NodeSocketInt", "RackHAmount", 2), ("NodeSocketInt", "RackDAmount", 5), ("NodeSocketFloat", "PanelHeight", 0.3000), ("NodeSocketFloat", "PanelThickness", 0.2000), ("NodeSocketInt", "BottonAmount", 4), - ("NodeSocketFloatDistance", "BottonRadius", 0.0500), + ("NodeSocketFloat", "BottonRadius", 0.0500), ("NodeSocketFloat", "BottonThickness", 0.0300), ("NodeSocketFloat", "HeaterRadiusRatio", 0.1500), ("NodeSocketString", "BrandName", "BrandName"), diff --git a/infinigen/assets/objects/cactus/generate.py b/infinigen/assets/objects/cactus/generate.py index faaf21e81..a121c6819 100644 --- a/infinigen/assets/objects/cactus/generate.py +++ b/infinigen/assets/objects/cactus/generate.py @@ -105,7 +105,7 @@ def shader_cactus(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, + "Specular IOR Level": specular, }, ) return bsdf diff --git a/infinigen/assets/objects/cactus/spike.py b/infinigen/assets/objects/cactus/spike.py index 4b530d25a..94efd0214 100644 --- a/infinigen/assets/objects/cactus/spike.py +++ b/infinigen/assets/objects/cactus/spike.py @@ -132,8 +132,8 @@ def shader_spikes(nw: NodeWrangler): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Subsurface": 0.1, + "Specular IOR Level": specular, + "Subsurface Weight": 0.1, }, ) transparent_bsdf = nw.new_node(Nodes.TranslucentBSDF, [color]) diff --git a/infinigen/assets/objects/corals/generate.py b/infinigen/assets/objects/corals/generate.py index b00a6dd36..707c156de 100644 --- a/infinigen/assets/objects/corals/generate.py +++ b/infinigen/assets/objects/corals/generate.py @@ -172,8 +172,8 @@ def shader_coral(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Subsurface": subsurface_ratio, + "Specular IOR Level": specular, + "Subsurface Weight": subsurface_ratio, "Subsurface Radius": subsurface_radius, "Subsurface Color": subsurface_color, }, diff --git a/infinigen/assets/objects/corals/tentacles.py b/infinigen/assets/objects/corals/tentacles.py index d7eb27042..056fa7712 100644 --- a/infinigen/assets/objects/corals/tentacles.py +++ b/infinigen/assets/objects/corals/tentacles.py @@ -136,8 +136,8 @@ def shader_tentacles(nw: NodeWrangler, base_hue=0.3): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Subsurface": 0.01, + "Specular IOR Level": specular, + "Subsurface Weight": 0.01, }, ) fresnel_color = hsv2rgba(uniform(0, 1), 0.6, 0.6) diff --git a/infinigen/assets/objects/creatures/crustacean.py b/infinigen/assets/objects/creatures/crustacean.py index d0318615c..62da7d55a 100644 --- a/infinigen/assets/objects/creatures/crustacean.py +++ b/infinigen/assets/objects/creatures/crustacean.py @@ -224,9 +224,9 @@ def shader_crustacean(nw: NodeWrangler, params): "Base Color": color, "Metallic": metallic, "Roughness": roughness, - "Specular": specular, - "Specular Tint": specular_tint, - "Clearcoat": clearcoat, + "Specular IOR Level": specular, + "Specular IOR Level Tint": specular_tint, + "Coat Weight": clearcoat, }, ) return bsdf @@ -235,7 +235,7 @@ def shader_crustacean(nw: NodeWrangler, params): def shader_eye(nw: NodeWrangler): return nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": (0.1, 0.1, 0.1, 1), "Specular": 0}, + input_kwargs={"Base Color": (0.1, 0.1, 0.1, 1), "Specular IOR Level": 0}, ) diff --git a/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py b/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py index 9dab4c5d9..1e5a7601e 100644 --- a/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py +++ b/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py @@ -146,7 +146,7 @@ def shader_dragonfly_body_shader(nw: NodeWrangler, base_color, v): input_kwargs={ "Base Color": mix, "Metallic": 0.2182, - "Specular": 0.8318, + "Specular IOR Level": 0.8318, "Roughness": 0.1545, }, ) diff --git a/infinigen/assets/objects/creatures/insects/parts/eye/dragonfly_eye.py b/infinigen/assets/objects/creatures/insects/parts/eye/dragonfly_eye.py index 73ce2b41c..b14630e1c 100644 --- a/infinigen/assets/objects/creatures/insects/parts/eye/dragonfly_eye.py +++ b/infinigen/assets/objects/creatures/insects/parts/eye/dragonfly_eye.py @@ -70,7 +70,7 @@ def shader_dragonfly_eye_shader(nw: NodeWrangler, base_color, v): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix, - "Specular": map_range_1.outputs["Result"], + "Specular IOR Level": map_range_1.outputs["Result"], "Roughness": 0.0, }, ) diff --git a/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py b/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py index 7dec045a3..3e8e2af61 100644 --- a/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py +++ b/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py @@ -93,7 +93,11 @@ def shader_dragonfly_head_shader(nw: NodeWrangler, base_color, v): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix, "Specular": 0.7545, "Roughness": 0.0636}, + input_kwargs={ + "Base Color": mix, + "Specular IOR Level": 0.7545, + "Roughness": 0.0636, + }, ) material_output = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py b/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py index 0ff9ceb1c..0f4420f0d 100644 --- a/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py +++ b/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py @@ -154,7 +154,7 @@ def shader_dragonfly_tail_shader(nw: NodeWrangler, base_color, v, ring_length): input_kwargs={ "Base Color": mix_1, "Metallic": 0.5, - "Specular": 0.5114, + "Specular IOR Level": 0.5114, "Roughness": 0.2568, }, ) @@ -178,7 +178,7 @@ def nodegroup_dragonfly_tail( ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, 0.0)), ("NodeSocketVectorTranslation", "Middle", (1.84, 0.0, 0.14)), ("NodeSocketVectorTranslation", "End", (3.14, 0.0, -0.32)), - ("NodeSocketFloatDistance", "Segment Length", 0.44), + ("NodeSocketFloat", "Segment Length", 0.44), ("NodeSocketFloat", "Segment Scale", 0.25), ("NodeSocketFloat", "Random Seed", 3.2), ("NodeSocketFloat", "Radius", 0.9), @@ -641,7 +641,7 @@ def nodegroup_add_vertical_stripes(nw: NodeWrangler): # input_kwargs={'Fac': maximum, 'Color1': group_1, 'Color2': mix_1}) # principled_bsdf = nw.new_node(Nodes.PrincipledBSDF, -# input_kwargs={'Base Color': mix, 'Metallic': 0.9, 'Specular': 0.5114, 'Roughness': 0.2568}) +# input_kwargs={'Base Color': mix, 'Metallic': 0.9, 'Specular IOR Level': 0.5114, 'Roughness': 0.2568}) # material_output = nw.new_node(Nodes.MaterialOutput, # input_kwargs={'Surface': principled_bsdf}) diff --git a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py index 6874ec382..7b62ff07b 100644 --- a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py +++ b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py @@ -114,8 +114,8 @@ def nodegroup_attach_part(nw: NodeWrangler): ("NodeSocketGeometry", "Skin Mesh", None), ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketFloatFactor", "Length Fac", 0.0), - ("NodeSocketVectorEuler", "Ray Rot", (0.0, 0.0, 0.0)), + ("NodeSocketFloat", "Length Fac", 0.0), + ("NodeSocketVector", "Ray Rot", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Rad", 0.0), ("NodeSocketVector", "Part Rot", (0.0, 0.0, 0.0)), ("NodeSocketBool", "Do Normal Rot", False), @@ -260,8 +260,8 @@ def nodegroup_instance_on_points(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "rotation base", (0.0, 0.0, 0.0)), - ("NodeSocketVectorEuler", "rotation delta", (-1.5708, 0.0, 0.0)), + ("NodeSocketVector", "rotation base", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "rotation delta", (-1.5708, 0.0, 0.0)), ("NodeSocketVectorTranslation", "translation", (0.0, -0.5, 0.0)), ("NodeSocketFloat", "scale", 0.0), ("NodeSocketGeometry", "Points", None), @@ -402,7 +402,7 @@ def shader_dragonfly_body_shader(nw: NodeWrangler): input_kwargs={ "Base Color": group_1, "Metallic": 0.2182, - "Specular": 0.8318, + "Specular IOR Level": 0.8318, "Roughness": 0.1545, }, ) @@ -599,7 +599,7 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "Rotation", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Rotation", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Hit Normal", (0.0, 0.0, 1.0)), ("NodeSocketVector", "Curve Tangent", (0.0, 0.0, 1.0)), ("NodeSocketBool", "Do Normal Rot", False), @@ -675,8 +675,8 @@ def nodegroup_part_surface(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Skin Mesh", None), - ("NodeSocketFloatFactor", "Length Fac", 0.0), - ("NodeSocketVectorEuler", "Ray Rot", (0.0, 0.0, 0.0)), + ("NodeSocketFloat", "Length Fac", 0.0), + ("NodeSocketVector", "Ray Rot", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Rad", 0.0), ], ) @@ -1325,7 +1325,7 @@ def nodegroup_profile_part(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Profile Curve", None), - ("NodeSocketFloatDistance", "Radius Func", 1.0), + ("NodeSocketFloat", "Radius Func", 1.0), ], ) diff --git a/infinigen/assets/objects/creatures/insects/utils/shader_utils.py b/infinigen/assets/objects/creatures/insects/utils/shader_utils.py index 31826f4f7..c35ce4af1 100644 --- a/infinigen/assets/objects/creatures/insects/utils/shader_utils.py +++ b/infinigen/assets/objects/creatures/insects/utils/shader_utils.py @@ -21,7 +21,7 @@ def shader_black_w_noise_shader(nw: NodeWrangler): input_kwargs={ "Base Color": group, "Metallic": 0.9, - "Specular": 0.5114, + "Specular IOR Level": 0.5114, "Roughness": 0.2568, }, ) diff --git a/infinigen/assets/objects/creatures/parts/chameleon.py b/infinigen/assets/objects/creatures/parts/chameleon.py index a62ca6712..8f9e142b1 100644 --- a/infinigen/assets/objects/creatures/parts/chameleon.py +++ b/infinigen/assets/objects/creatures/parts/chameleon.py @@ -294,7 +294,7 @@ def nodegroup_chameleon_claw_shape(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "Rotation", (0.0000, 1.0472, 0.0000)), + ("NodeSocketVector", "Rotation", (0.0000, 1.0472, 0.0000)), ("NodeSocketVectorXYZ", "Scale", (0.2000, 0.2000, 0.4000)), ], ) @@ -383,8 +383,8 @@ def nodegroup_chameleon_foot_shape(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "ouRotation", (0.0000, 1.0472, 0.0000)), - ("NodeSocketVectorEuler", "inRotation", (0.0000, 2.0944, 3.1416)), + ("NodeSocketVector", "ouRotation", (0.0000, 1.0472, 0.0000)), + ("NodeSocketVector", "inRotation", (0.0000, 2.0944, 3.1416)), ("NodeSocketVectorXYZ", "ouScale", (1.0000, 1.0000, 1.0000)), ("NodeSocketVectorXYZ", "inScale", (1.0000, 1.0000, 1.0000)), ], @@ -2358,7 +2358,7 @@ def shader_chameleon(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": combine_color, - "Specular": 0.3000, + "Specular IOR Level": 0.3000, "Roughness": 0.6000, }, ) @@ -2383,7 +2383,7 @@ def nodegroup_chameleon_leg_shape(nw: NodeWrangler): ("NodeSocketFloat", "body_position", 0.1000), ("NodeSocketFloat", "body_thickness", 0.0500), ("NodeSocketFloat", "body_height", -0.1000), - ("NodeSocketVectorEuler", "Rotation", (0.0000, -0.6981, 0.0000)), + ("NodeSocketVector", "Rotation", (0.0000, -0.6981, 0.0000)), ("NodeSocketFloat", "thigh_length", 0.6000), ("NodeSocketFloat", "calf_length", 0.5000), ("NodeSocketFloat", "thigh_body_rotation", 25.0000), @@ -3272,7 +3272,7 @@ def nodegroup_round_bump(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketFloatDistance", "Distance", 0.0200), + ("NodeSocketFloat", "Distance", 0.0200), ("NodeSocketFloat", "Offset Scale", 0.0100), ("NodeSocketInt", "Level", 1), ], @@ -3479,7 +3479,7 @@ def shader_chameleon_eye(nw: NodeWrangler): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": combine_color, - "Specular": 0.3000, + "Specular IOR Level": 0.3000, "Roughness": 0.6000, }, ) @@ -3504,8 +3504,8 @@ def nodegroup_chameleon(nw: NodeWrangler): ("NodeSocketFloat", "head_crown", 0.2000), ("NodeSocketFloat", "head_eyebrow", 0.0200), ("NodeSocketVectorXYZ", "head_scale", (1.0000, 1.0000, 1.0000)), - ("NodeSocketVectorEuler", "left_eye_rotation", (0.0000, 0.0000, -1.5)), - ("NodeSocketVectorEuler", "right_eye_rotation", (0.0000, 0.0000, 1.5)), + ("NodeSocketVector", "left_eye_rotation", (0.0000, 0.0000, -1.5)), + ("NodeSocketVector", "right_eye_rotation", (0.0000, 0.0000, 1.5)), ("NodeSocketFloat", "pupil_radius", 0.2200), ("NodeSocketFloat", "front_leg_position", 0.0800), ("NodeSocketFloat", "back_leg_position", 0.8500), diff --git a/infinigen/assets/objects/creatures/parts/eye.py b/infinigen/assets/objects/creatures/parts/eye.py index f4bf9737a..040dc97b2 100644 --- a/infinigen/assets/objects/creatures/parts/eye.py +++ b/infinigen/assets/objects/creatures/parts/eye.py @@ -150,7 +150,7 @@ def nodegroup_mammal_eye(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.050000000000000003), + ("NodeSocketFloat", "Radius", 0.050000000000000003), ("NodeSocketFloat", "Eyelid Thickness Ratio", 0.34999999999999998), ("NodeSocketFloat", "Eyelid Fullness", 2.0), ("NodeSocketBool", "Eyelids", True), diff --git a/infinigen/assets/objects/creatures/parts/eye_new.py b/infinigen/assets/objects/creatures/parts/eye_new.py index 15de54705..cbb9ffecb 100644 --- a/infinigen/assets/objects/creatures/parts/eye_new.py +++ b/infinigen/assets/objects/creatures/parts/eye_new.py @@ -152,7 +152,7 @@ def nodegroup_cornea(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "ScaleX", 0.5000), ("NodeSocketFloat", "Height", 2.0000), - ("NodeSocketFloatFactor", "ScaleZ", 0.0000), + ("NodeSocketFloat", "ScaleZ", 0.0000), ("NodeSocketFloat", "Y", 20.0000), ("NodeSocketInt", "Resolution", 128), ], @@ -649,7 +649,7 @@ def nodegroup_eye_ball(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "CorneaScaleX", 0.52), ("NodeSocketFloat", "Height", 1.2), - ("NodeSocketFloatFactor", "CorneaScaleZ", 0.8), + ("NodeSocketFloat", "CorneaScaleZ", 0.8), ("NodeSocketFloat", "Y", 20.0), ("NodeSocketInt", "EyeballResolution", 32), ("NodeSocketInt", "CorneaResolution", 128), @@ -1337,16 +1337,20 @@ def shader_eyeball_fish(nw: NodeWrangler, rand=True, **input_kwargs): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix_2, "Specular": 0.0000, "Roughness": 0.0000}, + input_kwargs={ + "Base Color": mix_2, + "Specular IOR Level": 0.0000, + "Roughness": 0.0000, + }, ) principled_bsdf_1 = nw.new_node( Nodes.PrincipledBSDF, input_kwargs={ - "Specular": 1.0000, + "Specular IOR Level": 1.0000, "Roughness": 0.0000, "IOR": 1.3500, - "Transmission": 1.0000, + "Transmission Weight": 1.0000, }, ) @@ -1705,7 +1709,7 @@ def nodegroup_append_eye(nw: NodeWrangler): ("NodeSocketGeometry", "Geometry", None), ("NodeSocketVector", "Translation", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Scale", 0.0), - ("NodeSocketVectorEuler", "Rotation", (0.1745, 0.0, -1.3963)), + ("NodeSocketVector", "Rotation", (0.1745, 0.0, -1.3963)), ("NodeSocketVector", "Ray Direction", (-1.0, 0.0, 0.0)), ("NodeSocketFloat", "Default Offset", -0.002), ], @@ -2274,7 +2278,7 @@ def nodegroup_profile_part(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Profile Curve", None), - ("NodeSocketFloatDistance", "Radius Func", 1.0), + ("NodeSocketFloat", "Radius Func", 1.0), ], ) @@ -2450,7 +2454,7 @@ def nodegroup_solidify(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Mesh", None), - ("NodeSocketFloatDistance", "Distance", 0.0), + ("NodeSocketFloat", "Distance", 0.0), ], ) @@ -2572,7 +2576,7 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "Rotation", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Rotation", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Hit Normal", (0.0, 0.0, 1.0)), ("NodeSocketVector", "Curve Tangent", (0.0, 0.0, 1.0)), ("NodeSocketBool", "Do Normal Rot", False), @@ -2648,8 +2652,8 @@ def nodegroup_part_surface(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Skin Mesh", None), - ("NodeSocketFloatFactor", "Length Fac", 0.0), - ("NodeSocketVectorEuler", "Ray Rot", (0.0, 0.0, 0.0)), + ("NodeSocketFloat", "Length Fac", 0.0), + ("NodeSocketVector", "Ray Rot", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Rad", 0.0), ], ) @@ -2742,7 +2746,7 @@ def nodegroup_eyeball_eyelid(nw: NodeWrangler): ), ("NodeSocketVector", "OffsetPreAppending", (0.0120, 0.0000, 0.0000)), ("NodeSocketFloat", "Scale", 1.0), - ("NodeSocketVectorEuler", "Rotation", (0.1745, 0.0000, -1.3963)), + ("NodeSocketVector", "Rotation", (0.1745, 0.0000, -1.3963)), ("NodeSocketVector", "RayDirection", (-1.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "DefaultAppendDistance", -0.0020), ("NodeSocketVector", "EyeSocketRot", (0.0000, 0.0000, 0.0000)), @@ -3195,11 +3199,11 @@ def nodegroup_carnivore_jaw(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "length_rad1_rad2", (0.0, 0.0, 0.0)), - ("NodeSocketFloatFactor", "Width Shaping", 0.6764), + ("NodeSocketFloat", "Width Shaping", 0.6764), ("NodeSocketFloat", "Canine Length", 0.05), ("NodeSocketFloat", "Incisor Size", 0.01), ("NodeSocketFloat", "Tooth Crookedness", 0.0), - ("NodeSocketFloatFactor", "Tongue Shaping", 1.0), + ("NodeSocketFloat", "Tongue Shaping", 1.0), ("NodeSocketFloat", "Tongue X Scale", 0.9), ], ) @@ -3598,8 +3602,8 @@ def nodegroup_cat_ear(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "length_rad1_rad2", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Depth", 0.0), - ("NodeSocketFloatDistance", "Thickness", 0.0), - ("NodeSocketFloatDistance", "Curl Deg", 0.0), + ("NodeSocketFloat", "Thickness", 0.0), + ("NodeSocketFloat", "Curl Deg", 0.0), ], ) @@ -3752,9 +3756,9 @@ def nodegroup_cat_nose(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Nose Radius", 0.06), - ("NodeSocketFloatDistance", "Nostril Size", 0.025), - ("NodeSocketFloatFactor", "Crease", 0.008), + ("NodeSocketFloat", "Nose Radius", 0.06), + ("NodeSocketFloat", "Nostril Size", 0.025), + ("NodeSocketFloat", "Crease", 0.008), ("NodeSocketVectorXYZ", "Scale", (1.2, 1.0, 1.0)), ], ) @@ -3821,8 +3825,8 @@ def nodegroup_attach_part(nw: NodeWrangler): ("NodeSocketGeometry", "Skin Mesh", None), ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketFloatFactor", "Length Fac", 0.0), - ("NodeSocketVectorEuler", "Ray Rot", (0.0, 0.0, 0.0)), + ("NodeSocketFloat", "Length Fac", 0.0), + ("NodeSocketVector", "Ray Rot", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Rad", 0.0), ("NodeSocketVector", "Part Rot", (0.0, 0.0, 0.0)), ("NodeSocketBool", "Do Normal Rot", False), @@ -4255,16 +4259,16 @@ def shader_eyeball_tiger(nw: NodeWrangler, **input_kwargs): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix_2, "Specular": 0.0, "Roughness": 0.0}, + input_kwargs={"Base Color": mix_2, "Specular IOR Level": 0.0, "Roughness": 0.0}, ) principled_bsdf_1 = nw.new_node( Nodes.PrincipledBSDF, input_kwargs={ - "Specular": 1.0, + "Specular IOR Level": 1.0, "Roughness": 0.0, "IOR": 1.35, - "Transmission": 1.0, + "Transmission Weight": 1.0, }, ) diff --git a/infinigen/assets/objects/creatures/parts/foot.py b/infinigen/assets/objects/creatures/parts/foot.py index 64b0b3aab..4da3143c9 100644 --- a/infinigen/assets/objects/creatures/parts/foot.py +++ b/infinigen/assets/objects/creatures/parts/foot.py @@ -34,7 +34,7 @@ def nodegroup_tiger_toe(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "length_rad1_rad2", (0.18, 0.045, 0.024)), - ("NodeSocketFloatDistance", "Toebean Radius", 0.03), + ("NodeSocketFloat", "Toebean Radius", 0.03), ("NodeSocketFloat", "Claw Curl Deg", 30.0), ("NodeSocketVector", "Claw Pct Length Rad1 Rad2", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Toe Curl Scalar", 1.0), @@ -221,7 +221,7 @@ def nodegroup_foot(nw: NodeWrangler): ("NodeSocketVector", "Toe Rotate", (0.0000, -1.57, 0.0000)), ("NodeSocketVector", "Toe Length Rad1 Rad2", (0.3000, 0.0450, 0.0250)), ("NodeSocketFloat", "Toe Splay", 0.0000), - ("NodeSocketFloatDistance", "Toebean Radius", 0.0300), + ("NodeSocketFloat", "Toebean Radius", 0.0300), ("NodeSocketFloat", "Claw Curl Deg", 30.0000), ("NodeSocketVector", "Claw Pct Length Rad1 Rad2", (0.3000, 0.5000, 0.0000)), ("NodeSocketVector", "Thumb Pct", (1.0000, 1.0000, 1.0000)), diff --git a/infinigen/assets/objects/creatures/parts/head.py b/infinigen/assets/objects/creatures/parts/head.py index e8feea2e4..cb8ea4797 100644 --- a/infinigen/assets/objects/creatures/parts/head.py +++ b/infinigen/assets/objects/creatures/parts/head.py @@ -44,11 +44,11 @@ def nodegroup_carnivore_jaw(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "length_rad1_rad2", (0.0, 0.0, 0.0)), - ("NodeSocketFloatFactor", "Width Shaping", 0.6764), + ("NodeSocketFloat", "Width Shaping", 0.6764), ("NodeSocketFloat", "Canine Length", 0.050000000000000003), ("NodeSocketFloat", "Incisor Size", 0.01), ("NodeSocketFloat", "Tooth Crookedness", 0.0), - ("NodeSocketFloatFactor", "Tongue Shaping", 1.0), + ("NodeSocketFloat", "Tongue Shaping", 1.0), ("NodeSocketFloat", "Tongue X Scale", 0.90000000000000002), ], ) @@ -500,7 +500,7 @@ def nodegroup_carnivore_head(nw: NodeWrangler): (0.3, 60.6, 66.0), ), ("NodeSocketFloat", "aspect", 1.0), - ("NodeSocketFloatDistance", "EyeRad", 0.03), + ("NodeSocketFloat", "EyeRad", 0.03), ("NodeSocketVector", "EyeOffset", (-0.2, 0.5, 0.2)), ], ) @@ -979,7 +979,7 @@ def nodegroup_flying_bird_head(nw: NodeWrangler): ), ("NodeSocketVector", "angles_deg", (0.0, -24.0, -20.0)), ("NodeSocketVector", "eye_coord", (0.5, 0.0, 1.0)), - ("NodeSocketFloatDistance", "Radius", 0.040000000000000001), + ("NodeSocketFloat", "Radius", 0.040000000000000001), ], ) @@ -1039,7 +1039,7 @@ def nodegroup_bird_head(nw: NodeWrangler): ), ("NodeSocketVector", "angles_deg", (0.0, -24.0, -20.0)), ("NodeSocketVector", "eye_coord", (0.5, 0.0, 1.0)), - ("NodeSocketFloatDistance", "Radius", 0.040000000000000001), + ("NodeSocketFloat", "Radius", 0.040000000000000001), ], ) diff --git a/infinigen/assets/objects/creatures/parts/head_detail.py b/infinigen/assets/objects/creatures/parts/head_detail.py index 1bd1d5920..57f4aa6f2 100644 --- a/infinigen/assets/objects/creatures/parts/head_detail.py +++ b/infinigen/assets/objects/creatures/parts/head_detail.py @@ -36,8 +36,8 @@ def nodegroup_cat_ear(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "length_rad1_rad2", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Depth", 0.0), - ("NodeSocketFloatDistance", "Thickness", 0.0), - ("NodeSocketFloatDistance", "Curl Deg", 0.0), + ("NodeSocketFloat", "Thickness", 0.0), + ("NodeSocketFloat", "Curl Deg", 0.0), ], ) @@ -169,9 +169,9 @@ def nodegroup_cat_nose(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Nose Radius", 0.06), - ("NodeSocketFloatDistance", "Nostril Size", 0.025), - ("NodeSocketFloatFactor", "Crease", 0.008), + ("NodeSocketFloat", "Nose Radius", 0.06), + ("NodeSocketFloat", "Nostril Size", 0.025), + ("NodeSocketFloat", "Crease", 0.008), ("NodeSocketVectorXYZ", "Scale", (1.2, 1.0, 1.0)), ], ) diff --git a/infinigen/assets/objects/creatures/parts/horn.py b/infinigen/assets/objects/creatures/parts/horn.py index 0f3be8dfc..00db0231c 100644 --- a/infinigen/assets/objects/creatures/parts/horn.py +++ b/infinigen/assets/objects/creatures/parts/horn.py @@ -171,7 +171,7 @@ def nodegroup_horn(nw: NodeWrangler): ("NodeSocketFloat", "thickness", 4.0), ("NodeSocketFloat", "density_of_ridge", 0.0), ("NodeSocketFloat", "depth_of_ridge", 0.2), - ("NodeSocketFloatDistance", "height", 2.5), + ("NodeSocketFloat", "height", 2.5), ("NodeSocketFloat", "rotation_x", 0), ], ) diff --git a/infinigen/assets/objects/creatures/parts/wings.py b/infinigen/assets/objects/creatures/parts/wings.py index 73aded341..9aef1ff54 100644 --- a/infinigen/assets/objects/creatures/parts/wings.py +++ b/infinigen/assets/objects/creatures/parts/wings.py @@ -263,7 +263,7 @@ def nodegroup_bird_wing(nw: NodeWrangler): ("NodeSocketFloat", "feather_density", 18.7), ("NodeSocketFloat", "aspect", 1.0), ("NodeSocketFloat", "fullness", 4.0), - ("NodeSocketFloatFactor", "Wing Shape Sculpting", 1.0), + ("NodeSocketFloat", "Wing Shape Sculpting", 1.0), ("NodeSocketVector", "Feather length_rad1_rad2", (0.6, 0.04, 0.04)), ("NodeSocketFloat", "Extension", 1.68), ], @@ -861,7 +861,7 @@ def nodegroup_flying_bird_wing(nw: NodeWrangler): ("NodeSocketFloat", "feather_density", 18.7000), ("NodeSocketFloat", "aspect", 1.0000), ("NodeSocketFloat", "fullness", 4.0000), - ("NodeSocketFloatFactor", "Wing Shape Sculpting", 1.0000), + ("NodeSocketFloat", "Wing Shape Sculpting", 1.0000), ("NodeSocketVector", "Length Rad1 Rad2", (0.6000, 0.0400, 0.0400)), ("NodeSocketFloat", "Extension", 1.6800), ], diff --git a/infinigen/assets/objects/creatures/util/animation/curve_slither.py b/infinigen/assets/objects/creatures/util/animation/curve_slither.py index 99691e273..d307f9faa 100644 --- a/infinigen/assets/objects/creatures/util/animation/curve_slither.py +++ b/infinigen/assets/objects/creatures/util/animation/curve_slither.py @@ -187,7 +187,7 @@ def nodegroup_wiggles(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketFloatDistance", "Wavelength", 2.3300), + ("NodeSocketFloat", "Wavelength", 2.3300), ("NodeSocketFloat", "Magnitude", 1.6800), ("NodeSocketFloat", "MagRandom", 1.0000), ("NodeSocketFloat", "Loopyness", 0.5800), diff --git a/infinigen/assets/objects/fruits/cross_section_lib.py b/infinigen/assets/objects/fruits/cross_section_lib.py index 6d7417f01..72f5c2335 100644 --- a/infinigen/assets/objects/fruits/cross_section_lib.py +++ b/infinigen/assets/objects/fruits/cross_section_lib.py @@ -216,9 +216,9 @@ def nodegroup_cylax_cross_section(nw: NodeWrangler): expose_input=[ ("NodeSocketInt", "fork number", 10), ("NodeSocketFloat", "bottom radius", 0.0), - ("NodeSocketFloatDistance", "noise random seed", 0.0), + ("NodeSocketFloat", "noise random seed", 0.0), ("NodeSocketFloat", "noise amount", 0.4), - ("NodeSocketFloatDistance", "radius", 1.0), + ("NodeSocketFloat", "radius", 1.0), ], ) diff --git a/infinigen/assets/objects/fruits/fruit_utils.py b/infinigen/assets/objects/fruits/fruit_utils.py index bac98645d..21b746fa3 100644 --- a/infinigen/assets/objects/fruits/fruit_utils.py +++ b/infinigen/assets/objects/fruits/fruit_utils.py @@ -154,7 +154,7 @@ def nodegroup_point_on_mesh(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Mesh", None), ("NodeSocketFloat", "spline parameter", 0.0), - ("NodeSocketFloatDistance", "Distance Min", 0.2), + ("NodeSocketFloat", "Distance Min", 0.2), ("NodeSocketFloat", "parameter max", 1.0), ("NodeSocketFloat", "parameter min", 0.0), ("NodeSocketFloat", "noise amount", 1.0), @@ -260,8 +260,8 @@ def nodegroup_instance_on_points(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "rotation base", (0.0, 0.0, 0.0)), - ("NodeSocketVectorEuler", "rotation delta", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "rotation base", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "rotation delta", (0.0, 0.0, 0.0)), ("NodeSocketVectorTranslation", "translation", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "scale", 0.0), ("NodeSocketGeometry", "Points", None), @@ -933,7 +933,7 @@ def nodegroup_hair(nw: NodeWrangler): ("NodeSocketIntUnsigned", "length resolution", 8), ("NodeSocketInt", "cross section resolution", 4), ("NodeSocketFloat", "scale", 0.0), - ("NodeSocketFloatDistance", "Radius", 0.01), + ("NodeSocketFloat", "Radius", 0.01), ("NodeSocketMaterial", "Material", None), ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, 0.0)), ("NodeSocketVectorTranslation", "Middle", (0.0, 0.3, 1.0)), diff --git a/infinigen/assets/objects/fruits/stem_lib.py b/infinigen/assets/objects/fruits/stem_lib.py index ba4bef58b..61b2732b1 100644 --- a/infinigen/assets/objects/fruits/stem_lib.py +++ b/infinigen/assets/objects/fruits/stem_lib.py @@ -79,7 +79,7 @@ def shader_basic_stem_shader(nw: NodeWrangler, stem_color): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": hue_saturation_value, - "Specular": 0.1205, + "Specular IOR Level": 0.1205, "Roughness": 0.5068, }, ) @@ -102,7 +102,7 @@ def nodegroup_basic_stem(nw: NodeWrangler, stem_color=(0.179, 0.836, 0.318, 1.0) ("NodeSocketVectorTranslation", "quad_mid", (0.0, -0.05, 0.2)), ("NodeSocketVectorTranslation", "quad_end", (-0.1, 0.0, 0.4)), ("NodeSocketIntUnsigned", "quad_res", 128), - ("NodeSocketFloatDistance", "cross_radius", 0.08), + ("NodeSocketFloat", "cross_radius", 0.08), ("NodeSocketInt", "cross_res", 128), ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), ("NodeSocketVectorXYZ", "Scale", (1.0, 1.0, 2.0)), @@ -217,7 +217,7 @@ def shader_calyx_shader(nw: NodeWrangler, stem_color): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": hue_saturation_value, - "Specular": 0.5136, + "Specular IOR Level": 0.5136, "Roughness": 0.7614, }, ) @@ -244,16 +244,16 @@ def nodegroup_calyx_stem(nw: NodeWrangler, stem_color=(0.1678, 0.4541, 0.0397, 1 expose_input=[ ("NodeSocketGeometry", "Geometry", None), ("NodeSocketInt", "fork number", 10), - ("NodeSocketFloatDistance", "outer radius", 1.0), + ("NodeSocketFloat", "outer radius", 1.0), ("NodeSocketFloat", "inner radius", 0.2), ("NodeSocketFloat", "cross section noise amount", 0.4), ("NodeSocketFloat", "z noise amount", 1.0), - ("NodeSocketFloatDistance", "noise random seed", 0.0), + ("NodeSocketFloat", "noise random seed", 0.0), ("NodeSocketVectorTranslation", "quad_start", (0.0, 0.0, 0.0)), ("NodeSocketVectorTranslation", "quad_mid", (0.0, -0.05, 0.2)), ("NodeSocketVectorTranslation", "quad_end", (-0.1, 0.0, 0.4)), ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), - ("NodeSocketFloatDistance", "cross_radius", 0.04), + ("NodeSocketFloat", "cross_radius", 0.04), ], ) @@ -378,7 +378,7 @@ def nodegroup_jigsaw(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "Value", 0.5), ("NodeSocketFloat", "noise scale", 30.0), - ("NodeSocketFloatFactor", "noise randomness", 0.7), + ("NodeSocketFloat", "noise randomness", 0.7), ("NodeSocketFloat", "From Max", 0.15), ("NodeSocketFloat", "To Min", 0.9), ], @@ -517,7 +517,7 @@ def nodegroup_coconut_calyx(nw: NodeWrangler, basic_color, edge_color): expose_input=[ ("NodeSocketFloat", "width", 0.5), ("NodeSocketInt", "resolution", 128), - ("NodeSocketFloatDistance", "radius", 1.0), + ("NodeSocketFloat", "radius", 1.0), ("NodeSocketInt", "subdivision", 5), ("NodeSocketFloat", "bump displacement", 0.16), ("NodeSocketFloat", "bump scale", 3.22), @@ -834,7 +834,7 @@ def shader_leaf(nw: NodeWrangler, basic_color): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": hue_saturation_value, - "Specular": 0.5955, + "Specular IOR Level": 0.5955, "Roughness": 1.0, }, ) @@ -953,7 +953,7 @@ def nodegroup_pineapple_crown(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Leaf", None), ("NodeSocketVectorTranslation", "translation", (0.0, 0.0, 0.7)), - ("NodeSocketVectorEuler", "rotation base", (-0.4363, 0.0, 0.0)), + ("NodeSocketVector", "rotation base", (-0.4363, 0.0, 0.0)), ("NodeSocketInt", "number of leaves", 75), ("NodeSocketFloat", "noise amount", 0.1), ("NodeSocketFloat", "noise scale", 50.0), @@ -1086,7 +1086,7 @@ def nodegroup_pineapple_stem(nw: NodeWrangler, basic_color): ("NodeSocketVectorTranslation", "Middle", (0.0, -0.32, 3.72)), ("NodeSocketVectorTranslation", "End", (0.0, 0.92, 4.32)), ("NodeSocketVectorTranslation", "translation", (0.0, 0.0, 0.7)), - ("NodeSocketVectorEuler", "rotation base", (-0.5236, 0.0, 0.0)), + ("NodeSocketVector", "rotation base", (-0.5236, 0.0, 0.0)), ("NodeSocketInt", "number of leaves", 75), ("NodeSocketFloat", "noise amount", 0.1), ("NodeSocketFloat", "noise scale", 20.0), diff --git a/infinigen/assets/objects/fruits/surfaces/blackberry_surface.py b/infinigen/assets/objects/fruits/surfaces/blackberry_surface.py index 2f772c241..24c6235b0 100644 --- a/infinigen/assets/objects/fruits/surfaces/blackberry_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/blackberry_surface.py @@ -24,7 +24,11 @@ def shader_berry_shader(nw: NodeWrangler, berry_color): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": berry_color, "Specular": 0.5705, "Roughness": 0.2}, + input_kwargs={ + "Base Color": berry_color, + "Specular IOR Level": 0.5705, + "Roughness": 0.2, + }, ) material_output = nw.new_node( diff --git a/infinigen/assets/objects/fruits/surfaces/coconutgreen_surface.py b/infinigen/assets/objects/fruits/surfaces/coconutgreen_surface.py index c76d4db05..ca6adb11b 100644 --- a/infinigen/assets/objects/fruits/surfaces/coconutgreen_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/coconutgreen_surface.py @@ -112,7 +112,11 @@ def shader_coconut_green_shader(nw: NodeWrangler, basic_color, bottom_color): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": group_1, "Specular": 0.4773, "Roughness": 0.4455}, + input_kwargs={ + "Base Color": group_1, + "Specular IOR Level": 0.4773, + "Roughness": 0.4455, + }, ) material_output = nw.new_node( diff --git a/infinigen/assets/objects/fruits/surfaces/durian_surface.py b/infinigen/assets/objects/fruits/surfaces/durian_surface.py index e1b005d2f..9a6be358c 100644 --- a/infinigen/assets/objects/fruits/surfaces/durian_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/durian_surface.py @@ -76,7 +76,7 @@ def shader_durian_shader(nw: NodeWrangler, peak_color, base_color): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": hue_saturation_value, - "Specular": 0.1205, + "Specular IOR Level": 0.1205, "Roughness": 0.5068, }, ) @@ -103,7 +103,7 @@ def nodegroup_durian_surface( ("NodeSocketGeometry", "Geometry", None), ("NodeSocketFloat", "displacement", 1.0), ("NodeSocketFloat", "spline parameter", 0.0), - ("NodeSocketFloatDistance", "distance Min", 0.1), + ("NodeSocketFloat", "distance Min", 0.1), ("NodeSocketFloat", "noise amount", 0.3), ("NodeSocketFloat", "noise scale", 5.0), ], diff --git a/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py b/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py index f215522b4..e41332b5e 100644 --- a/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py @@ -36,7 +36,7 @@ def nodegroup_pineapple_surface( expose_input=[ ("NodeSocketGeometry", "Geometry", None), ("NodeSocketFloat", "spline parameter", 0.0), - ("NodeSocketFloatDistance", "point distance", 0.22), + ("NodeSocketFloat", "point distance", 0.22), ("NodeSocketFloat", "cell scale", 0.2), ("NodeSocketFloat", "random seed", 0.0), ], diff --git a/infinigen/assets/objects/fruits/surfaces/starfruit_surface.py b/infinigen/assets/objects/fruits/surfaces/starfruit_surface.py index f502ba6db..fc42c422e 100644 --- a/infinigen/assets/objects/fruits/surfaces/starfruit_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/starfruit_surface.py @@ -42,7 +42,7 @@ def shader_starfruit_shader(nw: NodeWrangler, base_color, ridge_color): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": colorramp.outputs["Color"], - "Specular": 0.775, + "Specular IOR Level": 0.775, "Roughness": 0.2, }, ) diff --git a/infinigen/assets/objects/fruits/surfaces/strawberry_surface.py b/infinigen/assets/objects/fruits/surfaces/strawberry_surface.py index dad72914b..0f8d819d9 100644 --- a/infinigen/assets/objects/fruits/surfaces/strawberry_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/strawberry_surface.py @@ -67,7 +67,7 @@ def shader_strawberry_shader(nw: NodeWrangler, top_pos, main_color, top_color): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": mix, "Specular": 1.0, "Roughness": 0.15}, + input_kwargs={"Base Color": mix, "Specular IOR Level": 1.0, "Roughness": 0.15}, ) mix_shader = nw.new_node( @@ -97,7 +97,7 @@ def nodegroup_strawberry_surface( expose_input=[ ("NodeSocketGeometry", "Geometry", None), ("NodeSocketFloat", "spline parameter", 0.0), - ("NodeSocketFloatDistance", "Distance Min", 0.12), + ("NodeSocketFloat", "Distance Min", 0.12), ("NodeSocketFloat", "Strength", 0.74), ("NodeSocketFloat", "noise random seed", 0.0), ], diff --git a/infinigen/assets/objects/fruits/surfaces/surface_utils.py b/infinigen/assets/objects/fruits/surfaces/surface_utils.py index 67430cd39..fd7a412d0 100644 --- a/infinigen/assets/objects/fruits/surfaces/surface_utils.py +++ b/infinigen/assets/objects/fruits/surfaces/surface_utils.py @@ -22,7 +22,7 @@ def nodegroup_stripe_pattern(nw: NodeWrangler): ("NodeSocketColor", "Color", (0.8, 0.8, 0.8, 1.0)), ("NodeSocketFloat", "attribute", 0.0), ("NodeSocketFloat", "voronoi scale", 50.0), - ("NodeSocketFloatFactor", "voronoi randomness", 1.0), + ("NodeSocketFloat", "voronoi randomness", 1.0), ("NodeSocketFloat", "seed", 0.0), ("NodeSocketFloat", "noise scale", 10.0), ("NodeSocketFloat", "noise amount", 1.4), diff --git a/infinigen/assets/objects/grassland/dandelion.py b/infinigen/assets/objects/grassland/dandelion.py index 74560fd2c..850c1d514 100644 --- a/infinigen/assets/objects/grassland/dandelion.py +++ b/infinigen/assets/objects/grassland/dandelion.py @@ -26,7 +26,7 @@ def nodegroup_pedal_stem_head_geometry(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), - ("NodeSocketFloatDistance", "Radius", 0.04), + ("NodeSocketFloat", "Radius", 0.04), ], ) @@ -159,7 +159,7 @@ def nodegroup_pedal_stem_branch_shape(nw: NodeWrangler): pedal_stem_branches_num.integer = 40 group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketFloatDistance", "Radius", 0.0100)] + Nodes.GroupInput, expose_input=[("NodeSocketFloat", "Radius", 0.0100)] ) curve_circle_1 = nw.new_node( @@ -407,7 +407,7 @@ def nodegroup_pedal_stem_geometry(nw: NodeWrangler): expose_input=[ ("NodeSocketVectorTranslation", "End", (0.0, 0.0, 1.0)), ("NodeSocketVectorTranslation", "Middle", (0.0, 0.0, 0.5)), - ("NodeSocketFloatDistance", "Radius", 0.05), + ("NodeSocketFloat", "Radius", 0.05), ], ) diff --git a/infinigen/assets/objects/grassland/flower.py b/infinigen/assets/objects/grassland/flower.py index 3a00eb1a4..eab315f36 100644 --- a/infinigen/assets/objects/grassland/flower.py +++ b/infinigen/assets/objects/grassland/flower.py @@ -654,7 +654,7 @@ def shader_petal(nw): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": petal_color, - "Specular": specular, + "Specular IOR Level": specular, "Roughness": roughness, }, ) diff --git a/infinigen/assets/objects/lamp/ceiling_classic_lamp.py b/infinigen/assets/objects/lamp/ceiling_classic_lamp.py index ed320038f..56494b563 100644 --- a/infinigen/assets/objects/lamp/ceiling_classic_lamp.py +++ b/infinigen/assets/objects/lamp/ceiling_classic_lamp.py @@ -30,9 +30,9 @@ def shader_lamp_material(nw: NodeWrangler): "Base Color": rgb, "Subsurface Radius": (0.1000, 0.1000, 0.1000), "Roughness": uniform(0.2, 0.9), - "Sheen": 0.2068, - "Clearcoat Roughness": 0.1436, - "Transmission": 0.4045, + "Sheen Weight": 0.2068, + "Coat Roughness": 0.1436, + "Transmission Weight": 0.4045, "Transmission Roughness": 0.6932, "Emission": (0.9858, 0.9858, 0.9858, 1.0000), "Emission Strength": 0.0000, @@ -109,7 +109,7 @@ def geometry_nodes(nw: NodeWrangler): ("NodeSocketFloat", "bottom_radius", 0.0000), ("NodeSocketFloat", "top_radius", 0.0000), ("NodeSocketFloat", "Thickness", 0.5000), - ("NodeSocketFloatDistance", "Amount", 1.0000), + ("NodeSocketFloat", "Amount", 1.0000), ], ) diff --git a/infinigen/assets/objects/lamp/ceiling_lights.py b/infinigen/assets/objects/lamp/ceiling_lights.py index 8b30c92a8..c5ccc7b25 100644 --- a/infinigen/assets/objects/lamp/ceiling_lights.py +++ b/infinigen/assets/objects/lamp/ceiling_lights.py @@ -145,7 +145,7 @@ def nodegroup_ceiling_light_geometry(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.2000), + ("NodeSocketFloat", "Radius", 0.2000), ("NodeSocketFloat", "Thickness", 0.0050), ("NodeSocketFloat", "InnerRadius", 0.1800), ("NodeSocketFloat", "Height", 0.1000), diff --git a/infinigen/assets/objects/lamp/lamp.py b/infinigen/assets/objects/lamp/lamp.py index 9bdc905fe..e68d5d22b 100644 --- a/infinigen/assets/objects/lamp/lamp.py +++ b/infinigen/assets/objects/lamp/lamp.py @@ -399,10 +399,10 @@ def nodegroup_bulb_rack(nw: NodeWrangler): Nodes.GroupInput, label="amount", expose_input=[ - ("NodeSocketFloatDistance", "Thickness", 0.0200), + ("NodeSocketFloat", "Thickness", 0.0200), ("NodeSocketInt", "Amount", 3), - ("NodeSocketFloatDistance", "InnerRadius", 1.0000), - ("NodeSocketFloatDistance", "OuterRadius", 1.0000), + ("NodeSocketFloat", "InnerRadius", 1.0000), + ("NodeSocketFloat", "OuterRadius", 1.0000), ("NodeSocketFloat", "InnerHeight", 0.0000), ("NodeSocketFloat", "OuterHeight", 0.0000), ], @@ -635,7 +635,7 @@ def nodegroup_lamp_head(nw: NodeWrangler): ("NodeSocketFloat", "TopRadius", 0.3000), ("NodeSocketFloat", "BotRadius", 0.5000), ("NodeSocketBool", "ReverseBulb", True), - ("NodeSocketFloatDistance", "RackThickness", 0.0050), + ("NodeSocketFloat", "RackThickness", 0.0050), ("NodeSocketFloat", "RackHeight", 0.5000), ("NodeSocketMaterial", "BlackMaterial", None), ("NodeSocketMaterial", "LampshadeMaterial", None), @@ -802,14 +802,14 @@ def nodegroup_lamp_geometry(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "StandRadius", 0.0200), - ("NodeSocketFloatDistance", "BaseRadius", 0.1000), + ("NodeSocketFloat", "StandRadius", 0.0200), + ("NodeSocketFloat", "BaseRadius", 0.1000), ("NodeSocketFloat", "BaseHeight", 0.0200), ("NodeSocketFloat", "ShadeHeight", 0.0000), ("NodeSocketFloat", "HeadTopRadius", 0.3000), ("NodeSocketFloat", "HeadBotRadius", 0.5000), ("NodeSocketBool", "ReverseLamp", True), - ("NodeSocketFloatDistance", "RackThickness", 0.0050), + ("NodeSocketFloat", "RackThickness", 0.0050), ("NodeSocketVectorTranslation", "CurvePoint1", (0.0000, 0.0000, 0.0000)), ("NodeSocketVectorTranslation", "CurvePoint2", (0.0000, 0.0000, 0.0000)), ("NodeSocketVectorTranslation", "CurvePoint3", (0.0000, 0.0000, 0.0000)), diff --git a/infinigen/assets/objects/leaves/leaf_pine.py b/infinigen/assets/objects/leaves/leaf_pine.py index 539d82256..fbd95c74f 100644 --- a/infinigen/assets/objects/leaves/leaf_pine.py +++ b/infinigen/assets/objects/leaves/leaf_pine.py @@ -114,7 +114,7 @@ def nodegroup_instance_needle(nw): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Curve", None), - ("NodeSocketFloatFactor", "Needle Density", 0.9), + ("NodeSocketFloat", "Needle Density", 0.9), ("NodeSocketInt", "Seed", 0), ("NodeSocketGeometry", "Instance", None), ("NodeSocketFloat", "X Angle Mean", 0.5), @@ -241,7 +241,7 @@ def nodegroup_needle5(nw): ("NodeSocketGeometry", "Instance", None), ("NodeSocketFloat", "X Angle Mean", 0.5), ("NodeSocketFloat", "X Angle Range", 0.0), - ("NodeSocketFloatFactor", "Needle Density", 0.9), + ("NodeSocketFloat", "Needle Density", 0.9), ("NodeSocketInt", "Seed", 0), ], ) @@ -344,7 +344,7 @@ def shader_twig(nw): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": (0.08, 0.0329, 0.0414, 1.0), - "Specular": 0.0527, + "Specular IOR Level": 0.0527, "Roughness": 0.4491, }, ) @@ -366,7 +366,7 @@ def nodegroup_pine_twig(nw): ("NodeSocketIntUnsigned", "Resolution", 20), ("NodeSocketFloat", "Middle Y", 0.0), ("NodeSocketFloat", "Middle Z", 0.0), - ("NodeSocketFloatFactor", "Needle Density", 0.9), + ("NodeSocketFloat", "Needle Density", 0.9), ("NodeSocketGeometry", "Instance", None), ("NodeSocketFloat", "X Angle Mean", 0.5), ("NodeSocketFloat", "X Angle Range", 0.0), diff --git a/infinigen/assets/objects/mollusk/generate.py b/infinigen/assets/objects/mollusk/generate.py index 9f02843d7..54286624d 100644 --- a/infinigen/assets/objects/mollusk/generate.py +++ b/infinigen/assets/objects/mollusk/generate.py @@ -137,7 +137,7 @@ def color_fn(dark_prob): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": nw.new_node(Nodes.MixRGB, [ratio, cr_0, cr_1]), - "Specular": specular, + "Specular IOR Level": specular, "Roughness": roughness, }, ) diff --git a/infinigen/assets/objects/monocot/grasses.py b/infinigen/assets/objects/monocot/grasses.py index a2b6130e6..6cba77610 100644 --- a/infinigen/assets/objects/monocot/grasses.py +++ b/infinigen/assets/objects/monocot/grasses.py @@ -255,9 +255,9 @@ def shader_ear(nw: NodeWrangler): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, - "Subsurface": 0.01, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.01, 0.01, 0.01), }, ) diff --git a/infinigen/assets/objects/monocot/growth.py b/infinigen/assets/objects/monocot/growth.py index 7a0aa0e7b..11c896948 100644 --- a/infinigen/assets/objects/monocot/growth.py +++ b/infinigen/assets/objects/monocot/growth.py @@ -298,9 +298,9 @@ def shader_monocot(nw: NodeWrangler, dark_color, bright_color, use_distance): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, - "Subsurface": 0.01, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.01, 0.01, 0.01), }, ) diff --git a/infinigen/assets/objects/monocot/pinecone.py b/infinigen/assets/objects/monocot/pinecone.py index 4a961729f..03d52c97c 100644 --- a/infinigen/assets/objects/monocot/pinecone.py +++ b/infinigen/assets/objects/monocot/pinecone.py @@ -94,7 +94,7 @@ def shader_monocot(nw: NodeWrangler, dark_color, bright_color, use_distance): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, + "Specular IOR Level": specular, }, ) return bsdf diff --git a/infinigen/assets/objects/monocot/veratrum.py b/infinigen/assets/objects/monocot/veratrum.py index 64208baa8..1adc6411d 100644 --- a/infinigen/assets/objects/monocot/veratrum.py +++ b/infinigen/assets/objects/monocot/veratrum.py @@ -69,9 +69,9 @@ def shader_ear(nw: NodeWrangler): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, - "Subsurface": 0.01, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.01, 0.01, 0.01), }, ) diff --git a/infinigen/assets/objects/mushroom/cap.py b/infinigen/assets/objects/mushroom/cap.py index b44e55d1c..8e7ebc37c 100644 --- a/infinigen/assets/objects/mushroom/cap.py +++ b/infinigen/assets/objects/mushroom/cap.py @@ -420,10 +420,10 @@ def shader_voronoi(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, "Subsurface Color": subsurface_color, - "Subsurface": 0.01, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.05, 0.05, 0.05), }, ) @@ -468,10 +468,10 @@ def shader_speckle(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, "Subsurface Color": subsurface_color, - "Subsurface": 0.01, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.05, 0.05, 0.05), }, ) @@ -531,10 +531,10 @@ def shader_noise(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, "Subsurface Color": subsurface_color, - "Subsurface": 0.01, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.05, 0.05, 0.05), }, ) @@ -588,10 +588,10 @@ def shader_cap(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Specular": specular, - "Clearcoat": clearcoat, + "Specular IOR Level": specular, + "Coat Weight": clearcoat, "Subsurface Color": subsurface_color, - "Subsurface": 0.01, + "Subsurface Weight": 0.01, "Subsurface Radius": (0.05, 0.05, 0.05), }, ) diff --git a/infinigen/assets/objects/organizer/plate_rack.py b/infinigen/assets/objects/organizer/plate_rack.py index 73eba98b7..de02a2ec0 100644 --- a/infinigen/assets/objects/organizer/plate_rack.py +++ b/infinigen/assets/objects/organizer/plate_rack.py @@ -24,7 +24,7 @@ def nodegroup_plate_rack_connect(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "Value1", 0.5000), ("NodeSocketFloat", "Value", 0.5000), ], @@ -91,7 +91,7 @@ def nodegroup_rack_cyn(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "Value", 0.5000), ], ) diff --git a/infinigen/assets/objects/particles/lichen.py b/infinigen/assets/objects/particles/lichen.py index 15f2f8f3f..7bb66be35 100644 --- a/infinigen/assets/objects/particles/lichen.py +++ b/infinigen/assets/objects/particles/lichen.py @@ -81,7 +81,7 @@ def map_perturb(h, s, v): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix_rgb, - "Subsurface": subsurface_ratio, + "Subsurface Weight": subsurface_ratio, "Subsurface Radius": (0.01, 0.01, 0.01), "Subsurface Color": background, "Roughness": roughness, diff --git a/infinigen/assets/objects/particles/moss.py b/infinigen/assets/objects/particles/moss.py index 51ba736cf..3bdbe878d 100644 --- a/infinigen/assets/objects/particles/moss.py +++ b/infinigen/assets/objects/particles/moss.py @@ -62,7 +62,7 @@ def map_perturb(h, s, v): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": mix_rgb, - "Subsurface": subsurface_ratio, + "Subsurface Weight": subsurface_ratio, "Subsurface Radius": (0.01, 0.01, 0.01), "Subsurface Color": background, "Roughness": roughness, diff --git a/infinigen/assets/objects/particles/pine_needle.py b/infinigen/assets/objects/particles/pine_needle.py index e0cae910e..50ff04e13 100644 --- a/infinigen/assets/objects/particles/pine_needle.py +++ b/infinigen/assets/objects/particles/pine_needle.py @@ -47,7 +47,7 @@ def nodegroup_pine_needle(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "Scale", 0.0400), ("NodeSocketFloat", "Bend", 0.0300), - ("NodeSocketFloatDistance", "Radius", 0.0010), + ("NodeSocketFloat", "Radius", 0.0010), ], ) diff --git a/infinigen/assets/objects/seating/sofa.py b/infinigen/assets/objects/seating/sofa.py index 33172d707..8b99e1431 100644 --- a/infinigen/assets/objects/seating/sofa.py +++ b/infinigen/assets/objects/seating/sofa.py @@ -186,9 +186,9 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): ("NodeSocketFloat", "Backrest Width", 0.1100), ("NodeSocketFloat", "Seat Margin", 0.9700), ("NodeSocketFloat", "Backrest Angle", -0.2000), - ("NodeSocketFloatFactor", "arm_width", 0.7000), + ("NodeSocketFloat", "arm_width", 0.7000), ("NodeSocketInt", "Arm Type", 0), - ("NodeSocketFloatFactor", "Arm_height", 0.7318), + ("NodeSocketFloat", "Arm_height", 0.7318), ("NodeSocketFloatAngle", "arms_angle", 0.8727), ("NodeSocketBool", "Footrest", False), ("NodeSocketInt", "Count", 4), diff --git a/infinigen/assets/objects/shelves/cabinet.py b/infinigen/assets/objects/shelves/cabinet.py index dece3fceb..a60ff6445 100644 --- a/infinigen/assets/objects/shelves/cabinet.py +++ b/infinigen/assets/objects/shelves/cabinet.py @@ -98,7 +98,7 @@ def nodegroup_knob_handle(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.0100), + ("NodeSocketFloat", "Radius", 0.0100), ("NodeSocketFloat", "thickness_1", 0.5000), ("NodeSocketFloat", "thickness_2", 0.5000), ("NodeSocketFloat", "length", 0.5000), diff --git a/infinigen/assets/objects/shelves/doors.py b/infinigen/assets/objects/shelves/doors.py index 5a81bb082..8bc40bef2 100644 --- a/infinigen/assets/objects/shelves/doors.py +++ b/infinigen/assets/objects/shelves/doors.py @@ -103,7 +103,7 @@ def nodegroup_knob_handle(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.0100), + ("NodeSocketFloat", "Radius", 0.0100), ("NodeSocketFloat", "thickness_1", 0.5000), ("NodeSocketFloat", "thickness_2", 0.5000), ("NodeSocketFloat", "length", 0.5000), diff --git a/infinigen/assets/objects/shelves/drawers.py b/infinigen/assets/objects/shelves/drawers.py index 973ff1df7..d96a0c119 100644 --- a/infinigen/assets/objects/shelves/drawers.py +++ b/infinigen/assets/objects/shelves/drawers.py @@ -388,7 +388,7 @@ def nodegroup_door_knob(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.0040), + ("NodeSocketFloat", "Radius", 0.0040), ("NodeSocketFloat", "length", 0.5000), ("NodeSocketFloat", "z", 0.5000), ], diff --git a/infinigen/assets/objects/shelves/large_shelf.py b/infinigen/assets/objects/shelves/large_shelf.py index 75a2261e6..08a47d407 100644 --- a/infinigen/assets/objects/shelves/large_shelf.py +++ b/infinigen/assets/objects/shelves/large_shelf.py @@ -31,8 +31,8 @@ def nodegroup_screw_head(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Depth", 0.0050), - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Depth", 0.0050), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "division_thickness", 0.5000), ("NodeSocketFloat", "width", 0.5000), ("NodeSocketFloat", "depth", 0.5000), diff --git a/infinigen/assets/objects/shelves/simple_bookcase.py b/infinigen/assets/objects/shelves/simple_bookcase.py index 6f4b72ddf..ee188dc99 100644 --- a/infinigen/assets/objects/shelves/simple_bookcase.py +++ b/infinigen/assets/objects/shelves/simple_bookcase.py @@ -147,8 +147,8 @@ def nodegroup_screw_head(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Depth", 0.0050), - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Depth", 0.0050), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "bottom_gap", 0.5000), ("NodeSocketFloat", "division_thickness", 0.5000), ("NodeSocketFloat", "width", 0.5000), diff --git a/infinigen/assets/objects/shelves/simple_desk.py b/infinigen/assets/objects/shelves/simple_desk.py index d9632337e..3f0e23c0f 100644 --- a/infinigen/assets/objects/shelves/simple_desk.py +++ b/infinigen/assets/objects/shelves/simple_desk.py @@ -35,7 +35,7 @@ def nodegroup_table_legs(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "thickness", 0.5000), ("NodeSocketFloat", "height", 0.5000), - ("NodeSocketFloatDistance", "radius", 0.0200), + ("NodeSocketFloat", "radius", 0.0200), ("NodeSocketFloat", "width", 0.5000), ("NodeSocketFloat", "depth", 0.5000), ("NodeSocketFloat", "dist", 0.5000), diff --git a/infinigen/assets/objects/small_plants/succulent.py b/infinigen/assets/objects/small_plants/succulent.py index cdf92fdc3..b567c874f 100644 --- a/infinigen/assets/objects/small_plants/succulent.py +++ b/infinigen/assets/objects/small_plants/succulent.py @@ -403,7 +403,7 @@ def nodegroup_pedal_on_base(nw: NodeWrangler, R=1.0): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 0.1), + ("NodeSocketFloat", "Radius", 0.1), ("NodeSocketFloat", "x_R", -1.3), ("NodeSocketFloat", "z_R", -1.57), ("NodeSocketInt", "Resolution", 10), diff --git a/infinigen/assets/objects/table_decorations/sink.py b/infinigen/assets/objects/table_decorations/sink.py index 4de90faa5..2941133de 100644 --- a/infinigen/assets/objects/table_decorations/sink.py +++ b/infinigen/assets/objects/table_decorations/sink.py @@ -301,11 +301,11 @@ def nodegroup_water_tap(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "base_width", U(0.2, 0.3)), + ("NodeSocketFloat", "base_width", U(0.2, 0.3)), ("NodeSocketFloat", "tap_head", U(0.7, 1.1)), ("NodeSocketFloat", "roation_z", U(5.5, 7.0)), ("NodeSocketFloat", "tap_height", U(0.5, 1)), - ("NodeSocketFloatDistance", "base_radius", U(0.0, 0.1)), + ("NodeSocketFloat", "base_radius", U(0.0, 0.1)), ("NodeSocketBool", "Switch", True if U() > 0.5 else False), ("NodeSocketFloat", "Y", U(-0.5, -0.06)), ("NodeSocketBool", "hand_type", True if U() > 0.2 else False), @@ -918,12 +918,12 @@ def nodegroup_sink_geometry(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Depth", 2.0000), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Depth", 2.0000), ("NodeSocketFloat", "Curvature", 0.9500), ("NodeSocketFloat", "Upper Height", 1.0000), ("NodeSocketFloat", "Lower Height", -0.0500), - ("NodeSocketFloatDistance", "HoleRadius", 0.1000), + ("NodeSocketFloat", "HoleRadius", 0.1000), ("NodeSocketFloat", "Margin", 0.5000), ("NodeSocketFloat", "WaterTapMargin", 0.5000), ("NodeSocketMaterial", "Tap", None), diff --git a/infinigen/assets/objects/table_decorations/utils.py b/infinigen/assets/objects/table_decorations/utils.py index 575c1a539..31004e834 100644 --- a/infinigen/assets/objects/table_decorations/utils.py +++ b/infinigen/assets/objects/table_decorations/utils.py @@ -19,7 +19,7 @@ def nodegroup_star_profile(nw: NodeWrangler): expose_input=[ ("NodeSocketInt", "Resolution", 64), ("NodeSocketInt", "Points", 64), - ("NodeSocketFloatDistance", "Inner Radius", 0.9000), + ("NodeSocketFloat", "Inner Radius", 0.9000), ], ) @@ -152,7 +152,7 @@ def nodegroup_shifted_circle(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketInt", "Resolution", 32), - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "Z", 0.0000), ("NodeSocketFloat", "Rot Z", 0.0000), ], diff --git a/infinigen/assets/objects/tables/legs/square.py b/infinigen/assets/objects/tables/legs/square.py index b2b2dc34f..a6def6e8e 100644 --- a/infinigen/assets/objects/tables/legs/square.py +++ b/infinigen/assets/objects/tables/legs/square.py @@ -23,11 +23,11 @@ def nodegroup_generate_leg_square(nw: NodeWrangler, **kwargs): expose_input=[ ("NodeSocketFloat", "Width", 0.0000), ("NodeSocketFloat", "Height", 0.0000), - ("NodeSocketFloatDistance", "Fillet Radius", 0.0300), + ("NodeSocketFloat", "Fillet Radius", 0.0300), ("NodeSocketBool", "Has Bottom Connector", True), ("NodeSocketInt", "Profile N-gon", 4), - ("NodeSocketFloatDistance", "Profile Width", 0.1000), - ("NodeSocketFloatDistance", "Profile Aspect Ratio", 0.5000), + ("NodeSocketFloat", "Profile Width", 0.1000), + ("NodeSocketFloat", "Profile Aspect Ratio", 0.5000), ("NodeSocketFloat", "Profile Fillet Ratio", 0.1000), ], ) diff --git a/infinigen/assets/objects/tables/lofting.py b/infinigen/assets/objects/tables/lofting.py index 591607d91..776bd9f5b 100644 --- a/infinigen/assets/objects/tables/lofting.py +++ b/infinigen/assets/objects/tables/lofting.py @@ -116,7 +116,7 @@ def nodegroup_shifted_circle(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketInt", "Resolution", 32), - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "Z", 0.0000), ("NodeSocketFloat", "Rot Z", 0.0000), ], @@ -168,7 +168,7 @@ def nodegroup_shifted_square(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketInt", "Resolution", 10), - ("NodeSocketFloatDistance", "Width", 1.0000), + ("NodeSocketFloat", "Width", 1.0000), ("NodeSocketFloat", "Z", 0.0000), ("NodeSocketFloat", "Rot Z", 0.5000), ], diff --git a/infinigen/assets/objects/tables/table_top.py b/infinigen/assets/objects/tables/table_top.py index 607aad3ea..b857d1f57 100644 --- a/infinigen/assets/objects/tables/table_top.py +++ b/infinigen/assets/objects/tables/table_top.py @@ -30,7 +30,7 @@ def nodegroup_capped_cylinder(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "Thickness", 0.5000), ("NodeSocketFloat", "Radius", 0.2000), - ("NodeSocketFloatDistance", "Cap Flatness", 4.0000), + ("NodeSocketFloat", "Cap Flatness", 4.0000), ("NodeSocketFloat", "Fillet Radius Vertical", 0.4000), ("NodeSocketFloat", "Cap Relative Scale", 1.0000), ("NodeSocketFloat", "Cap Relative Z Offset", 0.0000), diff --git a/infinigen/assets/objects/tables/table_utils.py b/infinigen/assets/objects/tables/table_utils.py index 5ae73e339..d00216a27 100644 --- a/infinigen/assets/objects/tables/table_utils.py +++ b/infinigen/assets/objects/tables/table_utils.py @@ -769,7 +769,7 @@ def nodegroup_create_cap(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketInt", "Resolution", 64), ], ) @@ -853,7 +853,7 @@ def nodegroup_arc_top(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Diameter", 1.0000), + ("NodeSocketFloat", "Diameter", 1.0000), ("NodeSocketFloat", "Sweep Angle", 180.0000), ], ) diff --git a/infinigen/assets/objects/trees/branch.py b/infinigen/assets/objects/trees/branch.py index 645861c50..94836f4d8 100644 --- a/infinigen/assets/objects/trees/branch.py +++ b/infinigen/assets/objects/trees/branch.py @@ -278,7 +278,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): # ('NodeSocketInt', 'seed', 0), # ('NodeSocketFloat', 'main branch noise amount', 0.3000), # ('NodeSocketFloat', 'main branch noise scale', 1.1000), - # ('NodeSocketFloatDistance', 'overall radius', 0.0200), + # ('NodeSocketFloat', 'overall radius', 0.0200), # ('NodeSocketFloat', 'twig density', 10.0000), # ('NodeSocketFloat', 'twig rotation', 45.0000), # ('NodeSocketFloat', 'twig scale', 5.0000), diff --git a/infinigen/assets/objects/trees/tree_flower.py b/infinigen/assets/objects/trees/tree_flower.py index 97ca26671..1f447e1d6 100644 --- a/infinigen/assets/objects/trees/tree_flower.py +++ b/infinigen/assets/objects/trees/tree_flower.py @@ -656,7 +656,7 @@ def shader_petal(nw, petal_color_name): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": petal_color, - "Specular": specular, + "Specular IOR Level": specular, "Roughness": roughness, }, ) diff --git a/infinigen/assets/objects/trees/utils/geometrynodes.py b/infinigen/assets/objects/trees/utils/geometrynodes.py index b4b04adf6..06c019fcf 100644 --- a/infinigen/assets/objects/trees/utils/geometrynodes.py +++ b/infinigen/assets/objects/trees/utils/geometrynodes.py @@ -521,7 +521,7 @@ def set_tree_radius(nw): ("NodeSocketFloat", "Min radius", 0.02), ("NodeSocketFloat", "Max radius", 5.0), ("NodeSocketInt", "Profile res", 20), - ("NodeSocketFloatDistance", "Merge dist", 0.001), + ("NodeSocketFloat", "Merge dist", 0.001), ], ) diff --git a/infinigen/assets/objects/trees/utils/materials.py b/infinigen/assets/objects/trees/utils/materials.py index faed9453a..bc25406de 100644 --- a/infinigen/assets/objects/trees/utils/materials.py +++ b/infinigen/assets/objects/trees/utils/materials.py @@ -57,7 +57,7 @@ def init_color_material( bsdf_node = nt.nodes.get("Principled BSDF") bsdf_node.inputs.get("Base Color").default_value = color bsdf_node.inputs.get("Roughness").default_value = roughness - bsdf_node.inputs.get("Specular").default_value = specular + bsdf_node.inputs.get("Specular IOR Level").default_value = specular return m @@ -231,7 +231,7 @@ def setup_material(m, txt_paths, metal_prob=0.2, transm_prob=0.2, emit_prob=0): rough_scale = nt.nodes.get("Map Range") bsdf.inputs.get("Metallic").default_value = 0 - bsdf.inputs.get("Transmission").default_value = 0 + bsdf.inputs.get("Transmission Weight").default_value = 0 bsdf.inputs.get("IOR").default_value = 1.45 rough_scale.inputs.get("To Max").default_value = 1 @@ -240,7 +240,7 @@ def setup_material(m, txt_paths, metal_prob=0.2, transm_prob=0.2, emit_prob=0): rough_scale.inputs.get("To Max").default_value = 0.5 elif np.random.rand() < transm_prob: - bsdf.inputs.get("Transmission").default_value = 1 + bsdf.inputs.get("Transmission Weight").default_value = 1 bsdf.inputs.get("IOR").default_value = 1.05 + np.random.rand() * 0.3 rough_scale.inputs.get("To Max").default_value = 0.2 diff --git a/infinigen/assets/objects/tropic_plants/coconut_tree.py b/infinigen/assets/objects/tropic_plants/coconut_tree.py index c21b14f17..04e65f096 100644 --- a/infinigen/assets/objects/tropic_plants/coconut_tree.py +++ b/infinigen/assets/objects/tropic_plants/coconut_tree.py @@ -311,7 +311,7 @@ def nodegroup_node_group_002(nw: NodeWrangler): ("NodeSocketColor", "Color", (0.8, 0.8, 0.8, 1.0)), ("NodeSocketFloat", "attribute", 0.0), ("NodeSocketFloat", "voronoi scale", 50.0), - ("NodeSocketFloatFactor", "voronoi randomness", 1.0), + ("NodeSocketFloat", "voronoi randomness", 1.0), ("NodeSocketFloat", "seed", 0.0), ("NodeSocketFloat", "noise scale", 10.0), ("NodeSocketFloat", "noise amount", 1.4), @@ -966,7 +966,11 @@ def shader_coconut_green_shader(nw: NodeWrangler): principled_bsdf = nw.new_node( Nodes.PrincipledBSDF, - input_kwargs={"Base Color": group_1, "Specular": 0.4773, "Roughness": 0.4455}, + input_kwargs={ + "Base Color": group_1, + "Specular IOR Level": 0.4773, + "Roughness": 0.4455, + }, ) material_output = nw.new_node( diff --git a/infinigen/assets/objects/tropic_plants/palm_tree.py b/infinigen/assets/objects/tropic_plants/palm_tree.py index 3abd5562b..8ab0f5146 100644 --- a/infinigen/assets/objects/tropic_plants/palm_tree.py +++ b/infinigen/assets/objects/tropic_plants/palm_tree.py @@ -311,7 +311,7 @@ def nodegroup_node_group_002(nw: NodeWrangler): ("NodeSocketColor", "Color", (0.8, 0.8, 0.8, 1.0)), ("NodeSocketFloat", "attribute", 0.0), ("NodeSocketFloat", "voronoi scale", 50.0), - ("NodeSocketFloatFactor", "voronoi randomness", 1.0), + ("NodeSocketFloat", "voronoi randomness", 1.0), ("NodeSocketFloat", "seed", 0.0), ("NodeSocketFloat", "noise scale", 10.0), ("NodeSocketFloat", "noise amount", 1.4), @@ -1253,7 +1253,7 @@ def shader_trunk(nw: NodeWrangler): input_kwargs={ "Base Color": mix, "Roughness": voronoi_texture.outputs["Distance"], - "Specular": 0, + "Specular IOR Level": 0, }, ) diff --git a/infinigen/assets/objects/underwater/seaweed.py b/infinigen/assets/objects/underwater/seaweed.py index c7539840d..b584be870 100644 --- a/infinigen/assets/objects/underwater/seaweed.py +++ b/infinigen/assets/objects/underwater/seaweed.py @@ -163,11 +163,11 @@ def map_perturb(h, s, v): Nodes.PrincipledBSDF, input_kwargs={ "Base Color": cr, - "Subsurface": subsurface_ratio, + "Subsurface Weight": subsurface_ratio, "Subsurface Radius": (0.01, 0.01, 0.01), "Subsurface Color": map_perturb(base_hue, 0.6, 0.2), "Roughness": roughness, - "Specular": specular, + "Specular IOR Level": specular, }, ) diff --git a/infinigen/assets/objects/underwater/urchin.py b/infinigen/assets/objects/underwater/urchin.py index 458245fd9..f469e79b0 100644 --- a/infinigen/assets/objects/underwater/urchin.py +++ b/infinigen/assets/objects/underwater/urchin.py @@ -144,9 +144,9 @@ def shader_spikes(nw: NodeWrangler, base_hue): input_kwargs={ "Base Color": color, "Roughness": roughness, - "Subsurface": subsurface, + "Subsurface Weight": subsurface, "Subsurface Color": color, - "Transmission": transmission, + "Transmission Weight": transmission, }, ) return principled_bsdf diff --git a/infinigen/assets/objects/wall_decorations/skirting_board.py b/infinigen/assets/objects/wall_decorations/skirting_board.py index 8b68efdf9..bdfb7f2ef 100644 --- a/infinigen/assets/objects/wall_decorations/skirting_board.py +++ b/infinigen/assets/objects/wall_decorations/skirting_board.py @@ -43,7 +43,7 @@ def nodegroup_make_skirting_board(nw: NodeWrangler, control_points): ("NodeSocketCollection", "Parent", None), ("NodeSocketFloat", "Thickness", 0.0300), ("NodeSocketFloat", "Height", 0.1500), - ("NodeSocketFloatDistance", "Resolution", 0.0050), + ("NodeSocketFloat", "Resolution", 0.0050), ("NodeSocketBool", "Is Ceiling", False), ], ) diff --git a/infinigen/assets/objects/windows/window.py b/infinigen/assets/objects/windows/window.py index b8ae662cd..a5196046b 100644 --- a/infinigen/assets/objects/windows/window.py +++ b/infinigen/assets/objects/windows/window.py @@ -269,14 +269,14 @@ def nodegroup_window_geometry(nw: NodeWrangler): group_input_1 = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Height", 2.0000), - ("NodeSocketFloatDistance", "FrameWidth", 0.1000), - ("NodeSocketFloatDistance", "FrameThickness", 0.1000), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Height", 2.0000), + ("NodeSocketFloat", "FrameWidth", 0.1000), + ("NodeSocketFloat", "FrameThickness", 0.1000), ("NodeSocketInt", "PanelHAmount", 0), ("NodeSocketInt", "PanelVAmount", 0), - ("NodeSocketFloatDistance", "SubFrameWidth", 0.0500), - ("NodeSocketFloatDistance", "SubFrameThickness", 0.0500), + ("NodeSocketFloat", "SubFrameWidth", 0.0500), + ("NodeSocketFloat", "SubFrameThickness", 0.0500), ("NodeSocketInt", "SubPanelHAmount", 3), ("NodeSocketInt", "SubPanelVAmount", 2), ("NodeSocketFloat", "GlassThickness", 0.0100), @@ -288,13 +288,13 @@ def nodegroup_window_geometry(nw: NodeWrangler): ("NodeSocketFloat", "CurtainFrameDepth", 0.5000), ("NodeSocketFloat", "CurtainDepth", 0.0300), ("NodeSocketFloat", "CurtainIntervalNumber", 20.0000), - ("NodeSocketFloatDistance", "CurtainFrameRadius", 0.0100), + ("NodeSocketFloat", "CurtainFrameRadius", 0.0100), ("NodeSocketFloat", "CurtainMidL", -0.5000), ("NodeSocketFloat", "CurtainMidR", 0.5000), ("NodeSocketBool", "Shutter", True), - ("NodeSocketFloatDistance", "ShutterPanelRadius", 0.0050), - ("NodeSocketFloatDistance", "ShutterWidth", 0.0500), - ("NodeSocketFloatDistance", "ShutterThickness", 0.0050), + ("NodeSocketFloat", "ShutterPanelRadius", 0.0050), + ("NodeSocketFloat", "ShutterWidth", 0.0500), + ("NodeSocketFloat", "ShutterThickness", 0.0050), ("NodeSocketFloat", "ShutterRotation", 0.0000), ("NodeSocketFloat", "ShutterInterval", 0.0500), ("NodeSocketMaterial", "FrameMaterial", None), @@ -831,9 +831,9 @@ def nodegroup_curtain(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "Width", 0.5000), ("NodeSocketFloat", "Depth", 0.1000), - ("NodeSocketFloatDistance", "Height", 0.1000), + ("NodeSocketFloat", "Height", 0.1000), ("NodeSocketFloat", "IntervalNumber", 0.5000), - ("NodeSocketFloatDistance", "Radius", 1.0000), + ("NodeSocketFloat", "Radius", 1.0000), ("NodeSocketFloat", "L1", 0.5000), ("NodeSocketFloat", "R1", 0.0000), ("NodeSocketFloat", "L2", 0.0000), @@ -1164,14 +1164,14 @@ def nodegroup_window_shutter(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Height", 2.0000), - ("NodeSocketFloatDistance", "FrameWidth", 0.1000), - ("NodeSocketFloatDistance", "FrameThickness", 0.1000), - ("NodeSocketFloatDistance", "PanelWidth", 0.1000), - ("NodeSocketFloatDistance", "PanelThickness", 0.1000), - ("NodeSocketFloatDistance", "ShutterWidth", 0.1000), - ("NodeSocketFloatDistance", "ShutterThickness", 0.1000), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Height", 2.0000), + ("NodeSocketFloat", "FrameWidth", 0.1000), + ("NodeSocketFloat", "FrameThickness", 0.1000), + ("NodeSocketFloat", "PanelWidth", 0.1000), + ("NodeSocketFloat", "PanelThickness", 0.1000), + ("NodeSocketFloat", "ShutterWidth", 0.1000), + ("NodeSocketFloat", "ShutterThickness", 0.1000), ("NodeSocketFloat", "ShutterInterval", 0.5000), ("NodeSocketFloat", "ShutterRotation", 0.0000), ("NodeSocketMaterial", "FrameMaterial", None), @@ -1413,12 +1413,12 @@ def nodegroup_window_panel(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketFloatDistance", "Width", 2.0000), - ("NodeSocketFloatDistance", "Height", 2.0000), - ("NodeSocketFloatDistance", "FrameWidth", 0.1000), - ("NodeSocketFloatDistance", "FrameThickness", 0.1000), - ("NodeSocketFloatDistance", "PanelWidth", 0.1000), - ("NodeSocketFloatDistance", "PanelThickness", 0.1000), + ("NodeSocketFloat", "Width", 2.0000), + ("NodeSocketFloat", "Height", 2.0000), + ("NodeSocketFloat", "FrameWidth", 0.1000), + ("NodeSocketFloat", "FrameThickness", 0.1000), + ("NodeSocketFloat", "PanelWidth", 0.1000), + ("NodeSocketFloat", "PanelThickness", 0.1000), ("NodeSocketInt", "PanelHAmount", 0), ("NodeSocketInt", "PanelVAmount", 0), ("NodeSocketBool", "WithGlass", False), diff --git a/infinigen/assets/utils/nodegroups/attach.py b/infinigen/assets/utils/nodegroups/attach.py index e2869c365..9156a6456 100644 --- a/infinigen/assets/utils/nodegroups/attach.py +++ b/infinigen/assets/utils/nodegroups/attach.py @@ -26,8 +26,8 @@ def nodegroup_part_surface(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Skin Mesh", None), - ("NodeSocketFloatFactor", "Length Fac", 0.0), - ("NodeSocketVectorEuler", "Ray Rot", (0.0, 0.0, 0.0)), + ("NodeSocketFloat", "Length Fac", 0.0), + ("NodeSocketVector", "Ray Rot", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Rad", 0.0), ], ) @@ -141,7 +141,7 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorEuler", "Rotation", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Rotation", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Hit Normal", (0.0, 0.0, 1.0)), ("NodeSocketVector", "Curve Tangent", (0.0, 0.0, 1.0)), ("NodeSocketBool", "Do Normal Rot", False), @@ -395,8 +395,8 @@ def nodegroup_attach_part(nw: NodeWrangler): ("NodeSocketGeometry", "Skin Mesh", None), ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketFloatFactor", "Length Fac", 0.0), - ("NodeSocketVectorEuler", "Ray Rot", (0.0, 0.0, 0.0)), + ("NodeSocketFloat", "Length Fac", 0.0), + ("NodeSocketVector", "Ray Rot", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Rad", 0.0), ("NodeSocketVector", "Part Rot", (0.0, 0.0, 0.0)), ("NodeSocketBool", "Do Normal Rot", False), diff --git a/infinigen/assets/utils/nodegroups/curve.py b/infinigen/assets/utils/nodegroups/curve.py index d57a0f46c..a01d0748d 100644 --- a/infinigen/assets/utils/nodegroups/curve.py +++ b/infinigen/assets/utils/nodegroups/curve.py @@ -425,7 +425,7 @@ def nodegroup_profile_part(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Skeleton Curve", None), ("NodeSocketGeometry", "Profile Curve", None), - ("NodeSocketFloatDistance", "Radius Func", 1.0), + ("NodeSocketFloat", "Radius Func", 1.0), ], ) diff --git a/infinigen/assets/utils/nodegroups/geometry.py b/infinigen/assets/utils/nodegroups/geometry.py index 01cb99576..0129e213f 100644 --- a/infinigen/assets/utils/nodegroups/geometry.py +++ b/infinigen/assets/utils/nodegroups/geometry.py @@ -116,7 +116,7 @@ def nodegroup_solidify(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Mesh", None), - ("NodeSocketFloatDistance", "Distance", 0.0), + ("NodeSocketFloat", "Distance", 0.0), ], ) diff --git a/infinigen/core/init.py b/infinigen/core/init.py index f78bf83fc..2fa680cbe 100644 --- a/infinigen/core/init.py +++ b/infinigen/core/init.py @@ -20,6 +20,7 @@ from numpy.random import randint import infinigen +from infinigen.core.util import blender as butil from infinigen.core.util.logging import LogLevel from infinigen.core.util.math import int_hash from infinigen.core.util.organization import Task @@ -294,6 +295,20 @@ def configure_blender( bpy.context.scene.cycles.motion_blur_position = "START" bpy.context.scene.render.motion_blur_shutter = motion_blur_shutter - bpy.ops.preferences.addon_enable(module="add_mesh_extra_objects") - bpy.ops.preferences.addon_enable(module="real_snow") - bpy.ops.preferences.addon_enable(module="ant_landscape") + addons = ["extra_mesh_objects", "real_snow", "antlandscape"] + for addon in addons: + try: + with butil.Suppress(): + bpy.ops.extensions.package_mark_clear_all() + bpy.ops.extensions.package_mark_set(pkg_id=addon, repo_index=-1) + bpy.ops.extensions.package_enable_not_installed() + logger.info(f"Add-on {addon} enabled.") + except ValueError | RuntimeError: + with butil.Suppress(): + bpy.ops.extensions.userpref_allow_online() + logger.info(f"Installing Add-on {addon}.") + with butil.Suppress(): + bpy.ops.extensions.package_install( + repo_index=0, pkg_id=addon, enable_on_install=True + ) + logger.info(f"Add-on {addon} Installed.") diff --git a/infinigen/core/nodes/compatibility.py b/infinigen/core/nodes/compatibility.py index f0df2edb6..f8e1c7a3e 100644 --- a/infinigen/core/nodes/compatibility.py +++ b/infinigen/core/nodes/compatibility.py @@ -7,7 +7,7 @@ import logging from collections import OrderedDict -from .node_info import Nodes +from .node_info import DATATYPE_FIELDS, NODETYPE_TO_DATATYPE, Nodes logger = logging.getLogger(__name__) @@ -100,8 +100,96 @@ def compat_args_sample_curve(nw, orig_type, input_args, attrs, input_kwargs): ) +def compat_musgrave_texture(nw, orig_type, input_args, attrs, input_kwargs): + # https://docs.blender.org/manual/en/4.2/render/shader_nodes/textures/musgrave.html + old_names = [ + "Vector", + "W", + "Scale", + "Detail", + "Dimension", + "Lacunarity", + "Offset", + "Gain", + ] + default_values = {"Dimension": 2, "Lacunarity": 2, "Detail": 2} + for name, value in zip(old_names, input_args): + input_kwargs[name] = value + for name, value in default_values.items(): + if name not in input_kwargs: + input_kwargs[name] = value + # handle roughness + if nw.is_socket(input_kwargs["Dimension"]) or nw.is_socket( + input_kwargs["Lacunarity"] + ): + input_kwargs["Roughness"] = nw.math( + "POWER", + input_kwargs["Lacunarity"], + nw.scalar_sub(0, input_kwargs["Dimension"]), + ) + else: + input_kwargs["Roughness"] = input_kwargs["Lacunarity"] ** ( + -input_kwargs["Dimension"] + ) + input_kwargs.pop("Dimension") + # handle detail + if nw.is_socket(input_kwargs["Detail"]): + input_kwargs["Detail"] = nw.scalar_sub(input_kwargs["Detail"], 1) + else: + input_kwargs["Detail"] = input_kwargs["Detail"] - 1 + if "musgrave_dimensions" in attrs: + attrs["noise_dimensions"] = attrs.pop("musgrave_dimensions") + if "musgrave_type" in attrs: + attrs["noise_type"] = attrs.pop("musgrave_type") + return nw.new_node( + node_type=Nodes.NoiseTexture, + input_args=[], + attrs=attrs, + input_kwargs=input_kwargs, + compat_mode=False, + ) + + +def compat_capture_attribute(nw, orig_type, input_args, attrs, input_kwargs): + types = ["VECTOR", "VALUE", "RGBA", "BOOLEAN", "INT"] + data_type = None + if "data_type" in attrs: + data_type = attrs.pop("data_type") + if len(input_args) > 1: + j, i = next((j, i) for j, i in enumerate(input_args[1:]) if i is not None) + data_type = NODETYPE_TO_DATATYPE[types[j]] + input_kwargs[DATATYPE_FIELDS[NODETYPE_TO_DATATYPE[types[j]]]] = i + node = nw.new_node( + node_type=orig_type, + input_args=[], + attrs=attrs, + input_kwargs=input_kwargs, + compat_mode=False, + ) + if data_type is not None: + node.capture_items[0].data_type = data_type + return node + + +def compat_principled_bsdf(nw, orig_type, input_args, attrs, input_kwargs): + input_kwargs["Subsurface Scale"] = 1 + if "Subsurface Color" in input_kwargs: + logger.warning(f"Subsurface Color no longer in use for {orig_type}") + input_kwargs.pop("Subsurface Color") + return nw.new_node( + node_type=orig_type, + input_args=input_args, + attrs=attrs, + input_kwargs=input_kwargs, + compat_mode=False, + ) + + COMPATIBILITY_MAPPINGS = { Nodes.MixRGB: make_virtual_mixrgb, Nodes.TransferAttribute: make_virtual_transfer_attribute, Nodes.SampleCurve: compat_args_sample_curve, + Nodes.MusgraveTexture: compat_musgrave_texture, + Nodes.CaptureAttribute: compat_capture_attribute, + Nodes.PrincipledBSDF: compat_principled_bsdf, } diff --git a/infinigen/core/nodes/node_wrangler.py b/infinigen/core/nodes/node_wrangler.py index 34d08bf32..2fe90ffea 100644 --- a/infinigen/core/nodes/node_wrangler.py +++ b/infinigen/core/nodes/node_wrangler.py @@ -23,6 +23,7 @@ from infinigen.core.util.random import random_vector3 from .compatibility import COMPATIBILITY_MAPPINGS +from .utils import infer_input_socket, infer_output_socket logger = logging.getLogger(__name__) @@ -34,8 +35,12 @@ class NodeMisuseWarning(UserWarning): # This is for Blender 3.3 because of the nodetree change def geometry_node_group_empty_new(): group = bpy.data.node_groups.new("Geometry Nodes", "GeometryNodeTree") - group.inputs.new("NodeSocketGeometry", "Geometry") - group.outputs.new("NodeSocketGeometry", "Geometry") + group.interface.new_socket( + name="Geometry", in_out="INPUT", socket_type="NodeSocketGeometry" + ) + group.interface.new_socket( + name="Geometry", in_out="OUTPUT", socket_type="NodeSocketGeometry" + ) input_node = group.nodes.new("NodeGroupInput") output_node = group.nodes.new("NodeGroupOutput") output_node.is_active_output = True @@ -67,74 +72,6 @@ def warn_with_traceback(message, category, filename, lineno, file=None, line=Non log.write(warnings.formatwarning(message, category, filename, lineno, line)) -def isnode(x): - return isinstance( - x, (bpy.types.ShaderNode, bpy.types.NodeInternal, bpy.types.GeometryNode) - ) - - -def infer_output_socket(item): - """ - Figure out if `item` somehow represents a node with an output we can use. - If so, return that output socket - """ - - if isinstance(item, bpy.types.NodeSocket): - res = item - elif isnode(item): - # take the first active socket - try: - res = next(o for o in item.outputs if o.enabled) - except StopIteration: - raise ValueError( - f"Attempted to get output socket for {item} but none are enabled!" - ) - elif isinstance(item, tuple) and isnode(item[0]): - node, socket_name = item - if isinstance(socket_name, int): - return node.outputs[socket_name] - try: - res = next(o for o in node.outputs if o.enabled and o.name == socket_name) - except StopIteration: - raise ValueError( - f"Couldnt find an enabled socket on {node} corresponding to requested tuple {item}" - ) - else: - return None - - if not res.enabled: - raise ValueError( - f"Attempted to use output socket {res} of node {res.node} which is not enabled. " - "Please check your attrs are correct, or be more specific about the socket to use" - ) - - return res - - -def infer_input_socket(node, input_socket_name): - if isinstance(input_socket_name, str): - try: - input_socket = next( - i for i in node.inputs if i.name == input_socket_name and i.enabled - ) - except StopIteration: - input_socket = node.inputs[input_socket_name] - else: - input_socket = node.inputs[input_socket_name] - - if not input_socket.enabled: - logger.warning( - f'Attempted to use ({input_socket.name=},{input_socket.type=}) of {node.name=}, but it was ' - f'disabled. Either change attrs={{...}}, ' - f'change the socket index, or specify the socket by name (assuming two enabled sockets don\'t ' - f'share a name).' - f'The input sockets are ' - f'{[(i.name, i.type, ("ENABLED" if i.enabled else "DISABLED")) for i in node.inputs]}.', - ) - - return input_socket - - class NodeWrangler: def __init__(self, node_group): if issubclass(type(node_group), bpy.types.NodeTree): @@ -238,7 +175,9 @@ def new_node( ), "Multi-input sockets to GroupOutput nodes are impossible" if input_socket_name not in node.inputs: nodeclass = infer_output_socket(input_item).bl_idname - self.node_group.outputs.new(nodeclass, input_socket_name) + self.node_group.interface.new_socket( + name=input_socket_name, in_out="OUTPUT", socket_type=nodeclass + ) assert ( input_socket_name in node.inputs and node.inputs[input_socket_name].enabled @@ -286,13 +225,18 @@ def expose_input( group_input = self.new_node(Nodes.GroupInput) # will reuse singleton - if name in self.node_group.inputs: + if any( + s.name == name and s.in_out == "INPUT" + for s in self.node_group.interface.items_tree + ): assert len([o for o in group_input.outputs if o.name == name]) == 1 return group_input.outputs[name] # Infer from args what type of node input to make (NodeSocketFloat / NodeSocketVector / etc) nodeclass = self._infer_nodeclass_from_args(dtype, val) - inp = self.node_group.inputs.new(nodeclass, name) + inp = self.node_group.interface.new_socket( + name, in_out="INPUT", socket_type=nodeclass + ) def prepare_cast(to_type, val): # cast val only when necessary, and only when type(val) wont crash diff --git a/infinigen/core/nodes/utils.py b/infinigen/core/nodes/utils.py new file mode 100644 index 000000000..f1a32c62e --- /dev/null +++ b/infinigen/core/nodes/utils.py @@ -0,0 +1,81 @@ +import logging + +import bpy + +from infinigen.core.nodes import Nodes + +logger = logging.getLogger(__name__) + + +def infer_output_socket(item): + """ + Figure out if `item` somehow represents a node with an output we can use. + If so, return that output socket + """ + + if isinstance(item, bpy.types.NodeSocket): + res = item + elif isnode(item): + # take the first active socket + try: + res = next(o for o in item.outputs if o.enabled) + except StopIteration: + raise ValueError( + f"Attempted to get output socket for {item} but none are enabled!" + ) + elif isinstance(item, tuple) and isnode(item[0]): + node, socket_name = item + if isinstance(socket_name, int): + return node.outputs[socket_name] + try: + res = next(o for o in node.outputs if o.enabled and o.name == socket_name) + except StopIteration: + raise ValueError( + f"Couldnt find an enabled socket on {node} corresponding to requested tuple {item}" + ) + else: + return None + + if not res.enabled: + raise ValueError( + f"Attempted to use output socket {res} of node {res.node} which is not enabled. " + "Please check your attrs are correct, or be more specific about the socket to use" + ) + + return res + + +def infer_input_socket(node, input_socket_name): + if ( + node.bl_idname == Nodes.CaptureAttribute + and input_socket_name != 0 + and input_socket_name != "Geometry" + ): + node.capture_items.new("FLOAT", name="Attribute") + if isinstance(input_socket_name, str): + try: + input_socket = next( + i for i in node.inputs if i.name == input_socket_name and i.enabled + ) + except StopIteration: + input_socket = node.inputs[input_socket_name] + else: + input_socket = node.inputs[input_socket_name] + + if not input_socket.enabled: + logger.warning( + f'Attempted to use ({input_socket.name=},{input_socket.type=}) of {node.name=}, but it was ' + f'disabled. Either change attrs={{...}}, ' + f'change the socket index, or specify the socket by name (assuming two enabled sockets don\'t ' + f'share a name).' + f'The input sockets are ' + f'{[(i.name, i.type, ("ENABLED" if i.enabled else "DISABLED")) for i in node.inputs]}.', + ) + + return input_socket + + +def isnode(x): + return isinstance( + x, (bpy.types.ShaderNode, bpy.types.NodeInternal, bpy.types.GeometryNode) + ) diff --git a/infinigen/core/surface.py b/infinigen/core/surface.py index 49c244667..b7e3d56b0 100644 --- a/infinigen/core/surface.py +++ b/infinigen/core/surface.py @@ -24,9 +24,8 @@ Nodes, NodeWrangler, geometry_node_group_empty_new, - infer_output_socket, - isnode, ) +from infinigen.core.nodes.utils import infer_output_socket, isnode from infinigen.core.util import blender as butil @@ -391,11 +390,13 @@ def add_geomod( else: mod.node_group = ng - outputs = mod.node_group.outputs + outputs = [ + s for s in mod.node_group.interface.items_tree if s.in_out == "OUTPUT" + ] identifiers = [ outputs[i].identifier for i in range(len(outputs)) - if outputs[i].type != "GEOMETRY" + if outputs[i].socket_type != "NodeSocketGeometry" ] if len(identifiers) != len(attributes): raise Exception( @@ -406,11 +407,15 @@ def add_geomod( # attributes are a 1-indexed list, and Geometry is the first element, so we start from 2 # while f'Output_{i}_attribute_name' not in mod[id + "_attribute_name"] = att_name - os = [outputs[i] for i in range(len(outputs)) if outputs[i].type != "GEOMETRY"] + os = [ + outputs[i] + for i in range(len(outputs)) + if outputs[i].socket_type != "NodeSocketGeometry" + ] for o, domain in zip(os, domains): o.attribute_domain = domain - inputs = mod.node_group.inputs + inputs = [s for s in mod.node_group.interface.items_tree if s.in_out == "INPUT"] if not any(att_name is None for att_name in input_attributes): raise Exception("None should be provided for Geometry inputs.") for i, att_name in zip(inputs, input_attributes): diff --git a/infinigen/tools/export.py b/infinigen/tools/export.py index 654eb863f..040c47b9b 100644 --- a/infinigen/tools/export.py +++ b/infinigen/tools/export.py @@ -19,7 +19,7 @@ BAKE_TYPES = { "DIFFUSE": "Base Color", "ROUGHNESS": "Roughness", -} # 'EMIT':'Emission' # "GLOSSY": 'Specular', 'TRANSMISSION':'Transmission' don't export +} # 'EMIT':'Emission' # "GLOSSY": 'Specular IOR Level', 'TRANSMISSION':'Transmission Weight' don't export SPECIAL_BAKE = {"METAL": "Metallic", "NORMAL": "Normal"} ALL_BAKE = BAKE_TYPES | SPECIAL_BAKE @@ -360,12 +360,12 @@ def apply_baked_tex(obj, paramDict={}): principled_bsdf_node.inputs["Metallic"].default_value = paramDict[mat.name][ "Metallic" ] - principled_bsdf_node.inputs["Sheen"].default_value = paramDict[mat.name][ - "Sheen" - ] - principled_bsdf_node.inputs["Clearcoat"].default_value = paramDict[ + principled_bsdf_node.inputs["Sheen Weight"].default_value = paramDict[ + mat.name + ]["Sheen Weight"] + principled_bsdf_node.inputs["Coat Weight"].default_value = paramDict[ mat.name - ]["Clearcoat"] + ]["Coat Weight"] def create_glass_shader(node_tree, export_usd): @@ -387,7 +387,7 @@ def create_glass_shader(node_tree, export_usd): else: principled_bsdf_node.inputs["Roughness"].default_value = 0 - principled_bsdf_node.inputs["Transmission"].default_value = 1 + principled_bsdf_node.inputs["Transmission Weight"].default_value = 1 if export_usd: principled_bsdf_node.inputs["Alpha"].default_value = 0 node_tree.links.new( @@ -560,16 +560,16 @@ def remove_params(mat, node_tree): metal = principled_bsdf_node.inputs[ "Metallic" ].default_value # store metallic value and set to 0 - sheen = principled_bsdf_node.inputs["Sheen"].default_value - clearcoat = principled_bsdf_node.inputs["Clearcoat"].default_value + sheen = principled_bsdf_node.inputs["Sheen Weight"].default_value + clearcoat = principled_bsdf_node.inputs["Coat Weight"].default_value paramDict[mat.name] = { "Metallic": metal, - "Sheen": sheen, - "Clearcoat": clearcoat, + "Sheen Weight": sheen, + "Coat Weight": clearcoat, } principled_bsdf_node.inputs["Metallic"].default_value = 0 - principled_bsdf_node.inputs["Sheen"].default_value = 0 - principled_bsdf_node.inputs["Clearcoat"].default_value = 0 + principled_bsdf_node.inputs["Sheen Weight"].default_value = 0 + principled_bsdf_node.inputs["Coat Weight"].default_value = 0 return paramDict for node in nodes: From b760f5260129817cae4bdf2565e66fc2b7d6c1a9 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Mon, 9 Sep 2024 00:05:17 -0400 Subject: [PATCH 04/15] + Fix capture items --- .../assets/materials/aluminumdisp2tut.py | 2 +- infinigen/assets/materials/bark.py | 2 +- infinigen/assets/materials/bark_birch.py | 2 +- infinigen/assets/materials/bark_random.py | 2 +- infinigen/assets/materials/fishbody.py | 4 +- .../materials/reptile_brown_circle_attr.py | 4 +- .../assets/materials/reptile_gray_attr.py | 4 +- .../materials/reptile_two_color_attr.py | 4 +- infinigen/assets/materials/scale.py | 4 +- infinigen/assets/materials/slimy.py | 2 +- .../assets/materials/spot_sparse_attr.py | 2 +- infinigen/assets/materials/two_color_spots.py | 2 +- .../assets/materials/utils/surface_utils.py | 2 +- infinigen/assets/objects/cactus/columnar.py | 6 +- infinigen/assets/objects/cactus/globular.py | 6 +- .../insects/parts/body/dragonfly_body.py | 2 +- .../insects/parts/head/dragonfly_head.py | 2 +- .../insects/parts/leg/dragonfly_leg.py | 2 +- .../insects/parts/tail/dragonfly_tail.py | 2 +- .../insects/parts/wing/dragonfly_wing.py | 4 +- .../creatures/insects/utils/geom_utils.py | 4 +- .../objects/creatures/parts/chameleon.py | 2 +- .../assets/objects/creatures/parts/eye_new.py | 6 +- .../objects/creatures/parts/ridged_fin.py | 8 +-- .../creatures/util/animation/curve_slither.py | 2 +- .../objects/fruits/cross_section_lib.py | 4 +- .../assets/objects/fruits/fruit_utils.py | 4 +- infinigen/assets/objects/fruits/stem_lib.py | 6 +- .../objects/fruits/surfaces/durian_surface.py | 2 +- .../fruits/surfaces/pineapple_surface.py | 2 +- infinigen/assets/objects/grassland/flower.py | 6 +- .../assets/objects/leaves/leaf_broadleaf.py | 8 +-- infinigen/assets/objects/leaves/leaf_ginko.py | 4 +- infinigen/assets/objects/leaves/leaf_maple.py | 2 +- infinigen/assets/objects/leaves/leaf_v2.py | 4 +- infinigen/assets/objects/monocot/growth.py | 6 +- .../assets/objects/shelves/triangle_shelf.py | 4 +- .../objects/small_plants/snake_plant.py | 4 +- .../objects/small_plants/spider_plant.py | 4 +- .../assets/objects/tables/table_utils.py | 2 +- infinigen/assets/objects/trees/branch.py | 14 ++--- infinigen/assets/objects/trees/tree_flower.py | 6 +- .../objects/trees/utils/geometrynodes.py | 6 +- .../objects/tropic_plants/coconut_tree.py | 2 +- .../objects/tropic_plants/leaf_banana_tree.py | 6 +- .../objects/tropic_plants/leaf_palm_plant.py | 6 +- .../objects/tropic_plants/leaf_palm_tree.py | 6 +- .../assets/objects/tropic_plants/palm_tree.py | 2 +- .../tropic_plants/tropic_plant_utils.py | 2 +- infinigen/assets/objects/windows/window.py | 4 +- infinigen/assets/utils/nodegroups/hair.py | 4 +- infinigen/core/nodes/compatibility.py | 58 +++++++++++++++---- 52 files changed, 148 insertions(+), 112 deletions(-) diff --git a/infinigen/assets/materials/aluminumdisp2tut.py b/infinigen/assets/materials/aluminumdisp2tut.py index 8469dc525..8c7b0a60b 100644 --- a/infinigen/assets/materials/aluminumdisp2tut.py +++ b/infinigen/assets/materials/aluminumdisp2tut.py @@ -241,7 +241,7 @@ def geo_aluminumdisp2tut(nw: NodeWrangler, rand=False, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "Attribute": capture_attribute.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/materials/bark.py b/infinigen/assets/materials/bark.py index 586b5af6e..34843ddba 100644 --- a/infinigen/assets/materials/bark.py +++ b/infinigen/assets/materials/bark.py @@ -204,7 +204,7 @@ def geo_bark(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "Attribute": capture_attribute.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], }, attrs={"is_active_output": True}, ) diff --git a/infinigen/assets/materials/bark_birch.py b/infinigen/assets/materials/bark_birch.py index ce77e6d66..40db4ae00 100644 --- a/infinigen/assets/materials/bark_birch.py +++ b/infinigen/assets/materials/bark_birch.py @@ -366,7 +366,7 @@ def geo_bark_birch(nw, selection=None): Nodes.GroupOutput, input_kwargs={ "Geometry": group, - "initial_position": capture_attribute.outputs["Attribute"], + "initial_position": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/materials/bark_random.py b/infinigen/assets/materials/bark_random.py index 6ce11d8c0..a15ffd020 100644 --- a/infinigen/assets/materials/bark_random.py +++ b/infinigen/assets/materials/bark_random.py @@ -920,7 +920,7 @@ def geo_bark_random(nw, base_color, geo_params, selection=None): Nodes.GroupOutput, input_kwargs={ "Geometry": group, - "initial_position": capture_attribute.outputs["Attribute"], + "initial_position": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/materials/fishbody.py b/infinigen/assets/materials/fishbody.py index e5dfe6098..1f2bc8e28 100644 --- a/infinigen/assets/materials/fishbody.py +++ b/infinigen/assets/materials/fishbody.py @@ -537,7 +537,7 @@ def nodegroup_scales(nw: NodeWrangler): separate_xyz_7 = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute_1.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute_1.outputs[1]}, ) attribute_statistic = nw.new_node( @@ -595,7 +595,7 @@ def nodegroup_scales(nw: NodeWrangler): input_kwargs={ "Geometry": capture_attribute_4.outputs["Geometry"], "attr2": combine_xyz_3, - "attr5": capture_attribute_4.outputs["Attribute"], + "attr5": capture_attribute_4.outputs[1], }, ) diff --git a/infinigen/assets/materials/reptile_brown_circle_attr.py b/infinigen/assets/materials/reptile_brown_circle_attr.py index 12a4bb925..608cc8148 100644 --- a/infinigen/assets/materials/reptile_brown_circle_attr.py +++ b/infinigen/assets/materials/reptile_brown_circle_attr.py @@ -394,8 +394,8 @@ def geometry_reptile_vor_attr(nw: NodeWrangler, rand=True, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute_1.outputs["Geometry"], - "attr1": capture_attribute.outputs["Attribute"], - "attr2": capture_attribute_1.outputs["Attribute"], + "attr1": capture_attribute.outputs[1], + "attr2": capture_attribute_1.outputs[1], }, ) diff --git a/infinigen/assets/materials/reptile_gray_attr.py b/infinigen/assets/materials/reptile_gray_attr.py index 9cfa4fcfd..1e88af3de 100644 --- a/infinigen/assets/materials/reptile_gray_attr.py +++ b/infinigen/assets/materials/reptile_gray_attr.py @@ -246,8 +246,8 @@ def geometry_reptile_vor_attr(nw: NodeWrangler, rand=True, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute_1.outputs["Geometry"], - "attr1": capture_attribute.outputs["Attribute"], - "attr2": capture_attribute_1.outputs["Attribute"], + "attr1": capture_attribute.outputs[1], + "attr2": capture_attribute_1.outputs[1], }, ) diff --git a/infinigen/assets/materials/reptile_two_color_attr.py b/infinigen/assets/materials/reptile_two_color_attr.py index 09089cc35..e847caf9d 100644 --- a/infinigen/assets/materials/reptile_two_color_attr.py +++ b/infinigen/assets/materials/reptile_two_color_attr.py @@ -322,8 +322,8 @@ def geometry_reptile_vor_attr(nw: NodeWrangler, rand=True, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute_1.outputs["Geometry"], - "attr1": capture_attribute.outputs["Attribute"], - "attr2": capture_attribute_1.outputs["Attribute"], + "attr1": capture_attribute.outputs[1], + "attr2": capture_attribute_1.outputs[1], }, ) diff --git a/infinigen/assets/materials/scale.py b/infinigen/assets/materials/scale.py index 826fa259a..1fdbed206 100644 --- a/infinigen/assets/materials/scale.py +++ b/infinigen/assets/materials/scale.py @@ -577,8 +577,8 @@ def geo_scale(nw, rand=True, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute_4.outputs["Geometry"], - "attr2": capture_attribute_1.outputs["Attribute"], - "attr5": capture_attribute_4.outputs["Attribute"], + "attr2": capture_attribute_1.outputs[1], + "attr5": capture_attribute_4.outputs[1], }, attrs={"is_active_output": True}, ) diff --git a/infinigen/assets/materials/slimy.py b/infinigen/assets/materials/slimy.py index 1b7bbff42..1bc192a8e 100644 --- a/infinigen/assets/materials/slimy.py +++ b/infinigen/assets/materials/slimy.py @@ -167,7 +167,7 @@ def geo_slimy(nw, rand=False, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "Attribute": capture_attribute.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/materials/spot_sparse_attr.py b/infinigen/assets/materials/spot_sparse_attr.py index ff7880986..9549df274 100644 --- a/infinigen/assets/materials/spot_sparse_attr.py +++ b/infinigen/assets/materials/spot_sparse_attr.py @@ -178,7 +178,7 @@ def geometry_spots_sparse(nw: NodeWrangler, rand=True, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "Attribute": capture_attribute.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/materials/two_color_spots.py b/infinigen/assets/materials/two_color_spots.py index a54177c79..c62ccc58f 100644 --- a/infinigen/assets/materials/two_color_spots.py +++ b/infinigen/assets/materials/two_color_spots.py @@ -175,7 +175,7 @@ def geo_two_color_spots(nw, rand=True, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "Attribute": capture_attribute.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/materials/utils/surface_utils.py b/infinigen/assets/materials/utils/surface_utils.py index 7edb9cc39..47f3f6b52 100644 --- a/infinigen/assets/materials/utils/surface_utils.py +++ b/infinigen/assets/materials/utils/surface_utils.py @@ -297,7 +297,7 @@ def geo_voronoi_noise(nw, rand=False, **input_kwargs): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "Attribute": capture_attribute.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/objects/cactus/columnar.py b/infinigen/assets/objects/cactus/columnar.py index 72ec8f1d2..83ca91d97 100644 --- a/infinigen/assets/objects/cactus/columnar.py +++ b/infinigen/assets/objects/cactus/columnar.py @@ -118,9 +118,9 @@ def geo_star(nw: NodeWrangler): selection = nw.compare( "EQUAL", nw.math("MODULO", nw.new_node(Nodes.Index), 2), 0 ) - circle, _, selection = nw.new_node( - Nodes.CaptureAttribute, [circle, None, selection] - ).outputs[:3] + circle, selection = nw.new_node( + Nodes.CaptureAttribute, [circle, selection] + ).outputs[:2] circle = nw.new_node( Nodes.SetPosition, [ diff --git a/infinigen/assets/objects/cactus/globular.py b/infinigen/assets/objects/cactus/globular.py index 8d7170317..bdc1c2e5a 100644 --- a/infinigen/assets/objects/cactus/globular.py +++ b/infinigen/assets/objects/cactus/globular.py @@ -30,9 +30,9 @@ def geo_globular(nw: NodeWrangler): selection = nw.compare( "EQUAL", nw.math("MODULO", nw.new_node(Nodes.Index), 2), 0 ) - circle, _, selection = nw.new_node( - Nodes.CaptureAttribute, [circle, None, selection] - ).outputs[:3] + circle, selection = nw.new_node( + Nodes.CaptureAttribute, [circle, selection] + ).outputs[:2] circle = nw.new_node( Nodes.SetPosition, [ diff --git a/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py b/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py index 1e5a7601e..4bda36fec 100644 --- a/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py +++ b/infinigen/assets/objects/creatures/insects/parts/body/dragonfly_body.py @@ -318,7 +318,7 @@ def nodegroup_dragonfly_body( ) reroute = nw.new_node( - Nodes.Reroute, input_kwargs={"Input": capture_attribute.outputs[2]} + Nodes.Reroute, input_kwargs={"Input": capture_attribute.outputs[1]} ) less_than = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py b/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py index 3e8e2af61..f4d8b6574 100644 --- a/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py +++ b/infinigen/assets/objects/creatures/insects/parts/head/dragonfly_head.py @@ -137,7 +137,7 @@ def nodegroup_dragon_fly_head( ) float_curve_1 = nw.new_node( - Nodes.FloatCurve, input_kwargs={"Value": capture_attribute.outputs[2]} + Nodes.FloatCurve, input_kwargs={"Value": capture_attribute.outputs[1]} ) node_utils.assign_curve( float_curve_1.mapping.curves[0], diff --git a/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py b/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py index 7d83213e7..813a5c9b5 100644 --- a/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py +++ b/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py @@ -236,7 +236,7 @@ def nodegroup_leg_part(nw: NodeWrangler): ) greater_than = nw.new_node( - Nodes.Compare, input_kwargs={0: capture_attribute_1.outputs[2], 1: 0.9} + Nodes.Compare, input_kwargs={0: capture_attribute_1.outputs[1], 1: 0.9} ) delete_geometry_1 = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py b/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py index 0f4420f0d..27a670fa9 100644 --- a/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py +++ b/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py @@ -224,7 +224,7 @@ def nodegroup_dragonfly_tail( map_range = nw.new_node( Nodes.MapRange, - input_kwargs={"Value": capture_attribute.outputs[2], 3: 1.0, 4: 0.8}, + input_kwargs={"Value": capture_attribute.outputs[1], 3: 1.0, 4: 0.8}, ) multiply = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/parts/wing/dragonfly_wing.py b/infinigen/assets/objects/creatures/insects/parts/wing/dragonfly_wing.py index 1e6282c88..ed321e55d 100644 --- a/infinigen/assets/objects/creatures/insects/parts/wing/dragonfly_wing.py +++ b/infinigen/assets/objects/creatures/insects/parts/wing/dragonfly_wing.py @@ -170,12 +170,12 @@ def nodegroup_dragonfly_wing(nw: NodeWrangler): less_than = nw.new_node( Nodes.Compare, - input_kwargs={0: capture_attribute.outputs[2], 1: 0.65}, + input_kwargs={0: capture_attribute.outputs[1], 1: 0.65}, attrs={"operation": "LESS_THAN"}, ) greater_than = nw.new_node( - Nodes.Compare, input_kwargs={0: capture_attribute.outputs[2], 1: 0.84} + Nodes.Compare, input_kwargs={0: capture_attribute.outputs[1], 1: 0.84} ) op_or = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py index 7b62ff07b..ff8af30a7 100644 --- a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py +++ b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py @@ -906,8 +906,8 @@ def nodegroup_shape_quadratic( Nodes.GroupOutput, input_kwargs={ "Mesh": curve_to_mesh, - "spline parameter": capture_attribute.outputs[2], - "spline tangent": capture_attribute_1.outputs["Attribute"], + "spline parameter": capture_attribute.outputs[1], + "spline tangent": capture_attribute_1.outputs[1], "radius to center": geometry_proximity.outputs["Distance"], }, ) diff --git a/infinigen/assets/objects/creatures/parts/chameleon.py b/infinigen/assets/objects/creatures/parts/chameleon.py index 8f9e142b1..7718a07b9 100644 --- a/infinigen/assets/objects/creatures/parts/chameleon.py +++ b/infinigen/assets/objects/creatures/parts/chameleon.py @@ -72,7 +72,7 @@ def nodegroup_chameleon_toe(nw: NodeWrangler): input_kwargs={ "Geometry": curve_to_mesh, "Name": "Ridge", - "Value": capture_attribute.outputs[2], + "Value": capture_attribute.outputs[1], }, attrs={"data_type": "FLOAT", "domain": "POINT"}, ) diff --git a/infinigen/assets/objects/creatures/parts/eye_new.py b/infinigen/assets/objects/creatures/parts/eye_new.py index cbb9ffecb..ef3a507ba 100644 --- a/infinigen/assets/objects/creatures/parts/eye_new.py +++ b/infinigen/assets/objects/creatures/parts/eye_new.py @@ -415,7 +415,7 @@ def nodegroup_eyelid_radius(nw: NodeWrangler): group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Geometry": transform, "Attribute": capture_attribute.outputs[2]}, + input_kwargs={"Geometry": transform, "Attribute": capture_attribute.outputs[1]}, ) @@ -634,8 +634,8 @@ def nodegroup_eyelid_circle(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Geometry": set_position, - "Attribute": capture_attribute.outputs[2], - "Attribute1": capture_attribute_1.outputs["Attribute"], + "Attribute": capture_attribute.outputs[1], + "Attribute1": capture_attribute_1.outputs[1], }, ) diff --git a/infinigen/assets/objects/creatures/parts/ridged_fin.py b/infinigen/assets/objects/creatures/parts/ridged_fin.py index 2708bb011..1548b2864 100644 --- a/infinigen/assets/objects/creatures/parts/ridged_fin.py +++ b/infinigen/assets/objects/creatures/parts/ridged_fin.py @@ -186,7 +186,7 @@ def nodegroup_fish_fin(nw: NodeWrangler): separate_xyz_2 = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) add_2 = nw.new_node(Nodes.Math, input_kwargs={0: separate_xyz_2.outputs["X"]}) @@ -568,7 +568,7 @@ def nodegroup_fish_fin(nw: NodeWrangler): multiply_24 = nw.new_node( Nodes.Math, input_kwargs={ - 0: capture_attribute_1.outputs[2], + 0: capture_attribute_1.outputs[1], 1: capture_z_rigidity.outputs[2], }, attrs={"operation": "MULTIPLY"}, @@ -601,8 +601,8 @@ def nodegroup_fish_fin(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Geometry": store_cloth_pin, - "Bump": capture_attribute_1.outputs[2], - "BumpMask": capture_attribute_2.outputs[2], + "Bump": capture_attribute_1.outputs[1], + "BumpMask": capture_attribute_2.outputs[1], }, ) diff --git a/infinigen/assets/objects/creatures/util/animation/curve_slither.py b/infinigen/assets/objects/creatures/util/animation/curve_slither.py index d307f9faa..8163d274d 100644 --- a/infinigen/assets/objects/creatures/util/animation/curve_slither.py +++ b/infinigen/assets/objects/creatures/util/animation/curve_slither.py @@ -231,7 +231,7 @@ def nodegroup_wiggles(nw: NodeWrangler): nodegroup_add_loopbacks().name, input_kwargs={ "Geometry": addwiggles, - "Vector": capture_attribute.outputs["Attribute"], + "Vector": capture_attribute.outputs[1], "Amount": group_input.outputs["Loopyness"], "Randomness": group_input.outputs["LoopRandom"], }, diff --git a/infinigen/assets/objects/fruits/cross_section_lib.py b/infinigen/assets/objects/fruits/cross_section_lib.py index 72f5c2335..0322231a9 100644 --- a/infinigen/assets/objects/fruits/cross_section_lib.py +++ b/infinigen/assets/objects/fruits/cross_section_lib.py @@ -200,7 +200,7 @@ def nodegroup_star_cross_section(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Geometry": set_position, - "curve parameters": capture_attribute.outputs[2], + "curve parameters": capture_attribute.outputs[1], }, ) @@ -415,6 +415,6 @@ def nodegroup_coconut_cross_section( Nodes.GroupOutput, input_kwargs={ "Geometry": set_position, - "curve parameters": capture_attribute.outputs[2], + "curve parameters": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/objects/fruits/fruit_utils.py b/infinigen/assets/objects/fruits/fruit_utils.py index 21b746fa3..76003a807 100644 --- a/infinigen/assets/objects/fruits/fruit_utils.py +++ b/infinigen/assets/objects/fruits/fruit_utils.py @@ -476,8 +476,8 @@ def nodegroup_shape_quadratic( Nodes.GroupOutput, input_kwargs={ "Mesh": curve_to_mesh, - "spline parameter": capture_attribute.outputs[2], - "spline tangent": capture_attribute_1.outputs["Attribute"], + "spline parameter": capture_attribute.outputs[1], + "spline tangent": capture_attribute_1.outputs[1], "radius to center": geometry_proximity.outputs["Distance"], }, ) diff --git a/infinigen/assets/objects/fruits/stem_lib.py b/infinigen/assets/objects/fruits/stem_lib.py index 61b2732b1..9097d7ec5 100644 --- a/infinigen/assets/objects/fruits/stem_lib.py +++ b/infinigen/assets/objects/fruits/stem_lib.py @@ -700,7 +700,7 @@ def nodegroup_coconut_stem( map_range_2 = nw.new_node( Nodes.MapRange, input_kwargs={ - "Value": capture_attribute.outputs[2], + "Value": capture_attribute.outputs[1], 3: group_input.outputs["base scale"], 4: group_input.outputs["top scale"], }, @@ -722,7 +722,7 @@ def nodegroup_coconut_stem( ) map_range_1 = nw.new_node( - Nodes.MapRange, input_kwargs={"Value": capture_attribute.outputs[2], 4: 0.01} + Nodes.MapRange, input_kwargs={"Value": capture_attribute.outputs[1], 4: 0.01} ) combine_xyz = nw.new_node( @@ -759,7 +759,7 @@ def nodegroup_coconut_stem( Nodes.GroupOutput, input_kwargs={ "Geometry": join_geometry, - "distance to edge": capture_attribute_1.outputs[2], + "distance to edge": capture_attribute_1.outputs[1], }, ) diff --git a/infinigen/assets/objects/fruits/surfaces/durian_surface.py b/infinigen/assets/objects/fruits/surfaces/durian_surface.py index 9a6be358c..8ae9e3943 100644 --- a/infinigen/assets/objects/fruits/surfaces/durian_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/durian_surface.py @@ -202,6 +202,6 @@ def nodegroup_durian_surface( Nodes.GroupOutput, input_kwargs={ "Geometry": set_material, - "distance to center": capture_attribute.outputs[2], + "distance to center": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py b/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py index e41332b5e..bcd99fa2f 100644 --- a/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py +++ b/infinigen/assets/objects/fruits/surfaces/pineapple_surface.py @@ -327,6 +327,6 @@ def nodegroup_pineapple_cell_body(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Geometry": set_position_1, - "spline parameter": capture_attribute.outputs[2], + "spline parameter": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/objects/grassland/flower.py b/infinigen/assets/objects/grassland/flower.py index eab315f36..104bb9a76 100644 --- a/infinigen/assets/objects/grassland/flower.py +++ b/infinigen/assets/objects/grassland/flower.py @@ -81,7 +81,7 @@ def nodegroup_follow_curve(nw): separate_xyz = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) attribute_statistic = nw.new_node( @@ -225,7 +225,7 @@ def nodegroup_flower_petal(nw): separate_xyz = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) multiply = nw.new_node( @@ -261,7 +261,7 @@ def nodegroup_flower_petal(nw): separate_xyz_1 = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) add_1 = nw.new_node(Nodes.Math, input_kwargs={0: separate_xyz_1.outputs["X"]}) diff --git a/infinigen/assets/objects/leaves/leaf_broadleaf.py b/infinigen/assets/objects/leaves/leaf_broadleaf.py index 2606506ef..d7982319e 100644 --- a/infinigen/assets/objects/leaves/leaf_broadleaf.py +++ b/infinigen/assets/objects/leaves/leaf_broadleaf.py @@ -950,7 +950,7 @@ def nodegroup_nodegroup_leaf_gen(nw: NodeWrangler, **kwargs): Nodes.GroupOutput, input_kwargs={ "Mesh": set_position_1, - "Attribute": capture_attribute.outputs[2], + "Attribute": capture_attribute.outputs[1], "X Modulated": nodegroup_midrib.outputs["X Modulated"], "Vein Coord": nodegroup_vein_coord_001, "Vein Value": nodegroup_apply_vein_midrib, @@ -1158,9 +1158,9 @@ def geo_leaf_broadleaf(nw: NodeWrangler, **kwargs): input_kwargs={ "Geometry": move_to_origin, "Offset": nodegroup_leaf_gen.outputs["Attribute"], - "Coordinate": capture_attribute.outputs["Attribute"], - "subvein offset": capture_attribute_1.outputs[2], - "vein value": capture_attribute_2.outputs[2], + "Coordinate": capture_attribute.outputs[1], + "subvein offset": capture_attribute_1.outputs[1], + "vein value": capture_attribute_2.outputs[1], }, ) diff --git a/infinigen/assets/objects/leaves/leaf_ginko.py b/infinigen/assets/objects/leaves/leaf_ginko.py index 90c313f40..a3cc77362 100644 --- a/infinigen/assets/objects/leaves/leaf_ginko.py +++ b/infinigen/assets/objects/leaves/leaf_ginko.py @@ -557,8 +557,8 @@ def nodegroup_ginko( Nodes.GroupOutput, input_kwargs={ "Geometry": set_position, - "Vein": capture_attribute_1.outputs[2], - "Shape": capture_attribute.outputs[2], + "Vein": capture_attribute_1.outputs[1], + "Shape": capture_attribute.outputs[1], "Wave": multiply_5, }, ) diff --git a/infinigen/assets/objects/leaves/leaf_maple.py b/infinigen/assets/objects/leaves/leaf_maple.py index 1119828a4..88f46ecbb 100644 --- a/infinigen/assets/objects/leaves/leaf_maple.py +++ b/infinigen/assets/objects/leaves/leaf_maple.py @@ -1190,7 +1190,7 @@ def geo_leaf_maple(nw: NodeWrangler, **kwargs): group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Geometry": apply_wave, "Vein": capture_attribute.outputs[2]}, + input_kwargs={"Geometry": apply_wave, "Vein": capture_attribute.outputs[1]}, ) diff --git a/infinigen/assets/objects/leaves/leaf_v2.py b/infinigen/assets/objects/leaves/leaf_v2.py index 888fd82c7..d131d7380 100644 --- a/infinigen/assets/objects/leaves/leaf_v2.py +++ b/infinigen/assets/objects/leaves/leaf_v2.py @@ -1010,7 +1010,7 @@ def nodegroup_leaf_gen( Nodes.GroupOutput, input_kwargs={ "Mesh": capture_attribute, - "Attribute": capture_attribute.outputs[2], + "Attribute": capture_attribute.outputs[1], "X Modulated": midrib.outputs["X Modulated"], "Vein Coord": veincoord, }, @@ -1567,7 +1567,7 @@ def geo_leaf_v2(nw, **kwargs): input_kwargs={ "Geometry": movetoorigin, "Attribute": leafgen.outputs["Attribute"], - "Coordinate": capture_attribute.outputs["Attribute"], + "Coordinate": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/objects/monocot/growth.py b/infinigen/assets/objects/monocot/growth.py index 11c896948..fbfdc31a6 100644 --- a/infinigen/assets/objects/monocot/growth.py +++ b/infinigen/assets/objects/monocot/growth.py @@ -165,9 +165,9 @@ def geo_flower(nw: NodeWrangler, leaves): }, attrs={"pivot_axis": "Z"}, ) - points, _, z_rotation = nw.new_node( - Nodes.CaptureAttribute, [points, None, z_rotation] - ).outputs[:3] + points, z_rotation = nw.new_node( + Nodes.CaptureAttribute, [points, z_rotation] + ).outputs leaves = nw.new_node(Nodes.CollectionInfo, [leaves, True, True]) is_leaf = reduce( lambda *xs: nw.boolean_math("AND", *xs), diff --git a/infinigen/assets/objects/shelves/triangle_shelf.py b/infinigen/assets/objects/shelves/triangle_shelf.py index 3af3af80e..8eb759a85 100644 --- a/infinigen/assets/objects/shelves/triangle_shelf.py +++ b/infinigen/assets/objects/shelves/triangle_shelf.py @@ -172,7 +172,7 @@ def nodegroup_curve_to_board(nw: NodeWrangler): Nodes.SampleCurve, input_kwargs={ "Curve": group_input.outputs["Profile Curve"], - "Factor": capture_attribute.outputs[2], + "Factor": capture_attribute.outputs[1], }, attrs={"mode": "FACTOR"}, ) @@ -325,7 +325,7 @@ def nodegroup_leg_straight(nw: NodeWrangler): Nodes.SampleCurve, input_kwargs={ "Curve": group_input.outputs["Profile Curve"], - "Factor": capture_attribute.outputs[2], + "Factor": capture_attribute.outputs[1], }, attrs={"mode": "FACTOR"}, ) diff --git a/infinigen/assets/objects/small_plants/snake_plant.py b/infinigen/assets/objects/small_plants/snake_plant.py index 8433361b2..f4a7f5973 100644 --- a/infinigen/assets/objects/small_plants/snake_plant.py +++ b/infinigen/assets/objects/small_plants/snake_plant.py @@ -145,7 +145,7 @@ def nodegroup_setup(nw: NodeWrangler): group_output = nw.new_node( Nodes.GroupOutput, input_kwargs={ - "Spline": capture_attribute_1.outputs[2], + "Spline": capture_attribute_1.outputs[1], "Geometry": capture_attribute_1.outputs["Geometry"], }, ) @@ -207,7 +207,7 @@ def nodegroup_edge_extrusion(nw: NodeWrangler): Nodes.ExtrudeMesh, input_kwargs={ "Mesh": curve_to_mesh, - "Offset": capture_attribute.outputs["Attribute"], + "Offset": capture_attribute.outputs[1], "Offset Scale": float_curve, }, attrs={"mode": "EDGES"}, diff --git a/infinigen/assets/objects/small_plants/spider_plant.py b/infinigen/assets/objects/small_plants/spider_plant.py index 0e76b7c1f..9e28cd9e4 100644 --- a/infinigen/assets/objects/small_plants/spider_plant.py +++ b/infinigen/assets/objects/small_plants/spider_plant.py @@ -234,7 +234,7 @@ def nodegroup_leaf_geometry(nw: NodeWrangler): set_leaf_countour = nw.new_node( nodegroup_set_leaf_countour().name, - input_kwargs={"Value": capture_attribute_3.outputs[2]}, + input_kwargs={"Value": capture_attribute_3.outputs[1]}, ) set_position_8 = nw.new_node( @@ -253,7 +253,7 @@ def nodegroup_leaf_geometry(nw: NodeWrangler): Nodes.ExtrudeMesh, input_kwargs={ "Mesh": curve_to_mesh_2, - "Offset": capture_attribute_2.outputs["Attribute"], + "Offset": capture_attribute_2.outputs[1], "Offset Scale": set_leaf_countour.outputs["Value"], }, attrs={"mode": "EDGES"}, diff --git a/infinigen/assets/objects/tables/table_utils.py b/infinigen/assets/objects/tables/table_utils.py index d00216a27..55cf933dd 100644 --- a/infinigen/assets/objects/tables/table_utils.py +++ b/infinigen/assets/objects/tables/table_utils.py @@ -192,7 +192,7 @@ def nodegroup_n_gon_cylinder(nw: NodeWrangler): Nodes.SampleCurve, input_kwargs={ "Curves": group_input.outputs["Radius Curve"], - "Factor": capture_attribute.outputs[2], + "Factor": capture_attribute.outputs[1], }, attrs={"use_all_curves": True}, ) diff --git a/infinigen/assets/objects/trees/branch.py b/infinigen/assets/objects/trees/branch.py index 94836f4d8..766ff5367 100644 --- a/infinigen/assets/objects/trees/branch.py +++ b/infinigen/assets/objects/trees/branch.py @@ -356,7 +356,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): nodegroup_generate_anchor().name, input_kwargs={ "Curve": capture_attribute, - "curve parameter": capture_attribute.outputs[2], + "curve parameter": capture_attribute.outputs[1], "trim_top": 0.9000, "seed": add, "density": kwargs["fruit density"], @@ -468,7 +468,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): map_range_2 = nw.new_node( Nodes.MapRange, - input_kwargs={"Value": capture_attribute.outputs[2], 3: 1.0000, 4: 0.1000}, + input_kwargs={"Value": capture_attribute.outputs[1], 3: 1.0000, 4: 0.1000}, ) multiply_3 = nw.new_node( @@ -510,7 +510,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): map_range_3 = nw.new_node( Nodes.MapRange, - input_kwargs={"Value": capture_attribute_1.outputs[2], 2: 0.2000}, + input_kwargs={"Value": capture_attribute_1.outputs[1], 2: 0.2000}, ) scale_2 = nw.new_node( @@ -553,7 +553,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): nodegroup_generate_anchor().name, input_kwargs={ "Curve": capture_attribute_2.outputs["Geometry"], - "curve parameter": capture_attribute_1.outputs[2], + "curve parameter": capture_attribute_1.outputs[1], "trim_top": 1.0000, "seed": add_2, "density": kwargs["leaf density"], @@ -576,7 +576,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): "Points": generateanchor_1, "Instance": collection_info, "Pick Instance": True, - "Tangent": capture_attribute_2.outputs["Attribute"], + "Tangent": capture_attribute_2.outputs[1], "Rot x deg": kwargs["leaf rot"], "Scale": kwargs["leaf scale"], "Seed": kwargs["seed"], @@ -585,7 +585,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): map_range_1 = nw.new_node( Nodes.MapRange, - input_kwargs={"Value": capture_attribute.outputs[2], 3: 1.0000, 4: 0.4000}, + input_kwargs={"Value": capture_attribute.outputs[1], 3: 1.0000, 4: 0.4000}, ) multiply_4 = nw.new_node( @@ -626,7 +626,7 @@ def generate_branch(nw: NodeWrangler, **kwargs): map_range_4 = nw.new_node( Nodes.MapRange, - input_kwargs={"Value": capture_attribute_1.outputs[2], 3: 0.8000, 4: 0.1000}, + input_kwargs={"Value": capture_attribute_1.outputs[1], 3: 0.8000, 4: 0.1000}, ) multiply_7 = nw.new_node( diff --git a/infinigen/assets/objects/trees/tree_flower.py b/infinigen/assets/objects/trees/tree_flower.py index 1f447e1d6..c451dfd4a 100644 --- a/infinigen/assets/objects/trees/tree_flower.py +++ b/infinigen/assets/objects/trees/tree_flower.py @@ -83,7 +83,7 @@ def nodegroup_follow_curve(nw): separate_xyz = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) attribute_statistic = nw.new_node( @@ -227,7 +227,7 @@ def nodegroup_flower_petal(nw): separate_xyz = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) multiply = nw.new_node( @@ -263,7 +263,7 @@ def nodegroup_flower_petal(nw): separate_xyz_1 = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) add_1 = nw.new_node(Nodes.Math, input_kwargs={0: separate_xyz_1.outputs["X"]}) diff --git a/infinigen/assets/objects/trees/utils/geometrynodes.py b/infinigen/assets/objects/trees/utils/geometrynodes.py index 06c019fcf..474c8e9fe 100644 --- a/infinigen/assets/objects/trees/utils/geometrynodes.py +++ b/infinigen/assets/objects/trees/utils/geometrynodes.py @@ -444,7 +444,7 @@ def follow_curve(nw): separate_xyz = nw.new_node( Nodes.SeparateXYZ, - input_kwargs={"Vector": capture_attribute.outputs["Attribute"]}, + input_kwargs={"Vector": capture_attribute.outputs[1]}, ) math = nw.new_node( @@ -897,7 +897,7 @@ def bark_geo_2(nw): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "offset_barkgeo2": capture_attribute.outputs["Attribute"], + "offset_barkgeo2": capture_attribute.outputs[1], }, ) @@ -981,7 +981,7 @@ def bark_geo_1(nw): Nodes.GroupOutput, input_kwargs={ "Geometry": capture_attribute.outputs["Geometry"], - "offset_barkgeo1": capture_attribute.outputs["Attribute"], + "offset_barkgeo1": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/objects/tropic_plants/coconut_tree.py b/infinigen/assets/objects/tropic_plants/coconut_tree.py index 04e65f096..3edc66f3e 100644 --- a/infinigen/assets/objects/tropic_plants/coconut_tree.py +++ b/infinigen/assets/objects/tropic_plants/coconut_tree.py @@ -730,7 +730,7 @@ def nodegroup_tree_cracks(nw: NodeWrangler): multiply = nw.new_node( Nodes.Math, - input_kwargs={0: capture_attribute.outputs[2], 1: uniform(0.1, 0.25)}, + input_kwargs={0: capture_attribute.outputs[1], 1: uniform(0.1, 0.25)}, attrs={"operation": "MULTIPLY"}, ) diff --git a/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py b/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py index d13001fd5..8151dc496 100644 --- a/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py +++ b/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py @@ -469,9 +469,9 @@ def nodegroup_round_tropical_leaf( Nodes.GroupOutput, input_kwargs={ "Attribute": nodegroup_leaf_gen.outputs["Attribute"], - "Coordinate": capture_attribute.outputs["Attribute"], - "subvein": capture_attribute_1.outputs[2], - "vein": capture_attribute_2.outputs[2], + "Coordinate": capture_attribute.outputs[1], + "subvein": capture_attribute_1.outputs[1], + "vein": capture_attribute_2.outputs[1], "Geometry": nodegroup_leaf_rotate_x, }, ) diff --git a/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py b/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py index 64da62d7e..ddfe893cb 100644 --- a/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py +++ b/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py @@ -344,9 +344,9 @@ def nodegroup_leaf_palm_instance(nw: NodeWrangler, leaf_h_wave_control_points): Nodes.GroupOutput, input_kwargs={ "Attribute": nodegroup_leaf_gen.outputs["Attribute"], - "Coordinate": capture_attribute.outputs["Attribute"], - "subvein": capture_attribute_1.outputs[2], - "vein": capture_attribute_2.outputs[2], + "Coordinate": capture_attribute.outputs[1], + "subvein": capture_attribute_1.outputs[1], + "vein": capture_attribute_2.outputs[1], "Geometry": nodegroup_leaf_rotate_x, }, ) diff --git a/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py b/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py index 2e309ba58..8e2149320 100644 --- a/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py +++ b/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py @@ -448,9 +448,9 @@ def nodegroup_palm_leaf_instance(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Attribute": nodegroup_leaf_gen.outputs["Attribute"], - "Coordinate": capture_attribute.outputs["Attribute"], - "subvein": capture_attribute_1.outputs[2], - "vein": capture_attribute_2.outputs[2], + "Coordinate": capture_attribute.outputs[1], + "subvein": capture_attribute_1.outputs[1], + "vein": capture_attribute_2.outputs[1], "Geometry": nodegroup_leaf_rotate_x, }, ) diff --git a/infinigen/assets/objects/tropic_plants/palm_tree.py b/infinigen/assets/objects/tropic_plants/palm_tree.py index 8ab0f5146..6ca1f2b23 100644 --- a/infinigen/assets/objects/tropic_plants/palm_tree.py +++ b/infinigen/assets/objects/tropic_plants/palm_tree.py @@ -691,7 +691,7 @@ def nodegroup_tree_cracks(nw: NodeWrangler): multiply = nw.new_node( Nodes.Math, - input_kwargs={0: capture_attribute.outputs[2], 1: uniform(0.1, 0.25)}, + input_kwargs={0: capture_attribute.outputs[1], 1: uniform(0.1, 0.25)}, attrs={"operation": "MULTIPLY"}, ) diff --git a/infinigen/assets/objects/tropic_plants/tropic_plant_utils.py b/infinigen/assets/objects/tropic_plants/tropic_plant_utils.py index f79a31d8a..0e7194320 100644 --- a/infinigen/assets/objects/tropic_plants/tropic_plant_utils.py +++ b/infinigen/assets/objects/tropic_plants/tropic_plant_utils.py @@ -795,7 +795,7 @@ def nodegroup_nodegroup_leaf_gen(nw: NodeWrangler, leaf_contour_control_points=N Nodes.GroupOutput, input_kwargs={ "Mesh": set_position_1, - "Attribute": capture_attribute.outputs[2], + "Attribute": capture_attribute.outputs[1], "X Modulated": nodegroup_midrib.outputs["X Modulated"], "Vein Coord": nodegroup_vein_coord_001, "Vein Value": nodegroup_apply_vein_midrib, diff --git a/infinigen/assets/objects/windows/window.py b/infinigen/assets/objects/windows/window.py index a5196046b..8f38b7c82 100644 --- a/infinigen/assets/objects/windows/window.py +++ b/infinigen/assets/objects/windows/window.py @@ -1087,8 +1087,8 @@ def nodegroup_curtain(nw: NodeWrangler): combine_xyz_12 = nw.new_node( Nodes.CombineXYZ, input_kwargs={ - "X": capture_attribute_1.outputs[2], - "Y": capture_attribute.outputs[2], + "X": capture_attribute_1.outputs[1], + "Y": capture_attribute.outputs[1], }, ) diff --git a/infinigen/assets/utils/nodegroups/hair.py b/infinigen/assets/utils/nodegroups/hair.py index 149b778e0..3951fa050 100644 --- a/infinigen/assets/utils/nodegroups/hair.py +++ b/infinigen/assets/utils/nodegroups/hair.py @@ -404,7 +404,7 @@ def nodegroup_duplicate_to_clumps(nw: NodeWrangler): scale_1 = nw.new_node( Nodes.VectorMath, input_kwargs={ - 0: capture_attribute.outputs["Attribute"], + 0: capture_attribute.outputs[1], "Scale": map_range.outputs["Result"], }, attrs={"operation": "SCALE"}, @@ -459,7 +459,7 @@ def nodegroup_hair_length_rescale(nw: NodeWrangler): Nodes.VectorMath, input_kwargs={ 0: hairposition.outputs["Relative Position"], - 1: capture_attribute.outputs[2], + 1: capture_attribute.outputs[1], 2: hairposition.outputs["Root Position"], }, attrs={"operation": "MULTIPLY_ADD"}, diff --git a/infinigen/core/nodes/compatibility.py b/infinigen/core/nodes/compatibility.py index f8e1c7a3e..34c1c5afb 100644 --- a/infinigen/core/nodes/compatibility.py +++ b/infinigen/core/nodes/compatibility.py @@ -7,7 +7,11 @@ import logging from collections import OrderedDict -from .node_info import DATATYPE_FIELDS, NODETYPE_TO_DATATYPE, Nodes +from .node_info import ( + NODECLASS_TO_DATATYPE, + Nodes, +) +from .utils import infer_output_socket logger = logging.getLogger(__name__) @@ -151,23 +155,55 @@ def compat_musgrave_texture(nw, orig_type, input_args, attrs, input_kwargs): def compat_capture_attribute(nw, orig_type, input_args, attrs, input_kwargs): - types = ["VECTOR", "VALUE", "RGBA", "BOOLEAN", "INT"] - data_type = None + if "Geometry" in input_kwargs: + geometry = input_kwargs.pop("Geometry") + elif len(input_args) >= 1: + geometry = input_args.pop(0) + else: + raise ValueError( + f"Geometry is not given for {orig_type=} and {input_args=} and {input_kwargs=}" + ) + if "data_type" in attrs: data_type = attrs.pop("data_type") - if len(input_args) > 1: - j, i = next((j, i) for j, i in enumerate(input_args[1:]) if i is not None) - data_type = NODETYPE_TO_DATATYPE[types[j]] - input_kwargs[DATATYPE_FIELDS[NODETYPE_TO_DATATYPE[types[j]]]] = i + else: + data_type = None + data_types = {} + + inputs = {} + + def get_name(k): + if isinstance(k, int): + if "Attribute" in inputs: + return f"Attribute_{k}" + return "Attribute" + return k + + for k, v in input_kwargs.items(): + k = get_name(k) + inputs[k] = v + data_types[k] = ( + NODECLASS_TO_DATATYPE[infer_output_socket(v).bl_idname] + if data_type is None + else data_type + ) + for k, v in enumerate(input_args): + k += 1 + inputs[k] = v + data_types[k] = ( + NODECLASS_TO_DATATYPE[infer_output_socket(v).bl_idname] + if data_type is None + else data_type + ) node = nw.new_node( node_type=orig_type, - input_args=[], + input_args=[geometry], attrs=attrs, - input_kwargs=input_kwargs, + input_kwargs=inputs, compat_mode=False, ) - if data_type is not None: - node.capture_items[0].data_type = data_type + for i, d in enumerate(data_types.values()): + node.capture_items[i].data_type = d return node From 58f1ccc842da89c90f46e9fd97ea0db896482733 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Wed, 11 Sep 2024 15:53:23 -0400 Subject: [PATCH 05/15] + Fix rotation euler + Deprecate NodeSocketFloatAngle, NodeSocketIntUnsigned, NodeSocketVectorXYZ, NodeSocketVectorTranslation + Fix AccumulateField outputs, + Fix Switch inputs + Change ShaderNodeBsdfVelvet + Fix leaf v2 + Remove Transmission Roughness + Fix EvaluatedAtIndex + Change import and export operations, fix usdc operations --- .../materials/beverage_fridge_shaders.py | 2 +- .../materials/fabrics/general_fabric.py | 6 +- infinigen/assets/materials/fabrics/velvet.py | 2 +- infinigen/assets/materials/lamp_shaders.py | 1 - infinigen/assets/materials/succulent.py | 6 +- infinigen/assets/materials/text.py | 2 +- infinigen/assets/materials/tiles/utils.py | 2 +- .../objects/appliances/beverage_fridge.py | 30 ++++---- .../assets/objects/appliances/dishwasher.py | 30 ++++---- .../assets/objects/appliances/microwave.py | 6 +- infinigen/assets/objects/appliances/oven.py | 32 ++++---- infinigen/assets/objects/cactus/spike.py | 2 +- infinigen/assets/objects/corals/tentacles.py | 2 +- .../insects/parts/hair/principled_hair.py | 2 +- .../insects/parts/leg/dragonfly_leg.py | 2 +- .../insects/parts/tail/dragonfly_tail.py | 6 +- .../creatures/insects/utils/geom_utils.py | 50 ++++++------- .../objects/creatures/parts/chameleon.py | 74 +++++++++---------- .../assets/objects/creatures/parts/eye.py | 6 +- .../assets/objects/creatures/parts/eye_new.py | 62 +++++++--------- .../assets/objects/creatures/parts/head.py | 8 +- .../objects/creatures/parts/head_detail.py | 2 +- .../objects/creatures/parts/ridged_fin.py | 14 +++- .../assets/objects/creatures/parts/wings.py | 4 +- .../objects/creatures/util/cloth_sim.py | 3 +- .../objects/creatures/util/part_util.py | 4 +- .../assets/objects/fruits/fruit_utils.py | 24 +++--- infinigen/assets/objects/fruits/seed_lib.py | 2 +- infinigen/assets/objects/fruits/stem_lib.py | 46 ++++++------ .../assets/objects/grassland/dandelion.py | 8 +- infinigen/assets/objects/grassland/flower.py | 2 +- .../objects/lamp/ceiling_classic_lamp.py | 3 +- infinigen/assets/objects/lamp/lamp.py | 6 +- infinigen/assets/objects/leaves/leaf_ginko.py | 2 +- infinigen/assets/objects/leaves/leaf_maple.py | 6 +- infinigen/assets/objects/leaves/leaf_pine.py | 4 +- infinigen/assets/objects/leaves/leaf_v2.py | 1 - infinigen/assets/objects/monocot/growth.py | 4 +- infinigen/assets/objects/seating/mattress.py | 2 +- infinigen/assets/objects/seating/sofa.py | 62 ++++++++-------- .../assets/objects/shelves/triangle_shelf.py | 3 +- infinigen/assets/objects/shelves/utils.py | 4 +- infinigen/assets/objects/small_plants/fern.py | 12 +-- .../assets/objects/small_plants/succulent.py | 2 +- .../assets/objects/table_decorations/sink.py | 54 +++++++------- .../assets/objects/table_decorations/utils.py | 54 +++++++------- .../assets/objects/tables/cocktail_table.py | 6 +- infinigen/assets/objects/tables/lofting.py | 34 +++++---- .../assets/objects/tables/table_utils.py | 32 ++++---- infinigen/assets/objects/trees/tree_flower.py | 2 +- .../objects/trees/utils/geometrynodes.py | 14 ++-- .../assets/objects/trees/utils/materials.py | 12 +-- .../objects/tropic_plants/leaf_banana_tree.py | 2 +- .../objects/tropic_plants/leaf_palm_plant.py | 2 +- .../objects/tropic_plants/leaf_palm_tree.py | 2 +- .../wall_decorations/skirting_board.py | 6 +- infinigen/assets/objects/windows/window.py | 24 +++--- infinigen/assets/scatters/snow_layer.py | 2 +- infinigen/assets/scatters/utils/cluster.py | 2 +- infinigen/assets/scatters/utils/wind.py | 2 +- .../assets/utils/extract_nodegroup_parts.py | 6 +- infinigen/assets/utils/nodegroups/attach.py | 20 +++-- infinigen/assets/utils/nodegroups/curve.py | 10 +-- infinigen/assets/utils/nodegroups/geometry.py | 2 +- infinigen/assets/utils/nodegroups/math.py | 24 +++--- .../assets/utils/nodegroups/sculpt_v1.py | 10 +-- infinigen/core/init.py | 35 ++++----- infinigen/core/nodes/node_info.py | 8 ++ infinigen/core/nodes/node_wrangler.py | 4 +- infinigen/core/placement/instance_scatter.py | 2 +- infinigen/core/util/blender.py | 18 +++-- infinigen/infinigen_gpl | 2 +- infinigen/tools/export.py | 2 +- .../generate_individual_assets.py | 2 +- tests/assets/test_meshes_basic.py | 2 + tests/assets/test_scatters_basic.py | 2 + tests/tools/test_export.py | 2 + 77 files changed, 475 insertions(+), 479 deletions(-) diff --git a/infinigen/assets/materials/beverage_fridge_shaders.py b/infinigen/assets/materials/beverage_fridge_shaders.py index d56966c67..cc61521ae 100644 --- a/infinigen/assets/materials/beverage_fridge_shaders.py +++ b/infinigen/assets/materials/beverage_fridge_shaders.py @@ -74,7 +74,7 @@ def shader_white_metal_001(nw: NodeWrangler): "Roughness": 0.1000, "Anisotropic": 0.9182, "Sheen Weight": 0.0455, - "Sheen Tint": 0.4948, + "Sheen Tint": (0, 0, 0, 0.4948), }, attrs={"subsurface_method": "BURLEY"}, ) diff --git a/infinigen/assets/materials/fabrics/general_fabric.py b/infinigen/assets/materials/fabrics/general_fabric.py index d8ac97a23..938a44489 100644 --- a/infinigen/assets/materials/fabrics/general_fabric.py +++ b/infinigen/assets/materials/fabrics/general_fabric.py @@ -63,7 +63,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): mix = nw.new_node( Nodes.Mix, - input_kwargs={6: map_range.outputs["Result"], 7: map_range_1.outputs["Result"]}, + input_kwargs={1: map_range.outputs["Result"], 2: map_range_1.outputs["Result"]}, attrs={"data_type": "RGBA"}, ) @@ -130,7 +130,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): mix_4 = nw.new_node( Nodes.Mix, - input_kwargs={0: less_than, 6: mix_2.outputs[2], 7: group_input["Color1"]}, + input_kwargs={0: less_than, 1: mix_2.outputs[2], 2: group_input["Color1"]}, attrs={"data_type": "RGBA"}, ) @@ -175,7 +175,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): mix_1 = nw.new_node( Nodes.Mix, - input_kwargs={6: musgrave_texture, 7: mix.outputs[2]}, + input_kwargs={1: musgrave_texture, 2: mix.outputs[2]}, attrs={"data_type": "RGBA"}, ) diff --git a/infinigen/assets/materials/fabrics/velvet.py b/infinigen/assets/materials/fabrics/velvet.py index 22bf81978..1f7c2739a 100644 --- a/infinigen/assets/materials/fabrics/velvet.py +++ b/infinigen/assets/materials/fabrics/velvet.py @@ -28,7 +28,7 @@ def shader_velvet(nw: NodeWrangler, **kwargs): mix_6 = nw.new_node( Nodes.Mix, - input_kwargs={0: 0.1125, 6: voronoi_texture.outputs["Color"]}, + input_kwargs={0: 0.1125, 1: voronoi_texture.outputs["Color"]}, attrs={"data_type": "RGBA"}, ) diff --git a/infinigen/assets/materials/lamp_shaders.py b/infinigen/assets/materials/lamp_shaders.py index 22f389736..e99ce2f67 100644 --- a/infinigen/assets/materials/lamp_shaders.py +++ b/infinigen/assets/materials/lamp_shaders.py @@ -55,7 +55,6 @@ def shader_lampshade(nw: NodeWrangler): "Roughness": U(0.5, 0.8), "IOR": 4.0000, "Transmission Weight": U(0.05, 0.2), - "Transmission Roughness": 1.0000, }, ) diff --git a/infinigen/assets/materials/succulent.py b/infinigen/assets/materials/succulent.py index 7892a6fea..1b210dc96 100644 --- a/infinigen/assets/materials/succulent.py +++ b/infinigen/assets/materials/succulent.py @@ -156,7 +156,6 @@ def shader_pink_transition_succulent(nw: NodeWrangler): "Subsurface Color": colorramp_1.outputs["Color"], "Specular IOR Level": 0.0, "Roughness": 2.0, - "Sheen Tint": 0.0, "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, @@ -233,7 +232,6 @@ def shader_green_succulent(nw: NodeWrangler): "Subsurface Color": colorramp_1.outputs["Color"], "Specular IOR Level": 0.0, "Roughness": 2.0, - "Sheen Tint": 0.0, "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, @@ -310,10 +308,9 @@ def shader_yellow_succulent(nw: NodeWrangler): "Base Color": colorramp_1.outputs["Color"], "Subsurface Weight": 0.01, "Subsurface Radius": (1.0, 1.0, 1.0), - "Subsurface Color": colorramp_1.outputs["Alpha"], + "Subsurface Color": nw.combine(*([colorramp_1.outputs["Alpha"]] * 3)), "Specular IOR Level": 0.0, "Roughness": 2.0, - "Sheen Tint": 0.0, "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, @@ -406,7 +403,6 @@ def shader_whitish_green_succulent(nw: NodeWrangler): "Subsurface Color": colorramp.outputs["Color"], "Specular IOR Level": 0.0, "Roughness": 2.0, - "Sheen Tint": 0.0, "Coat Roughness": 0.0, "IOR": 1.3, "Emission Strength": 0.0, diff --git a/infinigen/assets/materials/text.py b/infinigen/assets/materials/text.py index d6f03aa53..011b096e1 100644 --- a/infinigen/assets/materials/text.py +++ b/infinigen/assets/materials/text.py @@ -434,7 +434,7 @@ def shader_text(nw: NodeWrangler, **kwargs): "Roughness": roughness, "Metallic": uniform(0, 0.5), "Specular IOR Level": uniform(0, 0.2), - "Emission": emission, + "Emission Color": emission, "Emission Strength": self.emission, }, ) diff --git a/infinigen/assets/materials/tiles/utils.py b/infinigen/assets/materials/tiles/utils.py index 61e1617e7..93f952ae2 100644 --- a/infinigen/assets/materials/tiles/utils.py +++ b/infinigen/assets/materials/tiles/utils.py @@ -59,7 +59,7 @@ def nodegroup_u_v_recenter(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "UV", (0.0000, 0.0000, 0.0000)), ("NodeSocketVector", "HalfSize", (0.0000, 0.0000, 0.0000)), - ("NodeSocketFloatAngle", "Rot Angle", 0.0000), + ("NodeSocketFloat", "Rot Angle", 0.0000), ], ) diff --git a/infinigen/assets/objects/appliances/beverage_fridge.py b/infinigen/assets/objects/appliances/beverage_fridge.py index 39ac14b7a..d5835c8f6 100644 --- a/infinigen/assets/objects/appliances/beverage_fridge.py +++ b/infinigen/assets/objects/appliances/beverage_fridge.py @@ -273,7 +273,7 @@ def nodegroup_text(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), + ("NodeSocketVector", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), @@ -572,7 +572,7 @@ def nodegroup_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 2), ], @@ -638,7 +638,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 2), ("NodeSocketFloat", "Thickness", 0.0000), @@ -750,7 +750,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_2 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch3"], 14: transform_2} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch3"], 1: transform_2} ) subtract_3 = nw.new_node( @@ -817,7 +817,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_1 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch2"], 14: transform_1} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch2"], 1: transform_1} ) subtract_5 = nw.new_node( @@ -879,7 +879,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch1"], 14: transform} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch1"], 1: transform} ) subtract_6 = nw.new_node( @@ -953,7 +953,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_3 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch4"], 14: transform_3} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch4"], 1: transform_3} ) combine_xyz_9 = nw.new_node( @@ -1012,7 +1012,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_4 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch5"], 14: transform_4} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch5"], 1: transform_4} ) combine_xyz_10 = nw.new_node( @@ -1073,19 +1073,19 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_5 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch6"], 14: transform_5} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch6"], 1: transform_5} ) join_geometry = nw.new_node( Nodes.JoinGeometry, input_kwargs={ "Geometry": [ - switch_2.outputs[6], - switch_1.outputs[6], - switch.outputs[6], - switch_3.outputs[6], - switch_4.outputs[6], - switch_5.outputs[6], + switch_2, + switch_1, + switch, + switch_3, + switch_4, + switch_5, ] }, ) diff --git a/infinigen/assets/objects/appliances/dishwasher.py b/infinigen/assets/objects/appliances/dishwasher.py index cba6d0966..0ee5aeb87 100644 --- a/infinigen/assets/objects/appliances/dishwasher.py +++ b/infinigen/assets/objects/appliances/dishwasher.py @@ -342,7 +342,7 @@ def nodegroup_text(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), + ("NodeSocketVector", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), @@ -641,7 +641,7 @@ def nodegroup_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 2), ], @@ -707,7 +707,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 2), ("NodeSocketFloat", "Thickness", 0.0000), @@ -819,7 +819,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_2 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch3"], 14: transform_2} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch3"], 2: transform_2} ) subtract_3 = nw.new_node( @@ -886,7 +886,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_1 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch2"], 14: transform_1} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch2"], 1: transform_1} ) subtract_5 = nw.new_node( @@ -948,7 +948,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch1"], 14: transform} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch1"], 1: transform} ) subtract_6 = nw.new_node( @@ -1022,7 +1022,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_3 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch4"], 14: transform_3} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch4"], 1: transform_3} ) combine_xyz_9 = nw.new_node( @@ -1081,7 +1081,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_4 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch5"], 14: transform_4} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch5"], 1: transform_4} ) combine_xyz_10 = nw.new_node( @@ -1142,19 +1142,19 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_5 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch6"], 14: transform_5} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch6"], 1: transform_5} ) join_geometry = nw.new_node( Nodes.JoinGeometry, input_kwargs={ "Geometry": [ - switch_2.outputs[6], - switch_1.outputs[6], - switch.outputs[6], - switch_3.outputs[6], - switch_4.outputs[6], - switch_5.outputs[6], + switch_2, + switch_1, + switch, + switch_3, + switch_4, + switch_5, ] }, ) diff --git a/infinigen/assets/objects/appliances/microwave.py b/infinigen/assets/objects/appliances/microwave.py index 859d2ad6c..b84f9d5cf 100644 --- a/infinigen/assets/objects/appliances/microwave.py +++ b/infinigen/assets/objects/appliances/microwave.py @@ -139,7 +139,7 @@ def nodegroup_plate(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, - expose_input=[("NodeSocketVectorXYZ", "Scale", (1.0000, 1.0000, 1.0000))], + expose_input=[("NodeSocketVector", "Scale", (1.0000, 1.0000, 1.0000))], ) transform_1 = nw.new_node( @@ -161,7 +161,7 @@ def nodegroup_text(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), + ("NodeSocketVector", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), @@ -324,7 +324,7 @@ def nodegroup_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 10), ], diff --git a/infinigen/assets/objects/appliances/oven.py b/infinigen/assets/objects/appliances/oven.py index df0364147..c27acc7ac 100644 --- a/infinigen/assets/objects/appliances/oven.py +++ b/infinigen/assets/objects/appliances/oven.py @@ -369,7 +369,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 2), ("NodeSocketFloat", "Thickness", 0.0000), @@ -481,7 +481,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_2 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch3"], 14: transform_2} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch3"], 1: transform_2} ) subtract_3 = nw.new_node( @@ -548,7 +548,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_1 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch2"], 14: transform_1} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch2"], 1: transform_1} ) subtract_5 = nw.new_node( @@ -610,7 +610,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch1"], 14: transform} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch1"], 1: transform} ) subtract_6 = nw.new_node( @@ -684,7 +684,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_3 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch4"], 14: transform_3} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch4"], 1: transform_3} ) combine_xyz_9 = nw.new_node( @@ -743,7 +743,7 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_4 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch5"], 14: transform_4} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch5"], 1: transform_4} ) combine_xyz_10 = nw.new_node( @@ -804,19 +804,19 @@ def nodegroup_hollow_cube(nw: NodeWrangler): ) switch_5 = nw.new_node( - Nodes.Switch, input_kwargs={1: group_input.outputs["Switch6"], 14: transform_5} + Nodes.Switch, input_kwargs={0: group_input.outputs["Switch6"], 1: transform_5} ) join_geometry = nw.new_node( Nodes.JoinGeometry, input_kwargs={ "Geometry": [ - switch_2.outputs[6], - switch_1.outputs[6], - switch.outputs[6], - switch_3.outputs[6], - switch_4.outputs[6], - switch_5.outputs[6], + switch_2, + switch_1, + switch, + switch_3, + switch_4, + switch_5, ] }, ) @@ -878,7 +878,7 @@ def nodegroup_heater(nw: NodeWrangler): ("NodeSocketFloat", "depth", 0.0000), ("NodeSocketFloat", "radius_ratio", 0.2000), ("NodeSocketFloat", "arrangement_ratio", 0.5000), - ("NodeSocketShader", "SuperBlackGlass", None), + ("NodeSocketMaterial", "SuperBlackGlass", None), ], ) @@ -1180,7 +1180,7 @@ def nodegroup_text(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Translation", (1.5000, 0.0000, 0.0000)), + ("NodeSocketVector", "Translation", (1.5000, 0.0000, 0.0000)), ("NodeSocketString", "String", "BrandName"), ("NodeSocketFloat", "Size", 0.0500), ("NodeSocketFloat", "Offset Scale", 0.0020), @@ -1479,7 +1479,7 @@ def nodegroup_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Size", (0.1000, 10.0000, 4.0000)), + ("NodeSocketVector", "Size", (0.1000, 10.0000, 4.0000)), ("NodeSocketVector", "Pos", (0.0000, 0.0000, 0.0000)), ("NodeSocketInt", "Resolution", 2), ], diff --git a/infinigen/assets/objects/cactus/spike.py b/infinigen/assets/objects/cactus/spike.py index 94efd0214..4d0f9511d 100644 --- a/infinigen/assets/objects/cactus/spike.py +++ b/infinigen/assets/objects/cactus/spike.py @@ -94,7 +94,7 @@ def geo_spikes(nw: NodeWrangler, spikes, points_fn=None, realize=True): rotation = nw.new_node( Nodes.RotateEuler, input_kwargs={"Rotation": rotation, "Angle": nw.uniform(0, 2 * np.pi)}, - attrs={"type": "AXIS_ANGLE", "space": "LOCAL"}, + attrs={"rotation_type": "AXIS_ANGLE", "space": "LOCAL"}, ) rotation = nw.new_node( Nodes.AlignEulerToVector, [rotation, nw.uniform(0.2, 0.5)], attrs={"axis": "Z"} diff --git a/infinigen/assets/objects/corals/tentacles.py b/infinigen/assets/objects/corals/tentacles.py index 056fa7712..decde2057 100644 --- a/infinigen/assets/objects/corals/tentacles.py +++ b/infinigen/assets/objects/corals/tentacles.py @@ -101,7 +101,7 @@ def geo_tentacles( rotation = nw.new_node( Nodes.RotateEuler, input_kwargs={"Rotation": rotation, "Angle": nw.uniform(0, 2 * np.pi)}, - attrs={"type": "AXIS_ANGLE", "space": "LOCAL"}, + attrs={"rotation_type": "AXIS_ANGLE", "space": "LOCAL"}, ) points = surface.eval_argument(nw, points_fn, points=points, normal=normal) diff --git a/infinigen/assets/objects/creatures/insects/parts/hair/principled_hair.py b/infinigen/assets/objects/creatures/insects/parts/hair/principled_hair.py index f3d8ac645..b95ba8f1b 100644 --- a/infinigen/assets/objects/creatures/insects/parts/hair/principled_hair.py +++ b/infinigen/assets/objects/creatures/insects/parts/hair/principled_hair.py @@ -19,7 +19,7 @@ def nodegroup_principled_hair(nw: NodeWrangler): # Code generated using version 2.4.3 of the node_transpiler group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketIntUnsigned", "Resolution", 4)] + Nodes.GroupInput, expose_input=[("NodeSocketInt", "Resolution", 4)] ) crosssection = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py b/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py index 813a5c9b5..1d679daef 100644 --- a/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py +++ b/infinigen/assets/objects/creatures/insects/parts/leg/dragonfly_leg.py @@ -323,7 +323,7 @@ def nodegroup_leg_cross_section(nw: NodeWrangler): # Code generated using version 2.4.3 of the node_transpiler group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketIntUnsigned", "Resolution", 8)] + Nodes.GroupInput, expose_input=[("NodeSocketInt", "Resolution", 8)] ) bezier_segment = nw.new_node( diff --git a/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py b/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py index 27a670fa9..ddb7a0124 100644 --- a/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py +++ b/infinigen/assets/objects/creatures/insects/parts/tail/dragonfly_tail.py @@ -175,9 +175,9 @@ def nodegroup_dragonfly_tail( group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "Middle", (1.84, 0.0, 0.14)), - ("NodeSocketVectorTranslation", "End", (3.14, 0.0, -0.32)), + ("NodeSocketVector", "Start", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Middle", (1.84, 0.0, 0.14)), + ("NodeSocketVector", "End", (3.14, 0.0, -0.32)), ("NodeSocketFloat", "Segment Length", 0.44), ("NodeSocketFloat", "Segment Scale", 0.25), ("NodeSocketFloat", "Random Seed", 3.2), diff --git a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py index ff8af30a7..5c286324b 100644 --- a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py +++ b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py @@ -20,7 +20,7 @@ def nodegroup_symmetric_clone(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, -1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, -1.0, 1.0)), ], ) @@ -262,7 +262,7 @@ def nodegroup_instance_on_points(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "rotation base", (0.0, 0.0, 0.0)), ("NodeSocketVector", "rotation delta", (-1.5708, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "translation", (0.0, -0.5, 0.0)), + ("NodeSocketVector", "translation", (0.0, -0.5, 0.0)), ("NodeSocketFloat", "scale", 0.0), ("NodeSocketGeometry", "Points", None), ("NodeSocketGeometry", "Instance", None), @@ -624,8 +624,8 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Normal Rot"], - 8: group_input.outputs["Rotation"], - 9: rotate_euler, + 1: group_input.outputs["Rotation"], + 2: rotate_euler, }, label="if_normal_rot", attrs={"input_type": "VECTOR"}, @@ -652,8 +652,8 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Tangent Rot"], - 8: if_normal_rot.outputs[3], - 9: rotate_euler_1, + 1: if_normal_rot.outputs[3], + 2: rotate_euler_1, }, label="if_tangent_rot", attrs={"input_type": "VECTOR"}, @@ -749,10 +749,10 @@ def nodegroup_shape_quadratic( ("NodeSocketFloat", "random seed pos", 0.0), ("NodeSocketFloat", "noise scale pos", 0.0), ("NodeSocketFloat", "noise amount pos", 0.0), - ("NodeSocketIntUnsigned", "Resolution", 256), - ("NodeSocketVectorTranslation", "Start", (0.0, 0.15, -1.5)), - ("NodeSocketVectorTranslation", "Middle", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "End", (0.0, 0.0, 1.5)), + ("NodeSocketInt", "Resolution", 256), + ("NodeSocketVector", "Start", (0.0, 0.15, -1.5)), + ("NodeSocketVector", "Middle", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "End", (0.0, 0.0, 1.5)), ], ) @@ -993,8 +993,8 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_1, - 8: group_input.outputs["Arg == 0"], - 9: group_input.outputs["Arg == 1"], + 1: group_input.outputs["Arg == 0"], + 2: group_input.outputs["Arg == 1"], }, attrs={"input_type": "VECTOR"}, ) @@ -1009,21 +1009,19 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_2, - 8: group_input.outputs["Arg == 2"], - 9: group_input.outputs["Arg == 3"], + 1: group_input.outputs["Arg == 2"], + 2: group_input.outputs["Arg == 3"], }, attrs={"input_type": "VECTOR"}, ) switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_equal, 8: switch_1.outputs[3], 9: switch_2.outputs[3]}, + input_kwargs={0: greater_equal, 1: switch_1, 2: switch_2}, attrs={"input_type": "VECTOR"}, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Output": switch.outputs[3]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"Output": switch}) @node_utils.to_nodegroup( @@ -1111,13 +1109,11 @@ def nodegroup_aspect_to_dim(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_than, 8: combine_xyz_1, 9: combine_xyz_2}, + input_kwargs={0: greater_than, 1: combine_xyz_1, 2: combine_xyz_2}, attrs={"input_type": "VECTOR"}, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"XY Scale": switch.outputs[3]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"XY Scale": switch}) @node_utils.to_nodegroup( @@ -1186,7 +1182,7 @@ def nodegroup_polar_bezier(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 32), + ("NodeSocketInt", "Resolution", 32), ("NodeSocketVector", "Origin", (0.0, 0.0, 0.0)), ("NodeSocketVector", "angles_deg", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Seg Lengths", (0.3, 0.3, 0.3)), @@ -1302,15 +1298,15 @@ def nodegroup_polar_bezier(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Do Bezier"], - 14: subdivide_curve_1, - 15: subdivide_curve, + 0: group_input.outputs["Do Bezier"], + 1: subdivide_curve_1, + 2: subdivide_curve, }, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Curve": switch.outputs[6], "Endpoint": polartocart_2}, + input_kwargs={"Curve": switch, "Endpoint": polartocart_2}, ) diff --git a/infinigen/assets/objects/creatures/parts/chameleon.py b/infinigen/assets/objects/creatures/parts/chameleon.py index 7718a07b9..e2063289e 100644 --- a/infinigen/assets/objects/creatures/parts/chameleon.py +++ b/infinigen/assets/objects/creatures/parts/chameleon.py @@ -167,13 +167,13 @@ def nodegroup_clamp_or_wrap(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={0: group_input.outputs["Use Wrap"], 4: clamp, 5: wrap}, + input_kwargs={0: group_input.outputs["Use Wrap"], 1: clamp, 2: wrap}, attrs={"input_type": "INT"}, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Output": switch.outputs[1]}, + input_kwargs={"Output": switch}, attrs={"is_active_output": True}, ) @@ -295,7 +295,7 @@ def nodegroup_chameleon_claw_shape(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "Rotation", (0.0000, 1.0472, 0.0000)), - ("NodeSocketVectorXYZ", "Scale", (0.2000, 0.2000, 0.4000)), + ("NodeSocketVector", "Scale", (0.2000, 0.2000, 0.4000)), ], ) @@ -385,8 +385,8 @@ def nodegroup_chameleon_foot_shape(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "ouRotation", (0.0000, 1.0472, 0.0000)), ("NodeSocketVector", "inRotation", (0.0000, 2.0944, 3.1416)), - ("NodeSocketVectorXYZ", "ouScale", (1.0000, 1.0000, 1.0000)), - ("NodeSocketVectorXYZ", "inScale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "ouScale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "inScale", (1.0000, 1.0000, 1.0000)), ], ) @@ -665,8 +665,8 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_1, - 8: group_input.outputs["Arg == 0"], - 9: group_input.outputs["Arg == 1"], + 1: group_input.outputs["Arg == 0"], + 2: group_input.outputs["Arg == 1"], }, attrs={"input_type": "VECTOR"}, ) @@ -681,21 +681,21 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_2, - 8: group_input.outputs["Arg == 2"], - 9: group_input.outputs["Arg == 3"], + 1: group_input.outputs["Arg == 2"], + 2: group_input.outputs["Arg == 3"], }, attrs={"input_type": "VECTOR"}, ) switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_equal, 8: switch_1.outputs[3], 9: switch_2.outputs[3]}, + input_kwargs={0: greater_equal, 1: switch_1, 2: switch_2}, attrs={"input_type": "VECTOR"}, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Output": switch.outputs[3]}, + input_kwargs={"Output": switch}, attrs={"is_active_output": True}, ) @@ -710,7 +710,7 @@ def nodegroup_symmetric_clone(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketVectorXYZ", "Scale", (1.0000, -1.0000, 1.0000)), + ("NodeSocketVector", "Scale", (1.0000, -1.0000, 1.0000)), ], ) @@ -874,10 +874,10 @@ def nodegroup_chameleon_leg_raw_shape(nw: NodeWrangler): ("NodeSocketFloat", "calf_body_rotation", 0.5000), ("NodeSocketFloat", "thigh_calf_rotation", 20.0000), ("NodeSocketFloat", "toe_toe_rotation", 20.0000), - ("NodeSocketVectorXYZ", "thigh_scale", (1.0000, 0.6500, 1.0000)), - ("NodeSocketVectorXYZ", "calf_scale", (1.0000, 0.6500, 1.0000)), - ("NodeSocketVectorXYZ", "ouScale", (1.0000, 1.0000, 1.0000)), - ("NodeSocketVectorXYZ", "inScale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "thigh_scale", (1.0000, 0.6500, 1.0000)), + ("NodeSocketVector", "calf_scale", (1.0000, 0.6500, 1.0000)), + ("NodeSocketVector", "ouScale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "inScale", (1.0000, 1.0000, 1.0000)), ], ) @@ -1662,7 +1662,7 @@ def nodegroup_polar_bezier(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 32), + ("NodeSocketInt", "Resolution", 32), ("NodeSocketVector", "Origin", (0.0000, 0.0000, 0.0000)), ("NodeSocketVector", "angles_deg", (0.0000, 0.0000, 0.0000)), ("NodeSocketVector", "Seg Lengths", (0.3000, 0.3000, 0.3000)), @@ -1774,15 +1774,15 @@ def nodegroup_polar_bezier(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Do Bezier"], - 14: subdivide_curve_1, - 15: subdivide_curve, + 0: group_input.outputs["Do Bezier"], + 1: subdivide_curve_1, + 2: subdivide_curve, }, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Curve": switch.outputs[6], "Endpoint": polartocart_2}, + input_kwargs={"Curve": switch, "Endpoint": polartocart_2}, attrs={"is_active_output": True}, ) @@ -1901,15 +1901,13 @@ def nodegroup_curve_sculpt(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input_1.outputs["SymmY"], - 14: group_input_1.outputs["Curve"], - 15: symmetric_clone.outputs["Both"], + 0: group_input_1.outputs["SymmY"], + 1: group_input_1.outputs["Curve"], + 2: symmetric_clone.outputs["Both"], }, ) - curve_to_mesh = nw.new_node( - Nodes.CurveToMesh, input_kwargs={"Curve": switch.outputs[6]} - ) + curve_to_mesh = nw.new_node(Nodes.CurveToMesh, input_kwargs={"Curve": switch}) geometry_proximity = nw.new_node( Nodes.Proximity, @@ -2028,16 +2026,16 @@ def nodegroup_curve_sculpt(nw: NodeWrangler): switch_3 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input_1.outputs["Attr"], - 14: set_position, - 15: store_named_attribute, + 0: group_input_1.outputs["Attr"], + 1: set_position, + 2: store_named_attribute, }, ) group_output = nw.new_node( Nodes.GroupOutput, input_kwargs={ - "Geometry": switch_3.outputs[6], + "Geometry": switch_3, "Result": switch_2.outputs["Output"], }, attrs={"is_active_output": True}, @@ -2390,10 +2388,10 @@ def nodegroup_chameleon_leg_shape(nw: NodeWrangler): ("NodeSocketFloat", "calf_body_rotation", 15.0000), ("NodeSocketFloat", "thigh_calf_rotation", 20.0000), ("NodeSocketFloat", "toe_toe_rotation", 20.0000), - ("NodeSocketVectorXYZ", "thigh_scale", (1.0000, 0.6500, 1.0000)), - ("NodeSocketVectorXYZ", "calf_scale", (1.0000, 0.6500, 1.0000)), - ("NodeSocketVectorXYZ", "ouScale", (1.0000, 1.0000, 1.0000)), - ("NodeSocketVectorXYZ", "inScale", (0.6000, 1.0000, 1.0000)), + ("NodeSocketVector", "thigh_scale", (1.0000, 0.6500, 1.0000)), + ("NodeSocketVector", "calf_scale", (1.0000, 0.6500, 1.0000)), + ("NodeSocketVector", "ouScale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "inScale", (0.6000, 1.0000, 1.0000)), ], ) @@ -2527,7 +2525,7 @@ def nodegroup_chameleon_body_shape(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorXYZ", "Scale", (0.9000, 0.7000, 0.8000)), + ("NodeSocketVector", "Scale", (0.9000, 0.7000, 0.8000)), ("NodeSocketFloat", "length", 1.4000), ], ) @@ -2645,7 +2643,7 @@ def nodegroup_chameleon_head_shape(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "Crown", 0.2000), ("NodeSocketFloat", "EyeBrow", 0.0200), - ("NodeSocketVectorXYZ", "Scale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "Scale", (1.0000, 1.0000, 1.0000)), ], ) @@ -3503,7 +3501,7 @@ def nodegroup_chameleon(nw: NodeWrangler): ("NodeSocketFloat", "body_length", 1.4000), ("NodeSocketFloat", "head_crown", 0.2000), ("NodeSocketFloat", "head_eyebrow", 0.0200), - ("NodeSocketVectorXYZ", "head_scale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "head_scale", (1.0000, 1.0000, 1.0000)), ("NodeSocketVector", "left_eye_rotation", (0.0000, 0.0000, -1.5)), ("NodeSocketVector", "right_eye_rotation", (0.0000, 0.0000, 1.5)), ("NodeSocketFloat", "pupil_radius", 0.2200), diff --git a/infinigen/assets/objects/creatures/parts/eye.py b/infinigen/assets/objects/creatures/parts/eye.py index 040dc97b2..0054049d4 100644 --- a/infinigen/assets/objects/creatures/parts/eye.py +++ b/infinigen/assets/objects/creatures/parts/eye.py @@ -36,7 +36,7 @@ def nodegroup_eyelid(nw: NodeWrangler): ("NodeSocketVector", "EyelidEndCoord", (0.0, 1.5, 0.29999999999999999)), ("NodeSocketFloat", "StartRadPct", 0.5), ("NodeSocketFloat", "EndRadPct", 0.5), - ("NodeSocketFloatAngle", "Tilt", -0.34910000000000002), + ("NodeSocketFloat", "Tilt", -0.34910000000000002), ], ) @@ -186,7 +186,7 @@ def nodegroup_mammal_eye(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Eyelids"], 15: join_geometry}, + input_kwargs={0: group_input.outputs["Eyelids"], 2: join_geometry}, ) uv_sphere = nw.new_node( @@ -280,7 +280,7 @@ def nodegroup_mammal_eye(nw: NodeWrangler): Nodes.GroupOutput, input_kwargs={ "Geometry": None, - "BodyExtra_Lid": switch.outputs[6], + "BodyExtra_Lid": switch, "Eyeballl": normvec, "ParentCutter": transform_2, }, diff --git a/infinigen/assets/objects/creatures/parts/eye_new.py b/infinigen/assets/objects/creatures/parts/eye_new.py index ef3a507ba..f440b68a0 100644 --- a/infinigen/assets/objects/creatures/parts/eye_new.py +++ b/infinigen/assets/objects/creatures/parts/eye_new.py @@ -922,13 +922,11 @@ def nodegroup_aspect_to_dim(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_than, 8: combine_xyz_1, 9: combine_xyz_2}, + input_kwargs={0: greater_than, 1: combine_xyz_1, 2: combine_xyz_2}, attrs={"input_type": "VECTOR"}, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"XY Scale": switch.outputs[3]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"XY Scale": switch}) @node_utils.to_nodegroup( @@ -1011,8 +1009,8 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_1, - 8: group_input.outputs["Arg == 0"], - 9: group_input.outputs["Arg == 1"], + 1: group_input.outputs["Arg == 0"], + 2: group_input.outputs["Arg == 1"], }, attrs={"input_type": "VECTOR"}, ) @@ -1027,21 +1025,19 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_2, - 8: group_input.outputs["Arg == 2"], - 9: group_input.outputs["Arg == 3"], + 1: group_input.outputs["Arg == 2"], + 2: group_input.outputs["Arg == 3"], }, attrs={"input_type": "VECTOR"}, ) switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_equal, 8: switch_1.outputs[3], 9: switch_2.outputs[3]}, + input_kwargs={0: greater_equal, 1: switch_1, 2: switch_2}, attrs={"input_type": "VECTOR"}, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Output": switch.outputs[3]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"Output": switch}) def shader_eyeball_fish(nw: NodeWrangler, rand=True, **input_kwargs): @@ -1408,7 +1404,7 @@ def nodegroup_eyeball_eyelid_inner(nw: NodeWrangler): "EyeballResolution(White, Cornea)", (0.0000, 0.0000, 0.0000), ), - ("NodeSocketVectorXYZ", "Scale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "Scale", (1.0000, 1.0000, 1.0000)), ], ) @@ -1766,7 +1762,7 @@ def nodegroup_eye_sockets(nw: NodeWrangler): ("NodeSocketGeometry", "Base Mesh", None), ("NodeSocketVector", "Length/Yaw/Rad", (0.5000, 0.0000, 1.0000)), ("NodeSocketVector", "Part Rot", (0.0000, 0.0000, 53.7000)), - ("NodeSocketVectorXYZ", "Scale", (2.0000, 2.0000, 2.0000)), + ("NodeSocketVector", "Scale", (2.0000, 2.0000, 2.0000)), ], ) @@ -1994,13 +1990,13 @@ def nodegroup_surface_muscle(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Debug Points"], 15: join_geometry}, + input_kwargs={0: group_input.outputs["Debug Points"], 2: join_geometry}, ) set_material = nw.new_node( Nodes.SetMaterial, input_kwargs={ - "Geometry": switch.outputs[6], + "Geometry": switch, "Material": surface.shaderfunc_to_material(shader_material), }, ) @@ -2096,11 +2092,9 @@ def nodegroup_surface_muscle(nw: NodeWrangler): Nodes.JoinGeometry, input_kwargs={"Geometry": [set_material, profilepart]} ) - switch_1 = nw.new_node(Nodes.Switch, input_kwargs={1: True, 15: join_geometry_1}) + switch_1 = nw.new_node(Nodes.Switch, input_kwargs={0: True, 2: join_geometry_1}) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Geometry": switch_1.outputs[6]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"Geometry": switch_1}) @node_utils.to_nodegroup( @@ -2318,7 +2312,7 @@ def nodegroup_polar_bezier(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 32), + ("NodeSocketInt", "Resolution", 32), ("NodeSocketVector", "Origin", (0.0, 0.0, 0.0)), ("NodeSocketVector", "angles_deg", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Seg Lengths", (0.3, 0.3, 0.3)), @@ -2434,15 +2428,15 @@ def nodegroup_polar_bezier(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Do Bezier"], - 14: subdivide_curve_1, - 15: subdivide_curve, + 0: group_input.outputs["Do Bezier"], + 1: subdivide_curve_1, + 2: subdivide_curve, }, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Curve": switch.outputs[6], "Endpoint": polartocart_2}, + input_kwargs={"Curve": switch, "Endpoint": polartocart_2}, ) @@ -2601,8 +2595,8 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Normal Rot"], - 8: group_input.outputs["Rotation"], - 9: rotate_euler, + 1: group_input.outputs["Rotation"], + 2: rotate_euler, }, label="if_normal_rot", attrs={"input_type": "VECTOR"}, @@ -2629,8 +2623,8 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Tangent Rot"], - 8: if_normal_rot.outputs[3], - 9: rotate_euler_1, + 1: if_normal_rot.outputs[3], + 2: rotate_euler_1, }, label="if_tangent_rot", attrs={"input_type": "VECTOR"}, @@ -2750,7 +2744,7 @@ def nodegroup_eyeball_eyelid(nw: NodeWrangler): ("NodeSocketVector", "RayDirection", (-1.0000, 0.0000, 0.0000)), ("NodeSocketFloat", "DefaultAppendDistance", -0.0020), ("NodeSocketVector", "EyeSocketRot", (0.0000, 0.0000, 0.0000)), - ("NodeSocketVectorXYZ", "EyelidScale", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "EyelidScale", (1.0000, 1.0000, 1.0000)), ], ) @@ -2854,7 +2848,7 @@ def nodegroup_carnivore__face_structure(nw: NodeWrangler): ("NodeSocketVector", "Skull Length Width1 Width2", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Snout Length Width1 Width2", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Snout Y Scale", 0.62), - ("NodeSocketVectorXYZ", "Nose Bridge Scale", (1.0, 0.35, 0.9)), + ("NodeSocketVector", "Nose Bridge Scale", (1.0, 0.35, 0.9)), ("NodeSocketVector", "Jaw Muscle Middle Coord", (0.24, 0.41, 1.3)), ("NodeSocketVector", "Jaw StartRad, EndRad, Fullness", (0.06, 0.11, 1.5)), ( @@ -3720,7 +3714,7 @@ def nodegroup_symmetric_clone(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, -1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, -1.0, 1.0)), ], ) @@ -3759,7 +3753,7 @@ def nodegroup_cat_nose(nw: NodeWrangler): ("NodeSocketFloat", "Nose Radius", 0.06), ("NodeSocketFloat", "Nostril Size", 0.025), ("NodeSocketFloat", "Crease", 0.008), - ("NodeSocketVectorXYZ", "Scale", (1.2, 1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.2, 1.0, 1.0)), ], ) @@ -3892,7 +3886,7 @@ def nodegroup_carnivore_head(nw: NodeWrangler): ("NodeSocketVector", "snout_length_rad1_rad2", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "Snout Y Scale", 0.62), ("NodeSocketVector", "eye_coord", (0.96, -0.95, 0.79)), - ("NodeSocketVectorXYZ", "Nose Bridge Scale", (1.0, 0.35, 0.9)), + ("NodeSocketVector", "Nose Bridge Scale", (1.0, 0.35, 0.9)), ("NodeSocketVector", "Jaw Muscle Middle Coord", (0.24, 0.41, 1.3)), ("NodeSocketVector", "Jaw StartRad, EndRad, Fullness", (0.06, 0.11, 1.5)), ( diff --git a/infinigen/assets/objects/creatures/parts/head.py b/infinigen/assets/objects/creatures/parts/head.py index cb8ea4797..b63e1de10 100644 --- a/infinigen/assets/objects/creatures/parts/head.py +++ b/infinigen/assets/objects/creatures/parts/head.py @@ -214,7 +214,7 @@ def nodegroup_carnivore_jaw(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, - input_kwargs={1: greater_than, 15: symmetric_clone.outputs["Both"]}, + input_kwargs={0: greater_than, 2: symmetric_clone.outputs["Both"]}, ) greater_than_1 = nw.new_node( @@ -355,12 +355,12 @@ def nodegroup_carnivore_jaw(nw: NodeWrangler): ) switch = nw.new_node( - Nodes.Switch, input_kwargs={1: greater_than_1, 15: realize_instances} + Nodes.Switch, input_kwargs={0: greater_than_1, 2: realize_instances} ) join_geometry_1 = nw.new_node( Nodes.JoinGeometry, - input_kwargs={"Geometry": [switch_1.outputs[6], switch.outputs[6]]}, + input_kwargs={"Geometry": [switch_1, switch]}, ) resample_curve = nw.new_node( @@ -473,7 +473,7 @@ def nodegroup_carnivore_head(nw: NodeWrangler): ("NodeSocketVector", "length_rad1_rad2", (0.0, 0.0, 0.0)), ("NodeSocketVector", "snout_length_rad1_rad2", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "snout_y_scale", 0.62), - ("NodeSocketVectorXYZ", "Nose Bridge Scale", (1.0, 0.35, 0.9)), + ("NodeSocketVector", "Nose Bridge Scale", (1.0, 0.35, 0.9)), ("NodeSocketVector", "Jaw Muscle Middle Coord", (0.24, 0.41, 1.3)), ("NodeSocketVector", "Jaw StartRad, EndRad, Fullness", (0.06, 0.11, 1.5)), ( diff --git a/infinigen/assets/objects/creatures/parts/head_detail.py b/infinigen/assets/objects/creatures/parts/head_detail.py index 57f4aa6f2..7693f852c 100644 --- a/infinigen/assets/objects/creatures/parts/head_detail.py +++ b/infinigen/assets/objects/creatures/parts/head_detail.py @@ -172,7 +172,7 @@ def nodegroup_cat_nose(nw: NodeWrangler): ("NodeSocketFloat", "Nose Radius", 0.06), ("NodeSocketFloat", "Nostril Size", 0.025), ("NodeSocketFloat", "Crease", 0.008), - ("NodeSocketVectorXYZ", "Scale", (1.2, 1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.2, 1.0, 1.0)), ], ) diff --git a/infinigen/assets/objects/creatures/parts/ridged_fin.py b/infinigen/assets/objects/creatures/parts/ridged_fin.py index 1548b2864..60f7dd7f1 100644 --- a/infinigen/assets/objects/creatures/parts/ridged_fin.py +++ b/infinigen/assets/objects/creatures/parts/ridged_fin.py @@ -146,7 +146,7 @@ def nodegroup_fish_fin(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorXYZ", "FinScale", (1.0000, 1.0000, 0.5000)), + ("NodeSocketVector", "FinScale", (1.0000, 1.0000, 0.5000)), ("NodeSocketFloat", "RoundWeight", 1.0000), ("NodeSocketFloat", "Freq", 69.1150), ("NodeSocketFloat", "OffsetWeightZ", 1.0000), @@ -649,9 +649,17 @@ def make_part(self, params): ) butil.set_geomod_inputs(mod, params) - id1 = mod.node_group.outputs["Bump"].identifier + id1 = next( + s + for s in mod.node_group.interface.items_tree + if s.in_out == "OUTPUT" and s.name == "Bump" + ).identifier mod[f"{id1}_attribute_name"] = "Bump" - id2 = mod.node_group.outputs["BumpMask"].identifier + id2 = next( + s + for s in mod.node_group.interface.items_tree + if s.in_out == "OUTPUT" and s.name == "BumpMask" + ).identifier mod[f"{id2}_attribute_name"] = "BumpMask" butil.apply_modifiers(fin, mod) diff --git a/infinigen/assets/objects/creatures/parts/wings.py b/infinigen/assets/objects/creatures/parts/wings.py index 9aef1ff54..411158b89 100644 --- a/infinigen/assets/objects/creatures/parts/wings.py +++ b/infinigen/assets/objects/creatures/parts/wings.py @@ -160,7 +160,7 @@ def nodegroup_bird_tail(nw: NodeWrangler): ("NodeSocketVector", "Feather Length Rad1 Rad2", (0.5, 0.08, 0.1)), ("NodeSocketVector", "Feather Rot Extent", (136.51, -11.8, 34.0)), ("NodeSocketVector", "Feather Rot Rand Bounds", (5.0, 5.0, 5.0)), - ("NodeSocketIntUnsigned", "N Feathers", 16), + ("NodeSocketInt", "N Feathers", 16), ], ) @@ -718,7 +718,7 @@ def nodegroup_flying_bird_tail(nw: NodeWrangler): ("NodeSocketVector", "Feather Length Rad1 Rad2", (0.5000, 0.0800, 0.1000)), ("NodeSocketVector", "Feather Rot Extent", (136.5100, -11.8000, 34.0000)), ("NodeSocketVector", "Feather Rot Rand Bounds", (5.0000, 5.0000, 5.0000)), - ("NodeSocketIntUnsigned", "N Feathers", 16), + ("NodeSocketInt", "N Feathers", 16), ], ) diff --git a/infinigen/assets/objects/creatures/util/cloth_sim.py b/infinigen/assets/objects/creatures/util/cloth_sim.py index 691cb9e39..b33d9e517 100644 --- a/infinigen/assets/objects/creatures/util/cloth_sim.py +++ b/infinigen/assets/objects/creatures/util/cloth_sim.py @@ -156,6 +156,7 @@ def bake_cloth(obj, settings=None, attributes=None, frame_start=None, frame_end= "active_object": obj, "point_cache": mod.point_cache, } - bpy.ops.ptcache.bake(override, bake=True) + with bpy.context.temp_override(**override): + bpy.ops.ptcache.bake(bake=True) return mod diff --git a/infinigen/assets/objects/creatures/util/part_util.py b/infinigen/assets/objects/creatures/util/part_util.py index 97b4d6321..49b5b5167 100644 --- a/infinigen/assets/objects/creatures/util/part_util.py +++ b/infinigen/assets/objects/creatures/util/part_util.py @@ -30,7 +30,9 @@ def nodegroup_to_part( else: ng = nodegroup_func() geo_outputs = [ - o for o in ng.outputs if o.bl_socket_idname == "NodeSocketGeometry" + s + for s in ng.interface.items_tree + if s.in_out == "OUTPUT" and s.bl_socket_idname == "NodeSocketGeometry" ] objs = { o.name: extract_nodegroup_geo(base_obj, ng, o.name, ng_params=params) diff --git a/infinigen/assets/objects/fruits/fruit_utils.py b/infinigen/assets/objects/fruits/fruit_utils.py index 76003a807..bffa3a04b 100644 --- a/infinigen/assets/objects/fruits/fruit_utils.py +++ b/infinigen/assets/objects/fruits/fruit_utils.py @@ -262,7 +262,7 @@ def nodegroup_instance_on_points(nw: NodeWrangler): expose_input=[ ("NodeSocketVector", "rotation base", (0.0, 0.0, 0.0)), ("NodeSocketVector", "rotation delta", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "translation", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "translation", (0.0, 0.0, 0.0)), ("NodeSocketFloat", "scale", 0.0), ("NodeSocketGeometry", "Points", None), ("NodeSocketGeometry", "Instance", None), @@ -319,10 +319,10 @@ def nodegroup_shape_quadratic( ("NodeSocketFloat", "random seed pos", 0.0), ("NodeSocketFloat", "noise scale pos", 0.0), ("NodeSocketFloat", "noise amount pos", 0.0), - ("NodeSocketIntUnsigned", "Resolution", 256), - ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, -1.5)), - ("NodeSocketVectorTranslation", "Middle", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "End", (0.0, 0.0, 1.5)), + ("NodeSocketInt", "Resolution", 256), + ("NodeSocketVector", "Start", (0.0, 0.0, -1.5)), + ("NodeSocketVector", "Middle", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "End", (0.0, 0.0, 1.5)), ], ) @@ -510,7 +510,7 @@ def nodegroup_add_dent(nw: NodeWrangler, dent_control_points): switch = nw.new_node( Nodes.Switch, - input_kwargs={0: group_input.outputs["bottom"], 6: greater_than, 7: op_not}, + input_kwargs={0: group_input.outputs["bottom"], 1: greater_than, 2: op_not}, attrs={"input_type": "BOOLEAN"}, ) @@ -550,7 +550,7 @@ def nodegroup_add_dent(nw: NodeWrangler, dent_control_points): Nodes.SetPosition, input_kwargs={ "Geometry": group_input.outputs["Geometry"], - "Selection": switch.outputs[2], + "Selection": switch, "Offset": scale.outputs["Vector"], }, ) @@ -740,7 +740,7 @@ def nodegroup_attach_to_nearest(nw: NodeWrangler): ("NodeSocketGeometry", "Target", None), ("NodeSocketFloat", "threshold", 0.0), ("NodeSocketFloat", "multiplier", 0.5), - ("NodeSocketVectorTranslation", "Offset", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Offset", (0.0, 0.0, 0.0)), ], ) @@ -930,14 +930,14 @@ def nodegroup_hair(nw: NodeWrangler): expose_input=[ ("NodeSocketFloat", "shape noise random seed", 0.0), ("NodeSocketFloat", "shape noise amount", 1.0), - ("NodeSocketIntUnsigned", "length resolution", 8), + ("NodeSocketInt", "length resolution", 8), ("NodeSocketInt", "cross section resolution", 4), ("NodeSocketFloat", "scale", 0.0), ("NodeSocketFloat", "Radius", 0.01), ("NodeSocketMaterial", "Material", None), - ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "Middle", (0.0, 0.3, 1.0)), - ("NodeSocketVectorTranslation", "End", (0.0, -1.4, 2.0)), + ("NodeSocketVector", "Start", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Middle", (0.0, 0.3, 1.0)), + ("NodeSocketVector", "End", (0.0, -1.4, 2.0)), ], ) diff --git a/infinigen/assets/objects/fruits/seed_lib.py b/infinigen/assets/objects/fruits/seed_lib.py index f38512ac5..01d215fad 100644 --- a/infinigen/assets/objects/fruits/seed_lib.py +++ b/infinigen/assets/objects/fruits/seed_lib.py @@ -44,7 +44,7 @@ def nodegroup_strawberry_seed(nw: NodeWrangler): # Code generated using version 2.4.3 of the node_transpiler group_input = nw.new_node( - Nodes.GroupInput, expose_input=[("NodeSocketIntUnsigned", "Resolution", 8)] + Nodes.GroupInput, expose_input=[("NodeSocketInt", "Resolution", 8)] ) quadratic_bezier = nw.new_node( diff --git a/infinigen/assets/objects/fruits/stem_lib.py b/infinigen/assets/objects/fruits/stem_lib.py index 9097d7ec5..7ff8658ed 100644 --- a/infinigen/assets/objects/fruits/stem_lib.py +++ b/infinigen/assets/objects/fruits/stem_lib.py @@ -98,14 +98,14 @@ def nodegroup_basic_stem(nw: NodeWrangler, stem_color=(0.179, 0.836, 0.318, 1.0) group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "quad_start", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "quad_mid", (0.0, -0.05, 0.2)), - ("NodeSocketVectorTranslation", "quad_end", (-0.1, 0.0, 0.4)), - ("NodeSocketIntUnsigned", "quad_res", 128), + ("NodeSocketVector", "quad_start", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "quad_mid", (0.0, -0.05, 0.2)), + ("NodeSocketVector", "quad_end", (-0.1, 0.0, 0.4)), + ("NodeSocketInt", "quad_res", 128), ("NodeSocketFloat", "cross_radius", 0.08), ("NodeSocketInt", "cross_res", 128), - ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), - ("NodeSocketVectorXYZ", "Scale", (1.0, 1.0, 2.0)), + ("NodeSocketVector", "Translation", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, 1.0, 2.0)), ], ) @@ -249,10 +249,10 @@ def nodegroup_calyx_stem(nw: NodeWrangler, stem_color=(0.1678, 0.4541, 0.0397, 1 ("NodeSocketFloat", "cross section noise amount", 0.4), ("NodeSocketFloat", "z noise amount", 1.0), ("NodeSocketFloat", "noise random seed", 0.0), - ("NodeSocketVectorTranslation", "quad_start", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "quad_mid", (0.0, -0.05, 0.2)), - ("NodeSocketVectorTranslation", "quad_end", (-0.1, 0.0, 0.4)), - ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "quad_start", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "quad_mid", (0.0, -0.05, 0.2)), + ("NodeSocketVector", "quad_end", (-0.1, 0.0, 0.4)), + ("NodeSocketVector", "Translation", (0.0, 0.0, 1.0)), ("NodeSocketFloat", "cross_radius", 0.04), ], ) @@ -635,15 +635,15 @@ def nodegroup_coconut_stem( expose_input=[ ("NodeSocketGeometry", "Target", None), ("NodeSocketFloat", "radius", 0.0), - ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.08)), + ("NodeSocketVector", "Translation", (0.0, 0.0, 1.08)), ("NodeSocketInt", "Count", 6), ("NodeSocketFloat", "base scale", 0.3), ("NodeSocketFloat", "top scale", 0.24), ("NodeSocketFloat", "attach threshold", 0.1), ("NodeSocketFloat", "attach multiplier", 10.0), ("NodeSocketFloat", "calyx width", 0.5), - ("NodeSocketVectorTranslation", "stem_mid", (0.0, 0.0, 1.0)), - ("NodeSocketVectorTranslation", "stem_end", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "stem_mid", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "stem_end", (0.0, 0.0, 1.0)), ("NodeSocketFloat", "stem_radius", 0.5), ], ) @@ -853,10 +853,10 @@ def nodegroup_pineapple_leaf(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 8), - ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "Middle", (0.0, -0.32, 3.72)), - ("NodeSocketVectorTranslation", "End", (0.0, 0.92, 4.32)), + ("NodeSocketInt", "Resolution", 8), + ("NodeSocketVector", "Start", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Middle", (0.0, -0.32, 3.72)), + ("NodeSocketVector", "End", (0.0, 0.92, 4.32)), ], ) @@ -952,7 +952,7 @@ def nodegroup_pineapple_crown(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Leaf", None), - ("NodeSocketVectorTranslation", "translation", (0.0, 0.0, 0.7)), + ("NodeSocketVector", "translation", (0.0, 0.0, 0.7)), ("NodeSocketVector", "rotation base", (-0.4363, 0.0, 0.0)), ("NodeSocketInt", "number of leaves", 75), ("NodeSocketFloat", "noise amount", 0.1), @@ -1081,11 +1081,11 @@ def nodegroup_pineapple_stem(nw: NodeWrangler, basic_color): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 16), - ("NodeSocketVectorTranslation", "Start", (0.0, 0.0, 0.0)), - ("NodeSocketVectorTranslation", "Middle", (0.0, -0.32, 3.72)), - ("NodeSocketVectorTranslation", "End", (0.0, 0.92, 4.32)), - ("NodeSocketVectorTranslation", "translation", (0.0, 0.0, 0.7)), + ("NodeSocketInt", "Resolution", 16), + ("NodeSocketVector", "Start", (0.0, 0.0, 0.0)), + ("NodeSocketVector", "Middle", (0.0, -0.32, 3.72)), + ("NodeSocketVector", "End", (0.0, 0.92, 4.32)), + ("NodeSocketVector", "translation", (0.0, 0.0, 0.7)), ("NodeSocketVector", "rotation base", (-0.5236, 0.0, 0.0)), ("NodeSocketInt", "number of leaves", 75), ("NodeSocketFloat", "noise amount", 0.1), diff --git a/infinigen/assets/objects/grassland/dandelion.py b/infinigen/assets/objects/grassland/dandelion.py index 850c1d514..4d107d5be 100644 --- a/infinigen/assets/objects/grassland/dandelion.py +++ b/infinigen/assets/objects/grassland/dandelion.py @@ -25,7 +25,7 @@ def nodegroup_pedal_stem_head_geometry(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "Translation", (0.0, 0.0, 1.0)), ("NodeSocketFloat", "Radius", 0.04), ], ) @@ -360,7 +360,7 @@ def nodegroup_pedal_stem_branch_geometry(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Curve", None), - ("NodeSocketVectorTranslation", "Translation", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "Translation", (0.0, 0.0, 1.0)), ], ) @@ -405,8 +405,8 @@ def nodegroup_pedal_stem_geometry(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "End", (0.0, 0.0, 1.0)), - ("NodeSocketVectorTranslation", "Middle", (0.0, 0.0, 0.5)), + ("NodeSocketVector", "End", (0.0, 0.0, 1.0)), + ("NodeSocketVector", "Middle", (0.0, 0.0, 0.5)), ("NodeSocketFloat", "Radius", 0.05), ], ) diff --git a/infinigen/assets/objects/grassland/flower.py b/infinigen/assets/objects/grassland/flower.py index 104bb9a76..0c67c86e8 100644 --- a/infinigen/assets/objects/grassland/flower.py +++ b/infinigen/assets/objects/grassland/flower.py @@ -538,7 +538,7 @@ def nodegroup_plant_seed(nw): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "Dimensions", (0.0, 0.0, 0.0)), - ("NodeSocketIntUnsigned", "U", 4), + ("NodeSocketInt", "U", 4), ("NodeSocketInt", "V", 8), ], ) diff --git a/infinigen/assets/objects/lamp/ceiling_classic_lamp.py b/infinigen/assets/objects/lamp/ceiling_classic_lamp.py index 56494b563..753eaadf1 100644 --- a/infinigen/assets/objects/lamp/ceiling_classic_lamp.py +++ b/infinigen/assets/objects/lamp/ceiling_classic_lamp.py @@ -33,8 +33,7 @@ def shader_lamp_material(nw: NodeWrangler): "Sheen Weight": 0.2068, "Coat Roughness": 0.1436, "Transmission Weight": 0.4045, - "Transmission Roughness": 0.6932, - "Emission": (0.9858, 0.9858, 0.9858, 1.0000), + "Emission Color": (0.9858, 0.9858, 0.9858, 1.0000), "Emission Strength": 0.0000, "Alpha": 0.8614, }, diff --git a/infinigen/assets/objects/lamp/lamp.py b/infinigen/assets/objects/lamp/lamp.py index e68d5d22b..647730822 100644 --- a/infinigen/assets/objects/lamp/lamp.py +++ b/infinigen/assets/objects/lamp/lamp.py @@ -810,9 +810,9 @@ def nodegroup_lamp_geometry(nw: NodeWrangler): ("NodeSocketFloat", "HeadBotRadius", 0.5000), ("NodeSocketBool", "ReverseLamp", True), ("NodeSocketFloat", "RackThickness", 0.0050), - ("NodeSocketVectorTranslation", "CurvePoint1", (0.0000, 0.0000, 0.0000)), - ("NodeSocketVectorTranslation", "CurvePoint2", (0.0000, 0.0000, 0.0000)), - ("NodeSocketVectorTranslation", "CurvePoint3", (0.0000, 0.0000, 0.0000)), + ("NodeSocketVector", "CurvePoint1", (0.0000, 0.0000, 0.0000)), + ("NodeSocketVector", "CurvePoint2", (0.0000, 0.0000, 0.0000)), + ("NodeSocketVector", "CurvePoint3", (0.0000, 0.0000, 0.0000)), ("NodeSocketMaterial", "BlackMaterial", None), ("NodeSocketMaterial", "LampshadeMaterial", None), ("NodeSocketMaterial", "MetalMaterial", None), diff --git a/infinigen/assets/objects/leaves/leaf_ginko.py b/infinigen/assets/objects/leaves/leaf_ginko.py index a3cc77362..aee5af730 100644 --- a/infinigen/assets/objects/leaves/leaf_ginko.py +++ b/infinigen/assets/objects/leaves/leaf_ginko.py @@ -400,7 +400,7 @@ def nodegroup_ginko( ("NodeSocketGeometry", "Mesh", None), ("NodeSocketFloat", "Vein Length", 0.64), ("NodeSocketFloat", "Vein Width", 0.005), - ("NodeSocketFloatAngle", "Angle", -1.7617), + ("NodeSocketFloat", "Angle", -1.7617), ("NodeSocketFloat", "Displacenment", 0.5), ("NodeSocketFloat", "Multiplier", 1.980), ("NodeSocketFloat", "Scale Vein", 80.0), diff --git a/infinigen/assets/objects/leaves/leaf_maple.py b/infinigen/assets/objects/leaves/leaf_maple.py index 88f46ecbb..f917a750b 100644 --- a/infinigen/assets/objects/leaves/leaf_maple.py +++ b/infinigen/assets/objects/leaves/leaf_maple.py @@ -32,7 +32,7 @@ def nodegroup_vein(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "Vector", (0.0, 0.0, 0.0)), - ("NodeSocketFloatAngle", "Angle", 0.0), + ("NodeSocketFloat", "Angle", 0.0), ("NodeSocketFloat", "Length", 0.0), ("NodeSocketFloat", "Start", 0.0), ("NodeSocketFloat", "X Modulated", 0.0), @@ -338,8 +338,8 @@ def nodegroup_midrib(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "Vector", (0.0, 0.0, 0.0)), - ("NodeSocketFloatAngle", "Angle", 0.8238), - ("NodeSocketFloatAngle", "vein Angle", 0.7854), + ("NodeSocketFloat", "Angle", 0.8238), + ("NodeSocketFloat", "vein Angle", 0.7854), ("NodeSocketFloat", "vein Length", 0.2), ("NodeSocketFloat", "vein Start", -0.2), ("NodeSocketFloat", "Anneal", 0.4), diff --git a/infinigen/assets/objects/leaves/leaf_pine.py b/infinigen/assets/objects/leaves/leaf_pine.py index fbd95c74f..8baf0ec72 100644 --- a/infinigen/assets/objects/leaves/leaf_pine.py +++ b/infinigen/assets/objects/leaves/leaf_pine.py @@ -23,7 +23,7 @@ def shader_needle(nw): # Code generated using version 2.3.1 of the node_transpiler velvet_bsdf = nw.new_node( - "ShaderNodeBsdfVelvet", input_kwargs={"Color": (0.016, 0.2241, 0.0252, 1.0)} + "ShaderNodeBsdfSheen", input_kwargs={"Color": (0.016, 0.2241, 0.0252, 1.0)} ) glossy_bsdf = nw.new_node( @@ -363,7 +363,7 @@ def nodegroup_pine_twig(nw): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 20), + ("NodeSocketInt", "Resolution", 20), ("NodeSocketFloat", "Middle Y", 0.0), ("NodeSocketFloat", "Middle Z", 0.0), ("NodeSocketFloat", "Needle Density", 0.9), diff --git a/infinigen/assets/objects/leaves/leaf_v2.py b/infinigen/assets/objects/leaves/leaf_v2.py index d131d7380..2e2ce9ccc 100644 --- a/infinigen/assets/objects/leaves/leaf_v2.py +++ b/infinigen/assets/objects/leaves/leaf_v2.py @@ -422,7 +422,6 @@ def shader_nodegroup_leaf_gen( input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketGeometry", "Mesh", None), ("NodeSocketFloat", "Displancement scale", 0.01), ("NodeSocketFloat", "Vein Asymmetry", 0.8), ("NodeSocketFloat", "Vein Density", 10.0), diff --git a/infinigen/assets/objects/monocot/growth.py b/infinigen/assets/objects/monocot/growth.py index fbfdc31a6..898c4b492 100644 --- a/infinigen/assets/objects/monocot/growth.py +++ b/infinigen/assets/objects/monocot/growth.py @@ -144,7 +144,7 @@ def geo_flower(nw: NodeWrangler, leaves): ) z_rotation = nw.new_node( Nodes.AccumulateField, - [None, nw.uniform(self.angle * 0.95, self.angle * 1.05)], + [nw.uniform(self.angle * 0.95, self.angle * 1.05)], ) rotation = nw.combine(0, y_rotation, z_rotation) scale = nw.build_float_curve(parameter, self.scale_curve, "AUTO") @@ -167,7 +167,7 @@ def geo_flower(nw: NodeWrangler, leaves): ) points, z_rotation = nw.new_node( Nodes.CaptureAttribute, [points, z_rotation] - ).outputs + ).outputs[:2] leaves = nw.new_node(Nodes.CollectionInfo, [leaves, True, True]) is_leaf = reduce( lambda *xs: nw.boolean_math("AND", *xs), diff --git a/infinigen/assets/objects/seating/mattress.py b/infinigen/assets/objects/seating/mattress.py index fede8e7fa..22f790717 100644 --- a/infinigen/assets/objects/seating/mattress.py +++ b/infinigen/assets/objects/seating/mattress.py @@ -49,8 +49,8 @@ def make_coiled(obj, dot_distance, dot_depth, dot_size): bpy.ops.mesh.select_more() bpy.ops.mesh.select_more() write_attr_data(obj, "tip", np.zeros(len(obj.data.polygons)), domain="FACE") - surface.set_active(obj, "tip") with butil.ViewportMode(obj, "EDIT"): + surface.set_active(obj, "tip") bpy.ops.mesh.attribute_set(value_float=1) def geo_scale(nw: NodeWrangler): diff --git a/infinigen/assets/objects/seating/sofa.py b/infinigen/assets/objects/seating/sofa.py index 8b99e1431..79e6ab97e 100644 --- a/infinigen/assets/objects/seating/sofa.py +++ b/infinigen/assets/objects/seating/sofa.py @@ -97,9 +97,9 @@ def nodegroup_corner_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketVectorTranslation", "Location", (0.0000, 0.0000, 0.0000)), - ("NodeSocketVectorTranslation", "CenteringLoc", (0.5000, 0.5000, 0.0000)), - ("NodeSocketVectorTranslation", "Dimensions", (1.0000, 1.0000, 1.0000)), + ("NodeSocketVector", "Location", (0.0000, 0.0000, 0.0000)), + ("NodeSocketVector", "CenteringLoc", (0.5000, 0.5000, 0.0000)), + ("NodeSocketVector", "Dimensions", (1.0000, 1.0000, 1.0000)), ("NodeSocketFloat", "SupportingEdgeFac", 0.0000), ("NodeSocketInt", "Vertices X", 4), ("NodeSocketInt", "Vertices Y", 4), @@ -189,7 +189,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): ("NodeSocketFloat", "arm_width", 0.7000), ("NodeSocketInt", "Arm Type", 0), ("NodeSocketFloat", "Arm_height", 0.7318), - ("NodeSocketFloatAngle", "arms_angle", 0.8727), + ("NodeSocketFloat", "arms_angle", 0.8727), ("NodeSocketBool", "Footrest", False), ("NodeSocketInt", "Count", 4), ("NodeSocketFloat", "Scaling footrest", 1.5000), @@ -648,13 +648,11 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_8 = nw.new_node( Nodes.Switch, - input_kwargs={0: equal_1, 8: divide_2.outputs["Vector"], 9: combine_xyz_4}, + input_kwargs={0: equal_1, 1: divide_2.outputs["Vector"], 2: combine_xyz_4}, attrs={"input_type": "VECTOR"}, ) - separate_xyz_16 = nw.new_node( - Nodes.SeparateXYZ, input_kwargs={"Vector": switch_8.outputs[3]} - ) + separate_xyz_16 = nw.new_node(Nodes.SeparateXYZ, input_kwargs={"Vector": switch_8}) multiply_6 = nw.new_node( Nodes.Math, @@ -678,7 +676,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): subtract_3 = nw.new_node( Nodes.VectorMath, - input_kwargs={0: switch_8.outputs[3], 1: combine_xyz_18}, + input_kwargs={0: switch_8, 1: combine_xyz_18}, attrs={"operation": "SUBTRACT"}, ) @@ -756,14 +754,14 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_6 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["leg_type"], - 14: transform_geometry_9, - 15: transform_geometry_12, + 0: group_input.outputs["leg_type"], + 1: transform_geometry_9, + 2: transform_geometry_12, }, ) transform_geometry_8 = nw.new_node( - Nodes.Transform, input_kwargs={"Geometry": switch_6.outputs[6]} + Nodes.Transform, input_kwargs={"Geometry": switch_6} ) instance_on_points_1 = nw.new_node( @@ -833,7 +831,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_2 = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Footrest"], 15: transform_geometry_5}, + input_kwargs={0: group_input.outputs["Footrest"], 1: transform_geometry_5}, ) combine_xyz_19 = nw.new_node( @@ -884,17 +882,17 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_4 = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Footrest"], 15: join_geometry_11}, + input_kwargs={0: group_input.outputs["Footrest"], 2: join_geometry_11}, ) switch_5 = nw.new_node( Nodes.Switch, - input_kwargs={1: equal, 14: switch_2.outputs[6], 15: switch_4.outputs[6]}, + input_kwargs={0: equal, 1: switch_2, 2: switch_4}, ) join_geometry_4 = nw.new_node( Nodes.JoinGeometry, - input_kwargs={"Geometry": [join_geometry_3, base_board, switch_5.outputs[6]]}, + input_kwargs={"Geometry": [join_geometry_3, base_board, switch_5]}, ) grid = nw.new_node(Nodes.MeshGrid, input_kwargs={"Vertices X": 2, "Vertices Y": 2}) @@ -994,13 +992,13 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_7 = nw.new_node( Nodes.Switch, - input_kwargs={0: equal_3, 4: reroute_11, 5: 1}, + input_kwargs={0: equal_3, 1: reroute_11, 2: 1}, attrs={"input_type": "INT"}, ) combine_xyz_15 = nw.new_node( Nodes.CombineXYZ, - input_kwargs={"X": 1.0000, "Y": switch_7.outputs[1], "Z": 1.1000}, + input_kwargs={"X": 1.0000, "Y": switch_7, "Z": 1.1000}, ) multiply_16 = nw.new_node( @@ -1071,7 +1069,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): "Geometry": seat_cushion, "Selection": equal_4, "Name": "TAG_support", - 6: True, + "Value": True, }, attrs={"data_type": "BOOLEAN", "domain": "FACE"}, ) @@ -1085,7 +1083,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): "Geometry": store_named_attribute_1, "Selection": value, "Name": "TAG_cushion", - 6: True, + "Value": True, }, attrs={"data_type": "BOOLEAN", "domain": "FACE"}, ) @@ -1160,15 +1158,15 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_9 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: equal_2, - 14: nodegroup_array_fill_line_002, - 15: nodegroup_array_fill_line_002_1, + 0: equal_2, + 1: nodegroup_array_fill_line_002, + 2: nodegroup_array_fill_line_002_1, }, ) switch_3 = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Footrest"], 15: switch_9.outputs[6]}, + input_kwargs={0: group_input.outputs["Footrest"], 2: switch_9}, ) nodegroup_array_fill_line_002_2 = nw.new_node( @@ -1184,9 +1182,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): join_geometry_9 = nw.new_node( Nodes.JoinGeometry, - input_kwargs={ - "Geometry": [switch_3.outputs[6], nodegroup_array_fill_line_002_2] - }, + input_kwargs={"Geometry": [switch_3, nodegroup_array_fill_line_002_2]}, ) subdivide_mesh = nw.new_node( @@ -1357,14 +1353,14 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, - input_kwargs={1: True, 14: join_geometry_7, 15: subdivision_surface_2}, + input_kwargs={0: True, 1: join_geometry_7, 2: subdivision_surface_2}, ) switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Subdivide"], - 14: join_geometry_7, - 15: subdivision_surface_2, + 0: group_input.outputs["Subdivide"], + 1: join_geometry_7, + 2: subdivision_surface_2, }, ) @@ -1386,7 +1382,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Geometry": switch_1.outputs[6], "BoundingBox": reroute_8}, + input_kwargs={"Geometry": switch_1, "BoundingBox": reroute_8}, attrs={"is_active_output": True}, ) diff --git a/infinigen/assets/objects/shelves/triangle_shelf.py b/infinigen/assets/objects/shelves/triangle_shelf.py index 8eb759a85..dd29e99bd 100644 --- a/infinigen/assets/objects/shelves/triangle_shelf.py +++ b/infinigen/assets/objects/shelves/triangle_shelf.py @@ -142,7 +142,7 @@ def nodegroup_curve_to_board(nw: NodeWrangler): resample_curve = nw.new_node( Nodes.ResampleCurve, - input_kwargs={"Curve": set_curve_tilt, "Count": 128, "Length": 0.0500}, + input_kwargs={"Curve": set_curve_tilt, "Count": 128}, ) spline_parameter_1 = nw.new_node(Nodes.SplineParameter) @@ -284,7 +284,6 @@ def nodegroup_leg_straight(nw: NodeWrangler): input_kwargs={ "Curve": set_curve_tilt, "Count": group_input.outputs["Resolution"], - "Length": 0.0500, }, ) diff --git a/infinigen/assets/objects/shelves/utils.py b/infinigen/assets/objects/shelves/utils.py index 05de03da6..149341902 100644 --- a/infinigen/assets/objects/shelves/utils.py +++ b/infinigen/assets/objects/shelves/utils.py @@ -45,9 +45,7 @@ def nodegroup_tagged_cube(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, - expose_input=[ - ("NodeSocketVectorTranslation", "Size", (1.0000, 1.0000, 1.0000)) - ], + expose_input=[("NodeSocketVector", "Size", (1.0000, 1.0000, 1.0000))], ) cube = nw.new_node( diff --git a/infinigen/assets/objects/small_plants/fern.py b/infinigen/assets/objects/small_plants/fern.py index 072c4cd6e..1089295f4 100644 --- a/infinigen/assets/objects/small_plants/fern.py +++ b/infinigen/assets/objects/small_plants/fern.py @@ -468,9 +468,7 @@ def nodegroup_pinnae_level1_instance_position(nw: NodeWrangler, pinnae_contour): (1.0, pinnae_contour[7]), ], ) - accumulate_field_1 = nw.new_node( - Nodes.AccumulateField, input_kwargs={1: float_curve_2} - ) + accumulate_field_1 = nw.new_node(Nodes.AccumulateField, [float_curve_2]) # pinnae scale w.r.t fern age map_range_5 = nw.new_node( Nodes.MapRange, @@ -479,7 +477,7 @@ def nodegroup_pinnae_level1_instance_position(nw: NodeWrangler, pinnae_contour): multiply = nw.new_node( Nodes.Math, input_kwargs={ - 0: accumulate_field_1.outputs[4], + 0: accumulate_field_1.outputs["Trailing"], 1: map_range_5.outputs["Result"], }, attrs={"operation": "MULTIPLY"}, @@ -642,9 +640,7 @@ def nodegroup_pinnae_level2_set_point(nw: NodeWrangler, pinna_contour): (1.0, pinna_contour[5]), ], ) - accumulate_field_2 = nw.new_node( - Nodes.AccumulateField, input_kwargs={1: float_curve} - ) + accumulate_field_2 = nw.new_node(Nodes.AccumulateField, [float_curve]) # pinna scale w.r.t fern age map_range_6 = nw.new_node( @@ -654,7 +650,7 @@ def nodegroup_pinnae_level2_set_point(nw: NodeWrangler, pinna_contour): multiply = nw.new_node( Nodes.Math, input_kwargs={ - 0: accumulate_field_2.outputs[4], + 0: accumulate_field_2.outputs["Trailing"], 1: map_range_6.outputs["Result"], }, attrs={"operation": "MULTIPLY"}, diff --git a/infinigen/assets/objects/small_plants/succulent.py b/infinigen/assets/objects/small_plants/succulent.py index b567c874f..5515e63d9 100644 --- a/infinigen/assets/objects/small_plants/succulent.py +++ b/infinigen/assets/objects/small_plants/succulent.py @@ -408,7 +408,7 @@ def nodegroup_pedal_on_base(nw: NodeWrangler, R=1.0): ("NodeSocketFloat", "z_R", -1.57), ("NodeSocketInt", "Resolution", 10), ("NodeSocketGeometry", "Instance", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, 1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, 1.0, 1.0)), ("NodeSocketFloat", "base_z", 0.5), ], ) diff --git a/infinigen/assets/objects/table_decorations/sink.py b/infinigen/assets/objects/table_decorations/sink.py index 2941133de..6b2b0e405 100644 --- a/infinigen/assets/objects/table_decorations/sink.py +++ b/infinigen/assets/objects/table_decorations/sink.py @@ -420,16 +420,16 @@ def nodegroup_water_tap(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Switch"], - 14: transform_geometry_1, - 15: curve_to_mesh_2, + 0: group_input.outputs["Switch"], + 1: transform_geometry_1, + 2: curve_to_mesh_2, }, ) curve_to_mesh_1 = nw.new_node( Nodes.CurveToMesh, input_kwargs={ - "Curve": switch.outputs[6], + "Curve": switch, "Profile Curve": curve_circle_1.outputs["Curve"], }, ) @@ -446,7 +446,7 @@ def nodegroup_water_tap(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, - input_kwargs={0: group_input.outputs["Switch"], 2: greater_than, 3: 1.0000}, + input_kwargs={0: group_input.outputs["Switch"], 1: greater_than, 2: 1.0000}, attrs={"input_type": "FLOAT"}, ) @@ -467,8 +467,8 @@ def nodegroup_water_tap(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Switch"], - 8: combine_xyz, - 9: (1.0000, 1.0000, 1.0000), + 1: combine_xyz, + 2: (1.0000, 1.0000, 1.0000), }, attrs={"input_type": "VECTOR"}, ) @@ -478,7 +478,7 @@ def nodegroup_water_tap(nw: NodeWrangler): input_kwargs={ "Geometry": separate_geometry.outputs["Selection"], "Translation": (0.0000, 0.0000, 0.6000), - "Scale": switch_2.outputs[3], + "Scale": switch_2, }, ) @@ -553,7 +553,7 @@ def nodegroup_water_tap(nw: NodeWrangler): switch_5 = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["one_side"], 14: transform_geometry_7}, + input_kwargs={0: group_input.outputs["one_side"], 1: transform_geometry_7}, ) transform_geometry_8 = nw.new_node( @@ -567,7 +567,7 @@ def nodegroup_water_tap(nw: NodeWrangler): join_geometry_3 = nw.new_node( Nodes.JoinGeometry, - input_kwargs={"Geometry": [switch_5.outputs[6], transform_geometry_8]}, + input_kwargs={"Geometry": [switch_5, transform_geometry_8]}, ) cylinder_1 = nw.new_node( @@ -591,7 +591,7 @@ def nodegroup_water_tap(nw: NodeWrangler): switch_4 = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["one_side"], 14: transform_geometry_9}, + input_kwargs={0: group_input.outputs["one_side"], 1: transform_geometry_9}, ) transform_geometry_10 = nw.new_node( @@ -616,24 +616,24 @@ def nodegroup_water_tap(nw: NodeWrangler): switch_8 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["length_one_side"], - 14: transform_geometry_10, - 15: transform_geometry_17, + 0: group_input.outputs["length_one_side"], + 1: transform_geometry_10, + 2: transform_geometry_17, }, ) switch_7 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["one_side"], - 14: transform_geometry_10, - 15: switch_8.outputs[6], + 0: group_input.outputs["one_side"], + 1: transform_geometry_10, + 2: switch_8, }, ) join_geometry_4 = nw.new_node( Nodes.JoinGeometry, - input_kwargs={"Geometry": [switch_4.outputs[6], switch_7.outputs[6]]}, + input_kwargs={"Geometry": [switch_4, switch_7]}, ) join_geometry_5 = nw.new_node( @@ -658,9 +658,9 @@ def nodegroup_water_tap(nw: NodeWrangler): switch_3 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["hand_type"], - 14: join_geometry_2, - 15: transform_geometry_11, + 0: group_input.outputs["hand_type"], + 1: join_geometry_2, + 2: transform_geometry_11, }, ) @@ -679,7 +679,7 @@ def nodegroup_water_tap(nw: NodeWrangler): input_kwargs={ "Geometry": [ transform_geometry_5, - switch_3.outputs[6], + switch_3, extrude_mesh.outputs["Mesh"], ] }, @@ -860,9 +860,9 @@ def nodegroup_water_tap(nw: NodeWrangler): switch_6 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["different_type"], - 14: join_geometry_1, - 15: transform_geometry_16, + 0: group_input.outputs["different_type"], + 1: join_geometry_1, + 2: transform_geometry_16, }, ) @@ -889,9 +889,7 @@ def nodegroup_water_tap(nw: NodeWrangler): join_geometry_6 = nw.new_node( Nodes.JoinGeometry, - input_kwargs={ - "Geometry": [switch_6.outputs[6], extrude_mesh_1.outputs["Mesh"]] - }, + input_kwargs={"Geometry": [switch_6, extrude_mesh_1.outputs["Mesh"]]}, ) set_material = nw.new_node( diff --git a/infinigen/assets/objects/table_decorations/utils.py b/infinigen/assets/objects/table_decorations/utils.py index 31004e834..68b12bd15 100644 --- a/infinigen/assets/objects/table_decorations/utils.py +++ b/infinigen/assets/objects/table_decorations/utils.py @@ -220,13 +220,13 @@ def nodegroup_lofting(nw: NodeWrangler): evaluate_on_domain = nw.new_node( Nodes.EvaluateonDomain, - input_kwargs={1: index}, + input_kwargs={0: index}, attrs={"data_type": "INT", "domain": "CURVE"}, ) equal = nw.new_node( Nodes.Compare, - input_kwargs={2: evaluate_on_domain.outputs[1]}, + input_kwargs={2: evaluate_on_domain}, attrs={"data_type": "INT", "operation": "EQUAL"}, ) @@ -273,7 +273,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SampleIndex, input_kwargs={ "Geometry": group_input.outputs["Profile Curves"], - 3: position, + "Value": position, "Index": flipindex, }, attrs={"data_type": "FLOAT_VECTOR"}, @@ -283,7 +283,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SetPosition, input_kwargs={ "Geometry": realize_instances, - "Position": sample_index_2.outputs[2], + "Position": sample_index_2, }, ) @@ -302,16 +302,16 @@ def nodegroup_lofting(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Use Nurb"], - 14: set_spline_type_1, - 15: set_spline_type, + 0: group_input.outputs["Use Nurb"], + 1: set_spline_type_1, + 2: set_spline_type, }, ) resample_curve_1 = nw.new_node( Nodes.ResampleCurve, input_kwargs={ - "Curve": switch.outputs[6], + "Curve": switch, "Count": group_input.outputs["V Resolution"], }, ) @@ -330,7 +330,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SampleIndex, input_kwargs={ "Geometry": resample_curve_1, - 3: position_1, + "Value": position_1, "Index": flipindex_1, }, attrs={"data_type": "FLOAT_VECTOR"}, @@ -340,7 +340,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SetPosition, input_kwargs={ "Geometry": cylinderside.outputs["Geometry"], - "Position": sample_index_3.outputs[2], + "Position": sample_index_3, }, ) @@ -394,7 +394,7 @@ def nodegroup_lofting_poly(nw: NodeWrangler): equal = nw.new_node( Nodes.Compare, - input_kwargs={2: evaluate_on_domain.outputs[1]}, + input_kwargs={"A": evaluate_on_domain}, attrs={"operation": "EQUAL", "data_type": "INT"}, ) @@ -441,7 +441,7 @@ def nodegroup_lofting_poly(nw: NodeWrangler): Nodes.SampleIndex, input_kwargs={ "Geometry": group_input.outputs["Profile Curves"], - 3: position, + "Value": position, "Index": flipindex_001, }, attrs={"data_type": "FLOAT_VECTOR"}, @@ -451,7 +451,7 @@ def nodegroup_lofting_poly(nw: NodeWrangler): Nodes.SetPosition, input_kwargs={ "Geometry": realize_instances, - "Position": sample_index_2.outputs[2], + "Position": sample_index_2, }, ) @@ -468,15 +468,15 @@ def nodegroup_lofting_poly(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Use Nurb"], - 14: set_spline_type_1, - 15: set_spline_type, + 0: group_input.outputs["Use Nurb"], + 1: set_spline_type_1, + 2: set_spline_type, }, ) resample_curve_1 = nw.new_node( Nodes.ResampleCurve, - input_kwargs={"Curve": switch.outputs[6], "Count": reroute_2}, + input_kwargs={"Curve": switch, "Count": reroute_2}, ) position_1 = nw.new_node(Nodes.InputPosition) @@ -493,7 +493,7 @@ def nodegroup_lofting_poly(nw: NodeWrangler): Nodes.SampleIndex, input_kwargs={ "Geometry": resample_curve_1, - 3: position_1, + "Value": position_1, "Index": flipindex_001_1, }, attrs={"data_type": "FLOAT_VECTOR"}, @@ -503,7 +503,7 @@ def nodegroup_lofting_poly(nw: NodeWrangler): Nodes.SetPosition, input_kwargs={ "Geometry": cylinderside_001.outputs["Geometry"], - "Position": sample_index_3.outputs[2], + "Position": sample_index_3, }, ) @@ -585,7 +585,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): sample_index_3 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": resample_curve, 3: position_1, "Index": round}, + input_kwargs={"Geometry": resample_curve, "Value": position_1, "Index": round}, attrs={"data_type": "FLOAT_VECTOR"}, ) @@ -593,7 +593,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): sample_index_5 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": resample_curve, 3: normal, "Index": round}, + input_kwargs={"Geometry": resample_curve, "Value": normal, "Index": round}, attrs={"data_type": "FLOAT_VECTOR"}, ) @@ -603,7 +603,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): scale = nw.new_node( Nodes.VectorMath, - input_kwargs={0: sample_index_5.outputs[2], "Scale": separate_xyz.outputs["X"]}, + input_kwargs={0: sample_index_5, "Scale": separate_xyz.outputs["X"]}, attrs={"operation": "SCALE"}, ) @@ -611,13 +611,17 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): sample_index_4 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": resample_curve, 3: curve_tangent, "Index": round}, + input_kwargs={ + "Geometry": resample_curve, + "Value": curve_tangent, + "Index": round, + }, attrs={"data_type": "FLOAT_VECTOR"}, ) cross_product = nw.new_node( Nodes.VectorMath, - input_kwargs={0: sample_index_4.outputs[2], 1: sample_index_5.outputs[2]}, + input_kwargs={0: sample_index_4, 1: sample_index_5}, attrs={"operation": "CROSS_PRODUCT"}, ) @@ -637,7 +641,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): add_2 = nw.new_node( Nodes.VectorMath, - input_kwargs={0: sample_index_3.outputs[2], 1: add_1.outputs["Vector"]}, + input_kwargs={0: sample_index_3, 1: add_1.outputs["Vector"]}, ) set_position = nw.new_node( diff --git a/infinigen/assets/objects/tables/cocktail_table.py b/infinigen/assets/objects/tables/cocktail_table.py index bded7b73f..889097673 100644 --- a/infinigen/assets/objects/tables/cocktail_table.py +++ b/infinigen/assets/objects/tables/cocktail_table.py @@ -186,9 +186,9 @@ def geometry_assemble_table(nw: NodeWrangler, **kwargs): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: kwargs["is_placeholder"], - 14: join_geometry, - 15: transform_geometry_1, + 0: kwargs["is_placeholder"], + 1: join_geometry, + 2: transform_geometry_1, }, ) diff --git a/infinigen/assets/objects/tables/lofting.py b/infinigen/assets/objects/tables/lofting.py index 776bd9f5b..da7fb5096 100644 --- a/infinigen/assets/objects/tables/lofting.py +++ b/infinigen/assets/objects/tables/lofting.py @@ -250,7 +250,7 @@ def nodegroup_lofting(nw: NodeWrangler): equal = nw.new_node( Nodes.Compare, - input_kwargs={2: evaluate_on_domain.outputs[1]}, + input_kwargs={"A": evaluate_on_domain.outputs[1]}, attrs={"data_type": "INT", "operation": "EQUAL"}, ) @@ -295,7 +295,7 @@ def nodegroup_lofting(nw: NodeWrangler): sample_index_2 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": group_input, 3: position, "Index": flipindex}, + input_kwargs={"Geometry": group_input, "Value": position, "Index": flipindex}, attrs={"data_type": "FLOAT_VECTOR"}, ) @@ -303,7 +303,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SetPosition, input_kwargs={ "Geometry": realize_instances, - "Position": sample_index_2.outputs[2], + "Position": sample_index_2, }, ) @@ -322,15 +322,15 @@ def nodegroup_lofting(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Use Nurb"], - 14: set_spline_type_1, - 15: set_spline_type, + 0: group_input.outputs["Use Nurb"], + 1: set_spline_type_1, + 2: set_spline_type, }, ) resample_curve_1 = nw.new_node( Nodes.ResampleCurve, - input_kwargs={"Curve": switch.outputs[6], "Count": group_input}, + input_kwargs={"Curve": switch, "Count": group_input}, ) position_1 = nw.new_node(Nodes.InputPosition) @@ -347,7 +347,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SampleIndex, input_kwargs={ "Geometry": resample_curve_1, - 3: position_1, + "Value": position_1, "Index": flipindex_1, }, attrs={"data_type": "FLOAT_VECTOR"}, @@ -357,7 +357,7 @@ def nodegroup_lofting(nw: NodeWrangler): Nodes.SetPosition, input_kwargs={ "Geometry": cylinderside.outputs["Geometry"], - "Position": sample_index_3.outputs[2], + "Position": sample_index_3, }, ) @@ -414,7 +414,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): sample_index_3 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": resample_curve, 3: position_1, "Index": floor}, + input_kwargs={"Geometry": resample_curve, "Value": position_1, "Index": floor}, attrs={"data_type": "FLOAT_VECTOR"}, ) @@ -422,7 +422,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): sample_index_5 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": resample_curve, 3: normal, "Index": floor}, + input_kwargs={"Geometry": resample_curve, "Value": normal, "Index": floor}, attrs={"data_type": "FLOAT_VECTOR"}, ) @@ -432,7 +432,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): scale = nw.new_node( Nodes.VectorMath, - input_kwargs={0: sample_index_5.outputs[2], "Scale": separate_xyz.outputs["X"]}, + input_kwargs={0: sample_index_5, "Scale": separate_xyz.outputs["X"]}, attrs={"operation": "SCALE"}, ) @@ -440,13 +440,17 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): sample_index_4 = nw.new_node( Nodes.SampleIndex, - input_kwargs={"Geometry": resample_curve, 3: curve_tangent, "Index": floor}, + input_kwargs={ + "Geometry": resample_curve, + "Value": curve_tangent, + "Index": floor, + }, attrs={"data_type": "FLOAT_VECTOR"}, ) cross_product = nw.new_node( Nodes.VectorMath, - input_kwargs={0: sample_index_4.outputs[2], 1: sample_index_5.outputs[2]}, + input_kwargs={0: sample_index_4, 1: sample_index_5}, attrs={"operation": "CROSS_PRODUCT"}, ) @@ -472,7 +476,7 @@ def nodegroup_warp_around_curve(nw: NodeWrangler): add_1 = nw.new_node( Nodes.VectorMath, - input_kwargs={0: sample_index_3.outputs[2], 1: scale_2.outputs["Vector"]}, + input_kwargs={0: sample_index_3, 1: scale_2.outputs["Vector"]}, ) set_position = nw.new_node( diff --git a/infinigen/assets/objects/tables/table_utils.py b/infinigen/assets/objects/tables/table_utils.py index 55cf933dd..511ee2e3e 100644 --- a/infinigen/assets/objects/tables/table_utils.py +++ b/infinigen/assets/objects/tables/table_utils.py @@ -424,20 +424,18 @@ def nodegroup_create_anchors(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: equal_1, - 14: curve_to_points.outputs["Points"], - 15: curve_to_points_1.outputs["Points"], + 0: equal_1, + 1: curve_to_points.outputs["Points"], + 2: curve_to_points_1.outputs["Points"], }, ) points = nw.new_node("GeometryNodePoints") - switch = nw.new_node( - Nodes.Switch, input_kwargs={1: equal, 14: switch_1.outputs[6], 15: points} - ) + switch = nw.new_node(Nodes.Switch, input_kwargs={0: equal, 1: switch_1, 2: points}) set_point_radius = nw.new_node( - Nodes.SetPointRadius, input_kwargs={"Points": switch.outputs[6]} + Nodes.SetPointRadius, input_kwargs={"Points": switch} ) combine_xyz_2 = nw.new_node( @@ -557,8 +555,8 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Align Leg X rot"], - 8: align_euler_to_vector, - 9: align_euler_to_vector_3, + 1: align_euler_to_vector, + 2: align_euler_to_vector_3, }, attrs={"input_type": "VECTOR"}, ) @@ -577,7 +575,7 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): input_kwargs={ "Points": transform, "Instance": group_input.outputs["Leg Instance"], - "Rotation": switch.outputs[3], + "Rotation": switch, "Scale": combine_xyz_2, }, ) @@ -588,7 +586,7 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Keep Legs"], 15: realize_instances}, + input_kwargs={0: group_input.outputs["Keep Legs"], 1: realize_instances}, ) multiply_1 = nw.new_node( @@ -677,13 +675,11 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): switch_2 = nw.new_node( Nodes.Switch, - input_kwargs={0: equal, 6: boolean, 7: less_than}, + input_kwargs={0: equal, 1: boolean, 2: less_than}, attrs={"input_type": "BOOLEAN"}, ) - op_and_2 = nw.new_node( - Nodes.BooleanMath, input_kwargs={0: op_or, 1: switch_2.outputs[2]} - ) + op_and_2 = nw.new_node(Nodes.BooleanMath, input_kwargs={0: op_or, 1: switch_2}) position_1 = nw.new_node(Nodes.InputPosition) @@ -700,13 +696,13 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): field_at_index = nw.new_node( Nodes.FieldAtIndex, - input_kwargs={"Index": modulo_1, 3: position_1}, + input_kwargs={"Index": modulo_1, 1: position_1}, attrs={"data_type": "FLOAT_VECTOR"}, ) subtract_3 = nw.new_node( Nodes.VectorMath, - input_kwargs={0: position_1, 1: field_at_index.outputs[2]}, + input_kwargs={0: position_1, 1: field_at_index}, attrs={"operation": "SUBTRACT"}, ) @@ -750,7 +746,7 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): join_geometry = nw.new_node( Nodes.JoinGeometry, - input_kwargs={"Geometry": [switch_1.outputs[6], realize_instances_1]}, + input_kwargs={"Geometry": [switch_1, realize_instances_1]}, ) group_output = nw.new_node( diff --git a/infinigen/assets/objects/trees/tree_flower.py b/infinigen/assets/objects/trees/tree_flower.py index c451dfd4a..dc0263bd2 100644 --- a/infinigen/assets/objects/trees/tree_flower.py +++ b/infinigen/assets/objects/trees/tree_flower.py @@ -540,7 +540,7 @@ def nodegroup_plant_seed(nw): Nodes.GroupInput, expose_input=[ ("NodeSocketVector", "Dimensions", (0.0, 0.0, 0.0)), - ("NodeSocketIntUnsigned", "U", 4), + ("NodeSocketInt", "U", 4), ("NodeSocketInt", "V", 8), ], ) diff --git a/infinigen/assets/objects/trees/utils/geometrynodes.py b/infinigen/assets/objects/trees/utils/geometrynodes.py index 474c8e9fe..7d11bb337 100644 --- a/infinigen/assets/objects/trees/utils/geometrynodes.py +++ b/infinigen/assets/objects/trees/utils/geometrynodes.py @@ -198,15 +198,13 @@ def coll_distribute(nw, merge_dist=None): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Realize Instance"], - 14: instance_on_points, - 15: realize_instances, + 0: group_input.outputs["Realize Instance"], + 1: instance_on_points, + 2: realize_instances, }, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Geometry": switch.outputs[6]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"Geometry": switch}) @node_utils.to_nodegroup("PhylloDist", singleton=False) @@ -562,7 +560,7 @@ def set_tree_radius(nw): switch = nw.new_node( Nodes.Switch, - input_kwargs={1: True, 14: mesh_to_curve, 15: set_handle_positions}, + input_kwargs={0: True, 1: mesh_to_curve, 2: set_handle_positions}, ) multiply = nw.new_node( @@ -598,7 +596,7 @@ def set_tree_radius(nw): set_curve_radius = nw.new_node( Nodes.SetCurveRadius, - input_kwargs={"Curve": switch.outputs[6], "Radius": minimum}, + input_kwargs={"Curve": switch, "Radius": minimum}, ) curve_circle = nw.new_node( diff --git a/infinigen/assets/objects/trees/utils/materials.py b/infinigen/assets/objects/trees/utils/materials.py index bc25406de..c9336c9cc 100644 --- a/infinigen/assets/objects/trees/utils/materials.py +++ b/infinigen/assets/objects/trees/utils/materials.py @@ -48,10 +48,10 @@ def init_color_material( if is_emission: out_node = nt.nodes.get("Material Output") nt.nodes.new("ShaderNodeEmission") - em = nt.nodes.get("Emission") + em = nt.nodes.get("Emission Color") em.inputs.get("Strength").default_value = emit_strength em.inputs.get("Color").default_value = color - new_link(nt, em, "Emission", out_node, "Surface") + new_link(nt, em, "Emission Color", out_node, "Surface") else: bsdf_node = nt.nodes.get("Principled BSDF") @@ -99,13 +99,13 @@ def create_leaf_material(src_hue, glow=False): if glow: out_node = nt.nodes.get("Material Output") nt.nodes.new("ShaderNodeEmission") - em = nt.nodes.get("Emission") + em = nt.nodes.get("Emission Color") em.inputs.get("Strength").default_value = 1 em.inputs.get("Color").default_value = ( *colorsys.hsv_to_rgb(src_hue + np.random.randn() * 0.1, 1, 1), 1, ) - new_link(nt, em, "Emission", out_node, "Surface") + new_link(nt, em, "Emission Color", out_node, "Surface") else: info_node = nt.nodes.new("ShaderNodeObjectInfo") @@ -252,7 +252,7 @@ def setup_material(m, txt_paths, metal_prob=0.2, transm_prob=0.2, emit_prob=0): nt.nodes.new("ShaderNodeValToRGB") # ColorRamp nt.nodes.new("ShaderNodeMixShader") - em = nt.nodes.get("Emission") + em = nt.nodes.get("Emission Color") em.inputs.get("Strength").default_value = 5 em.inputs.get("Color").default_value = ( *colorsys.hsv_to_rgb(np.random.rand(), 1, 1), @@ -271,5 +271,5 @@ def setup_material(m, txt_paths, metal_prob=0.2, transm_prob=0.2, emit_prob=0): mix = nt.nodes.get("Mix Shader") new_link(nt, ramp, "Color", mix, "Fac") new_link(nt, bsdf, "BSDF", mix, "Shader") - new_link(nt, em, "Emission", mix, "Shader") + new_link(nt, em, "Emission Color", mix, "Shader") new_link(nt, mix, "Shader", out_node, "Surface") diff --git a/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py b/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py index 8151dc496..9ae7f2843 100644 --- a/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py +++ b/infinigen/assets/objects/tropic_plants/leaf_banana_tree.py @@ -488,7 +488,7 @@ def nodegroup_leaf_on_stem(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Points", None), ("NodeSocketGeometry", "Instance", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, 1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, 1.0, 1.0)), ], ) diff --git a/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py b/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py index ddfe893cb..a1e5c7758 100644 --- a/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py +++ b/infinigen/assets/objects/tropic_plants/leaf_palm_plant.py @@ -423,7 +423,7 @@ def nodegroup_leaf_on_stem(nw: NodeWrangler): expose_input=[ ("NodeSocketGeometry", "Points", None), ("NodeSocketGeometry", "Instance", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, 1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, 1.0, 1.0)), ], ) diff --git a/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py b/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py index 8e2149320..a039533d6 100644 --- a/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py +++ b/infinigen/assets/objects/tropic_plants/leaf_palm_tree.py @@ -467,7 +467,7 @@ def nodegroup_leaf_on_stem(nw: NodeWrangler, versions): expose_input=[ ("NodeSocketGeometry", "Points", None), ("NodeSocketGeometry", "Instance", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, 1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, 1.0, 1.0)), ("NodeSocketInt", "Samples", 0), ], ) diff --git a/infinigen/assets/objects/wall_decorations/skirting_board.py b/infinigen/assets/objects/wall_decorations/skirting_board.py index bdfb7f2ef..f7ec2144e 100644 --- a/infinigen/assets/objects/wall_decorations/skirting_board.py +++ b/infinigen/assets/objects/wall_decorations/skirting_board.py @@ -142,15 +142,15 @@ def nodegroup_make_skirting_board(nw: NodeWrangler, control_points): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Is Ceiling"], - 8: (-1.0000, 1.0000, 1.0000), - 9: (-1.0000, -1.0000, -1.0000), + 1: (-1.0000, 1.0000, 1.0000), + 2: (-1.0000, -1.0000, -1.0000), }, attrs={"input_type": "VECTOR"}, ) transform_geometry_1 = nw.new_node( Nodes.Transform, - input_kwargs={"Geometry": set_position, "Scale": switch.outputs[3]}, + input_kwargs={"Geometry": set_position, "Scale": switch}, ) curve_to_mesh_1 = nw.new_node( diff --git a/infinigen/assets/objects/windows/window.py b/infinigen/assets/objects/windows/window.py index 8f38b7c82..66140baf6 100644 --- a/infinigen/assets/objects/windows/window.py +++ b/infinigen/assets/objects/windows/window.py @@ -412,9 +412,9 @@ def nodegroup_window_geometry(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input_1.outputs["Shutter"], - 14: windowpanel_1, - 15: windowshutter, + 0: group_input_1.outputs["Shutter"], + 1: windowpanel_1, + 2: windowshutter, }, ) @@ -464,7 +464,7 @@ def nodegroup_window_geometry(nw: NodeWrangler): transform = nw.new_node( Nodes.Transform, - input_kwargs={"Geometry": switch.outputs[6], "Translation": combine_xyz}, + input_kwargs={"Geometry": switch, "Translation": combine_xyz}, ) geometry_to_instance = nw.new_node( @@ -706,14 +706,14 @@ def nodegroup_window_geometry(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input_1.outputs["Curtain"], - 14: join_geometry, - 15: join_geometry_1, + 0: group_input_1.outputs["Curtain"], + 1: join_geometry, + 2: join_geometry_1, }, ) realize_instances = nw.new_node( - Nodes.RealizeInstances, input_kwargs={"Geometry": switch_1.outputs[6]} + Nodes.RealizeInstances, input_kwargs={"Geometry": switch_1} ) bounding_box = nw.new_node( @@ -1579,15 +1579,15 @@ def nodegroup_window_panel(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["WithGlass"], - 14: set_material_1, - 15: join_geometry, + 0: group_input.outputs["WithGlass"], + 1: set_material_1, + 2: join_geometry, }, ) set_shade_smooth = nw.new_node( Nodes.SetShadeSmooth, - input_kwargs={"Geometry": switch.outputs[6], "Shade Smooth": False}, + input_kwargs={"Geometry": switch, "Shade Smooth": False}, ) group_output = nw.new_node( diff --git a/infinigen/assets/scatters/snow_layer.py b/infinigen/assets/scatters/snow_layer.py index 3eb555feb..9ad18a2a2 100644 --- a/infinigen/assets/scatters/snow_layer.py +++ b/infinigen/assets/scatters/snow_layer.py @@ -20,7 +20,7 @@ def apply(self, obj, **kwargs): tag_object(snow, "boulder") -def apply(obj): +def apply(obj, selection=None, **kwargs): snowlayer = Snowlayer() snowlayer.apply(obj) return snowlayer diff --git a/infinigen/assets/scatters/utils/cluster.py b/infinigen/assets/scatters/utils/cluster.py index 0eadd2053..144147d8f 100644 --- a/infinigen/assets/scatters/utils/cluster.py +++ b/infinigen/assets/scatters/utils/cluster.py @@ -72,7 +72,7 @@ def instance_rotation( "Axis": perturbed_normal, "Angle": z_rotation, }, - attrs={"type": "AXIS_ANGLE"}, + attrs={"rotation_type": "AXIS_ANGLE"}, ) return rotation diff --git a/infinigen/assets/scatters/utils/wind.py b/infinigen/assets/scatters/utils/wind.py index 1cc5c4bd8..967184cab 100644 --- a/infinigen/assets/scatters/utils/wind.py +++ b/infinigen/assets/scatters/utils/wind.py @@ -73,7 +73,7 @@ def wind_rotation(nw, speed=1.0, direction=None, scale=1.0, strength=30): "Axis": vector_rotate_1, "Angle": deg2rad, }, - attrs={"type": "AXIS_ANGLE"}, + attrs={"rotation_type": "AXIS_ANGLE"}, ) return rotation diff --git a/infinigen/assets/utils/extract_nodegroup_parts.py b/infinigen/assets/utils/extract_nodegroup_parts.py index f0bf29e88..afa6e5e0c 100644 --- a/infinigen/assets/utils/extract_nodegroup_parts.py +++ b/infinigen/assets/utils/extract_nodegroup_parts.py @@ -15,7 +15,9 @@ def extract_nodegroup_geo(target_obj, nodegroup, k, ng_params=None): - assert k in nodegroup.outputs + inputs = [s.name for s in nodegroup.interface.items_tree if s.in_out == "INPUT"] + outputs = [s.name for s in nodegroup.interface.items_tree if s.in_out == "OUTPUT"] + assert k in outputs assert target_obj.type == "MESH" vert = butil.spawn_vert("extract_nodegroup_geo.temp") @@ -29,7 +31,7 @@ def extract_nodegroup_geo(target_obj, nodegroup, k, ng_params=None): obj_inp = nw.new_node(Nodes.ObjectInfo, [target_obj]) group_input_kwargs = {**ng_params} - if "Geometry" in nodegroup.inputs: + if "Geometry" in inputs: group_input_kwargs["Geometry"] = obj_inp.outputs["Geometry"] group = nw.new_node(nodegroup.name, input_kwargs=group_input_kwargs) diff --git a/infinigen/assets/utils/nodegroups/attach.py b/infinigen/assets/utils/nodegroups/attach.py index 9156a6456..bb868f776 100644 --- a/infinigen/assets/utils/nodegroups/attach.py +++ b/infinigen/assets/utils/nodegroups/attach.py @@ -166,8 +166,8 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Normal Rot"], - 8: group_input.outputs["Rotation"], - 9: rotate_euler, + 1: group_input.outputs["Rotation"], + 2: rotate_euler, }, label="if_normal_rot", attrs={"input_type": "VECTOR"}, @@ -194,15 +194,15 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Tangent Rot"], - 8: if_normal_rot.outputs[3], - 9: rotate_euler_1, + 1: if_normal_rot.outputs[0], + 2: rotate_euler_1, }, label="if_tangent_rot", attrs={"input_type": "VECTOR"}, ) group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Output": if_tangent_rot.outputs[3]} + Nodes.GroupOutput, input_kwargs={"Output": if_tangent_rot} ) @@ -286,7 +286,7 @@ def nodegroup_surface_muscle(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={1: group_input.outputs["Debug Points"], 15: join_geometry}, + input_kwargs={0: group_input.outputs["Debug Points"], 2: join_geometry}, ) u_resolution = nw.new_node(Nodes.Integer, label="U Resolution") @@ -373,14 +373,12 @@ def nodegroup_surface_muscle(nw: NodeWrangler): ) join_geometry_1 = nw.new_node( - Nodes.JoinGeometry, input_kwargs={"Geometry": [switch.outputs[6], profilepart]} + Nodes.JoinGeometry, input_kwargs={"Geometry": [switch, profilepart]} ) - switch_1 = nw.new_node(Nodes.Switch, input_kwargs={1: True, 15: join_geometry_1}) + switch_1 = nw.new_node(Nodes.Switch, input_kwargs={0: True, 2: join_geometry_1}) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Geometry": switch_1.outputs[6]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"Geometry": switch_1}) @node_utils.to_nodegroup( diff --git a/infinigen/assets/utils/nodegroups/curve.py b/infinigen/assets/utils/nodegroups/curve.py index a01d0748d..6b7f1c683 100644 --- a/infinigen/assets/utils/nodegroups/curve.py +++ b/infinigen/assets/utils/nodegroups/curve.py @@ -286,7 +286,7 @@ def nodegroup_polar_bezier(nw: NodeWrangler): group_input = nw.new_node( Nodes.GroupInput, expose_input=[ - ("NodeSocketIntUnsigned", "Resolution", 32), + ("NodeSocketInt", "Resolution", 32), ("NodeSocketVector", "Origin", (0.0, 0.0, 0.0)), ("NodeSocketVector", "angles_deg", (0.0, 0.0, 0.0)), ("NodeSocketVector", "Seg Lengths", (0.3, 0.3, 0.3)), @@ -402,15 +402,15 @@ def nodegroup_polar_bezier(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["Do Bezier"], - 14: subdivide_curve_1, - 15: subdivide_curve, + 0: group_input.outputs["Do Bezier"], + 1: subdivide_curve_1, + 2: subdivide_curve, }, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Curve": switch.outputs[6], "Endpoint": polartocart_2}, + input_kwargs={"Curve": switch, "Endpoint": polartocart_2}, ) diff --git a/infinigen/assets/utils/nodegroups/geometry.py b/infinigen/assets/utils/nodegroups/geometry.py index 0129e213f..1d60569e6 100644 --- a/infinigen/assets/utils/nodegroups/geometry.py +++ b/infinigen/assets/utils/nodegroups/geometry.py @@ -79,7 +79,7 @@ def nodegroup_symmetric_clone(nw: NodeWrangler): Nodes.GroupInput, expose_input=[ ("NodeSocketGeometry", "Geometry", None), - ("NodeSocketVectorXYZ", "Scale", (1.0, -1.0, 1.0)), + ("NodeSocketVector", "Scale", (1.0, -1.0, 1.0)), ], ) diff --git a/infinigen/assets/utils/nodegroups/math.py b/infinigen/assets/utils/nodegroups/math.py index 1f0e321d7..c8eaac091 100644 --- a/infinigen/assets/utils/nodegroups/math.py +++ b/infinigen/assets/utils/nodegroups/math.py @@ -82,13 +82,13 @@ def nodegroup_clamp_or_wrap(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={0: group_input.outputs["Use Wrap"], 4: clamp, 5: wrap}, + input_kwargs={0: group_input.outputs["Use Wrap"], 1: clamp, 2: wrap}, attrs={"input_type": "INT"}, ) group_output = nw.new_node( Nodes.GroupOutput, - input_kwargs={"Output": switch.outputs[1]}, + input_kwargs={"Output": switch}, attrs={"is_active_output": True}, ) @@ -173,8 +173,8 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_1, - 8: group_input.outputs["Arg == 0"], - 9: group_input.outputs["Arg == 1"], + 1: group_input.outputs["Arg == 0"], + 2: group_input.outputs["Arg == 1"], }, attrs={"input_type": "VECTOR"}, ) @@ -189,21 +189,19 @@ def nodegroup_switch4(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: greater_equal_2, - 8: group_input.outputs["Arg == 2"], - 9: group_input.outputs["Arg == 3"], + 1: group_input.outputs["Arg == 2"], + 2: group_input.outputs["Arg == 3"], }, attrs={"input_type": "VECTOR"}, ) switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_equal, 8: switch_1.outputs[3], 9: switch_2.outputs[3]}, + input_kwargs={0: greater_equal, 1: switch_1, 2: switch_2}, attrs={"input_type": "VECTOR"}, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Output": switch.outputs[3]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"Output": switch}) @node_utils.to_nodegroup("nodegroup_deg2_rad", singleton=True, type="GeometryNodeTree") @@ -254,13 +252,11 @@ def nodegroup_aspect_to_dim(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, - input_kwargs={0: greater_than, 8: combine_xyz_1, 9: combine_xyz_2}, + input_kwargs={0: greater_than, 1: combine_xyz_1, 2: combine_xyz_2}, attrs={"input_type": "VECTOR"}, ) - group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"XY Scale": switch.outputs[3]} - ) + group_output = nw.new_node(Nodes.GroupOutput, input_kwargs={"XY Scale": switch}) @node_utils.to_nodegroup( diff --git a/infinigen/assets/utils/nodegroups/sculpt_v1.py b/infinigen/assets/utils/nodegroups/sculpt_v1.py index 3f0b359ff..644572f15 100644 --- a/infinigen/assets/utils/nodegroups/sculpt_v1.py +++ b/infinigen/assets/utils/nodegroups/sculpt_v1.py @@ -346,15 +346,13 @@ def nodegroup_curve_sculpt(nw: NodeWrangler): switch = nw.new_node( Nodes.Switch, input_kwargs={ - 1: group_input.outputs["SymmY"], - 14: group_input.outputs["Curve"], - 15: symmetric_clone.outputs["Both"], + 0: group_input.outputs["SymmY"], + 1: group_input.outputs["Curve"], + 2: symmetric_clone.outputs["Both"], }, ) - curve_to_mesh = nw.new_node( - Nodes.CurveToMesh, input_kwargs={"Curve": switch.outputs[6]} - ) + curve_to_mesh = nw.new_node(Nodes.CurveToMesh, input_kwargs={"Curve": switch}) geometry_proximity = nw.new_node( Nodes.Proximity, diff --git a/infinigen/core/init.py b/infinigen/core/init.py index 2fa680cbe..21265253d 100644 --- a/infinigen/core/init.py +++ b/infinigen/core/init.py @@ -295,20 +295,21 @@ def configure_blender( bpy.context.scene.cycles.motion_blur_position = "START" bpy.context.scene.render.motion_blur_shutter = motion_blur_shutter - addons = ["extra_mesh_objects", "real_snow", "antlandscape"] - for addon in addons: - try: - with butil.Suppress(): - bpy.ops.extensions.package_mark_clear_all() - bpy.ops.extensions.package_mark_set(pkg_id=addon, repo_index=-1) - bpy.ops.extensions.package_enable_not_installed() - logger.info(f"Add-on {addon} enabled.") - except ValueError | RuntimeError: - with butil.Suppress(): - bpy.ops.extensions.userpref_allow_online() - logger.info(f"Installing Add-on {addon}.") - with butil.Suppress(): - bpy.ops.extensions.package_install( - repo_index=0, pkg_id=addon, enable_on_install=True - ) - logger.info(f"Add-on {addon} Installed.") + addons = ["extra_mesh_objects", "real_snow", "antlandscape"] + for addon in addons: + long = f"bl_ext.blender_org.{addon}" + try: + with butil.Suppress(): + bpy.ops.preferences.addon_enable(module=long) + assert long in bpy.context.preferences.addons.keys() + logger.info(f"Add-on {addon} enabled.") + except RuntimeError: + with butil.Suppress(): + bpy.ops.extensions.userpref_allow_online() + logger.info(f"Installing Add-on {addon}.") + with butil.Suppress(): + bpy.ops.extensions.package_install( + repo_index=0, pkg_id=addon, enable_on_install=True + ) + assert long in bpy.context.preferences.addons.keys() + logger.info(f"Add-on {addon} Installed.") diff --git a/infinigen/core/nodes/node_info.py b/infinigen/core/nodes/node_info.py index db409f1e9..117554476 100644 --- a/infinigen/core/nodes/node_info.py +++ b/infinigen/core/nodes/node_info.py @@ -416,3 +416,11 @@ class Nodes: "FLOAT_COLOR": "color", "BOOLEAN": "value", } + + +def map_socket(socket): + match socket: + case "NodeSocketVectorEuler": + return "NodeSocketVector" + case _: + return socket diff --git a/infinigen/core/nodes/node_wrangler.py b/infinigen/core/nodes/node_wrangler.py index 2fe90ffea..823b9c3ba 100644 --- a/infinigen/core/nodes/node_wrangler.py +++ b/infinigen/core/nodes/node_wrangler.py @@ -19,7 +19,7 @@ import numpy as np from infinigen.core.nodes import node_info -from infinigen.core.nodes.node_info import Nodes +from infinigen.core.nodes.node_info import Nodes, map_socket from infinigen.core.util.random import random_vector3 from .compatibility import COMPATIBILITY_MAPPINGS @@ -174,7 +174,7 @@ def new_node( input_item, list ), "Multi-input sockets to GroupOutput nodes are impossible" if input_socket_name not in node.inputs: - nodeclass = infer_output_socket(input_item).bl_idname + nodeclass = map_socket(infer_output_socket(input_item).bl_idname) self.node_group.interface.new_socket( name=input_socket_name, in_out="OUTPUT", socket_type=nodeclass ) diff --git a/infinigen/core/placement/instance_scatter.py b/infinigen/core/placement/instance_scatter.py index 64b0eb321..c9e8cbfc7 100644 --- a/infinigen/core/placement/instance_scatter.py +++ b/infinigen/core/placement/instance_scatter.py @@ -232,7 +232,7 @@ def geo_instance_scatter( rotation_val = nw.new_node( Nodes.RotateEuler, [rotation_val], - {"type": "AXIS_ANGLE", "space": "LOCAL"}, + {"rotation_type": "AXIS_ANGLE", "space": "LOCAL"}, input_kwargs={"Axis": Vector((0.0, 0.0, 1.0)), "Angle": nw.uniform(0, 1e4)}, ) if rotation_offset is not None: diff --git a/infinigen/core/util/blender.py b/infinigen/core/util/blender.py index 20912b2f5..5a60d048f 100644 --- a/infinigen/core/util/blender.py +++ b/infinigen/core/util/blender.py @@ -555,10 +555,11 @@ def get_camera_res(): def set_geomod_inputs(mod, inputs: dict): assert mod.type == "NODES" for k, v in inputs.items(): - if k not in mod.node_group.inputs: + inputs = [s for s in mod.node_group.interface.items_tree if s.in_out == "INPUT"] + if not any(k == i.name for i in inputs): raise KeyError(f"Couldnt find {k=} in {mod.node_group.inputs.keys()=}") - soc = mod.node_group.inputs[k] + soc = next(i for i in inputs if k == i.name) if not hasattr(soc, "default_value"): if v is not None: @@ -571,6 +572,8 @@ def set_geomod_inputs(mod, inputs: dict): if isinstance(soc.default_value, (float, int)): v = type(soc.default_value)(v) + if isinstance(v, np.ndarray): + v = v.tolist() try: mod[soc.identifier] = v @@ -639,10 +642,10 @@ def import_mesh(path, **kwargs): ext = ext.lower().strip() funcs = { - "obj": bpy.ops.import_scene.obj, + "obj": bpy.ops.wm.obj_import, "fbx": bpy.ops.import_scene.fbx, "stl": bpy.ops.import_mesh.stl, - "ply": bpy.ops.import_mesh.ply, + "ply": bpy.ops.wm.ply_import, "usdc": bpy.ops.wm.usd_import, } @@ -655,12 +658,15 @@ def import_mesh(path, **kwargs): with Suppress(): funcs[ext](filepath=str(path), **kwargs) - if len(bpy.context.selected_objects) > 1: + if len(bpy.context.selected_objects) > 1 if ext != "usdc" else 2: print( f"Warning: {ext.upper()} Import produced {len(bpy.context.selected_objects)} objects, " f"but only the first is returned by import_obj" ) - return bpy.context.selected_objects[0] + if ext != "usdc": + return bpy.context.selected_objects[0] + else: + return next(o for o in bpy.context.selected_objects if o.type != "EMPTY") def boolean(objs, mode="UNION", verbose=False): diff --git a/infinigen/infinigen_gpl b/infinigen/infinigen_gpl index 78d34b2d4..e74d48869 160000 --- a/infinigen/infinigen_gpl +++ b/infinigen/infinigen_gpl @@ -1 +1 @@ -Subproject commit 78d34b2d4b7bd373d22b455dfc59716a78e3f9dd +Subproject commit e74d48869e86e344ab31de6916c78a8d0b72cb37 diff --git a/infinigen/tools/export.py b/infinigen/tools/export.py index 040c47b9b..bfd0889ce 100644 --- a/infinigen/tools/export.py +++ b/infinigen/tools/export.py @@ -19,7 +19,7 @@ BAKE_TYPES = { "DIFFUSE": "Base Color", "ROUGHNESS": "Roughness", -} # 'EMIT':'Emission' # "GLOSSY": 'Specular IOR Level', 'TRANSMISSION':'Transmission Weight' don't export +} # 'EMIT':'Emission Color' # "GLOSSY": 'Specular IOR Level', 'TRANSMISSION':'Transmission Weight' don't export SPECIAL_BAKE = {"METAL": "Metallic", "NORMAL": "Normal"} ALL_BAKE = BAKE_TYPES | SPECIAL_BAKE diff --git a/infinigen_examples/generate_individual_assets.py b/infinigen_examples/generate_individual_assets.py index 03fa7ea55..19f17b180 100644 --- a/infinigen_examples/generate_individual_assets.py +++ b/infinigen_examples/generate_individual_assets.py @@ -167,7 +167,7 @@ def build_scene_surface(args, factory_name, idx): if not hasattr(scatter, "apply"): raise ValueError(f"{scatter} has no apply()") - if args.dryun: + if args.dryrun: return bpy.ops.mesh.primitive_grid_add( diff --git a/tests/assets/test_meshes_basic.py b/tests/assets/test_meshes_basic.py index 72e13a70d..f790022d7 100644 --- a/tests/assets/test_meshes_basic.py +++ b/tests/assets/test_meshes_basic.py @@ -10,6 +10,7 @@ import pytest from infinigen.core import tagging +from infinigen.core.init import configure_blender from infinigen.core.util import blender as butil from infinigen.core.util.test_utils import import_item, load_txt_list, setup_gin @@ -80,6 +81,7 @@ def check_factory_runs(fac_class, seed1=0, seed2=0, distance_m=50): ) def test_nature_factory_runs(pathspec, **kwargs): setup_gin("infinigen_examples/configs_nature", configs=["base_nature.gin"]) + configure_blender() fac_class = import_item(pathspec) check_factory_runs(fac_class, **kwargs) diff --git a/tests/assets/test_scatters_basic.py b/tests/assets/test_scatters_basic.py index adaf1af51..39b2f6d63 100644 --- a/tests/assets/test_scatters_basic.py +++ b/tests/assets/test_scatters_basic.py @@ -6,6 +6,7 @@ import pytest +from infinigen.core.init import configure_blender from infinigen.core.util import blender as butil from infinigen.core.util.test_utils import import_item, load_txt_list, setup_gin @@ -20,5 +21,6 @@ def check_scatter_runs(pathspec): @pytest.mark.parametrize("pathspec", load_txt_list("tests/assets/list_scatters.txt")) def test_scatter_runs(pathspec, **kwargs): + configure_blender() setup_gin("infinigen_examples/configs_nature", ["base_nature.gin"]) check_scatter_runs(pathspec) diff --git a/tests/tools/test_export.py b/tests/tools/test_export.py index d3f63fadf..58d48c5d0 100644 --- a/tests/tools/test_export.py +++ b/tests/tools/test_export.py @@ -62,6 +62,8 @@ def test_export_curr_scene(format, tmp_path): for obj in bpy.data.objects: if obj.name == "World": continue + if obj.type == "EMPTY": + continue total_polys += len(obj.data.polygons) assert total_polys == poly_count1 + poly_count2 From 5334df87a6a23de392029808c7f946a924f19ab7 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Sat, 14 Sep 2024 15:36:50 -0400 Subject: [PATCH 06/15] Additional Fixes --- infinigen/assets/lighting/holdout_lighting.py | 2 ++ infinigen/assets/materials/art.py | 4 +++ .../materials/fabrics/general_fabric.py | 6 ++-- infinigen/assets/materials/fabrics/velvet.py | 2 +- infinigen/assets/objects/organizer/basket.py | 2 +- .../objects/seating/chairs/bar_chair.py | 2 +- infinigen/assets/objects/seating/sofa.py | 8 ++--- .../assets/objects/tables/table_utils.py | 2 +- infinigen/core/init.py | 29 +++++++++---------- .../datagen/customgt/dependencies/fast_obj | 1 + .../datagen/customgt/dependencies/indicators | 1 + .../customgt/dependencies/tinycolormap | 1 + infinigen/infinigen_gpl | 2 +- 13 files changed, 34 insertions(+), 28 deletions(-) create mode 160000 infinigen/datagen/customgt/dependencies/fast_obj create mode 160000 infinigen/datagen/customgt/dependencies/indicators create mode 160000 infinigen/datagen/customgt/dependencies/tinycolormap diff --git a/infinigen/assets/lighting/holdout_lighting.py b/infinigen/assets/lighting/holdout_lighting.py index 315a1822e..4a71ebbcc 100644 --- a/infinigen/assets/lighting/holdout_lighting.py +++ b/infinigen/assets/lighting/holdout_lighting.py @@ -40,6 +40,8 @@ def holdout_lighting( def add_lighting(): nw = NodeWrangler(bpy.context.scene.world.node_tree) + if not os.path.exists(HOLDOUT_RESOURCES): + return surface = holdout_lighting(nw) nw.new_node(Nodes.WorldOutput, input_kwargs={"Surface": surface}) bpy.context.scene.world.cycles_visibility.camera = False diff --git a/infinigen/assets/materials/art.py b/infinigen/assets/materials/art.py index c82f33432..6b98d7879 100644 --- a/infinigen/assets/materials/art.py +++ b/infinigen/assets/materials/art.py @@ -78,6 +78,10 @@ def shader_art_composite(nw: NodeWrangler, **kwargs): return shader_art_composite + @classmethod + def make_sphere(cls): + return text.make_sphere() + class ArtRug(ArtComposite): @property diff --git a/infinigen/assets/materials/fabrics/general_fabric.py b/infinigen/assets/materials/fabrics/general_fabric.py index 938a44489..d8ac97a23 100644 --- a/infinigen/assets/materials/fabrics/general_fabric.py +++ b/infinigen/assets/materials/fabrics/general_fabric.py @@ -63,7 +63,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): mix = nw.new_node( Nodes.Mix, - input_kwargs={1: map_range.outputs["Result"], 2: map_range_1.outputs["Result"]}, + input_kwargs={6: map_range.outputs["Result"], 7: map_range_1.outputs["Result"]}, attrs={"data_type": "RGBA"}, ) @@ -130,7 +130,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): mix_4 = nw.new_node( Nodes.Mix, - input_kwargs={0: less_than, 1: mix_2.outputs[2], 2: group_input["Color1"]}, + input_kwargs={0: less_than, 6: mix_2.outputs[2], 7: group_input["Color1"]}, attrs={"data_type": "RGBA"}, ) @@ -175,7 +175,7 @@ def func_fabric(nw: NodeWrangler, **kwargs): mix_1 = nw.new_node( Nodes.Mix, - input_kwargs={1: musgrave_texture, 2: mix.outputs[2]}, + input_kwargs={6: musgrave_texture, 7: mix.outputs[2]}, attrs={"data_type": "RGBA"}, ) diff --git a/infinigen/assets/materials/fabrics/velvet.py b/infinigen/assets/materials/fabrics/velvet.py index 1f7c2739a..22bf81978 100644 --- a/infinigen/assets/materials/fabrics/velvet.py +++ b/infinigen/assets/materials/fabrics/velvet.py @@ -28,7 +28,7 @@ def shader_velvet(nw: NodeWrangler, **kwargs): mix_6 = nw.new_node( Nodes.Mix, - input_kwargs={0: 0.1125, 1: voronoi_texture.outputs["Color"]}, + input_kwargs={0: 0.1125, 6: voronoi_texture.outputs["Color"]}, attrs={"data_type": "RGBA"}, ) diff --git a/infinigen/assets/objects/organizer/basket.py b/infinigen/assets/objects/organizer/basket.py index 171c0a947..733346241 100644 --- a/infinigen/assets/objects/organizer/basket.py +++ b/infinigen/assets/objects/organizer/basket.py @@ -373,7 +373,7 @@ def geometry_nodes(nw: NodeWrangler, **kwargs): multiply = nw.new_node( Nodes.Math, - input_kwargs={0: thickness, 2: 0.2500}, + input_kwargs={0: thickness, 1: 0.2500}, attrs={"operation": "MULTIPLY"}, ) diff --git a/infinigen/assets/objects/seating/chairs/bar_chair.py b/infinigen/assets/objects/seating/chairs/bar_chair.py index 9f765024b..cbdaab0a9 100644 --- a/infinigen/assets/objects/seating/chairs/bar_chair.py +++ b/infinigen/assets/objects/seating/chairs/bar_chair.py @@ -194,7 +194,7 @@ def create_asset(self, **params): obj = bpy.context.active_object surface.add_geomod( - obj, geometry_assemble_chair, apply=True, input_kwargs=self.params + obj, geometry_assemble_chair, apply=False, input_kwargs=self.params ) tagging.tag_system.relabel_obj(obj) diff --git a/infinigen/assets/objects/seating/sofa.py b/infinigen/assets/objects/seating/sofa.py index 79e6ab97e..1274b52df 100644 --- a/infinigen/assets/objects/seating/sofa.py +++ b/infinigen/assets/objects/seating/sofa.py @@ -642,7 +642,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): equal_1 = nw.new_node( Nodes.Compare, - input_kwargs={0: 4.0000, 2: reroute_13, 3: 4}, + input_kwargs={2: reroute_13, 3: 4}, attrs={"operation": "EQUAL", "data_type": "INT"}, ) @@ -962,7 +962,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): equal_2 = nw.new_node( Nodes.Compare, - input_kwargs={1: 4.0000, 2: reroute_10, 3: 4}, + input_kwargs={2: reroute_10, 3: 4}, attrs={"operation": "EQUAL", "data_type": "INT"}, ) @@ -982,7 +982,7 @@ def nodegroup_sofa_geometry(nw: NodeWrangler): equal_3 = nw.new_node( Nodes.Compare, - input_kwargs={1: 4.0000, 2: reroute_10, 3: 4}, + input_kwargs={2: reroute_10, 3: 4}, attrs={"operation": "EQUAL", "data_type": "INT"}, ) @@ -1446,7 +1446,7 @@ def create_placeholder(self, **_): ng_inputs={ **self.params, }, - apply=True, + apply=False, ) tagging.tag_system.relabel_obj(obj) surface.add_material(obj, self.sofa_fabric) diff --git a/infinigen/assets/objects/tables/table_utils.py b/infinigen/assets/objects/tables/table_utils.py index 511ee2e3e..68c08783f 100644 --- a/infinigen/assets/objects/tables/table_utils.py +++ b/infinigen/assets/objects/tables/table_utils.py @@ -586,7 +586,7 @@ def nodegroup_create_legs_and_strechers(nw: NodeWrangler): switch_1 = nw.new_node( Nodes.Switch, - input_kwargs={0: group_input.outputs["Keep Legs"], 1: realize_instances}, + input_kwargs={0: group_input.outputs["Keep Legs"], 2: realize_instances}, ) multiply_1 = nw.new_node( diff --git a/infinigen/core/init.py b/infinigen/core/init.py index 21265253d..dbe2c37c3 100644 --- a/infinigen/core/init.py +++ b/infinigen/core/init.py @@ -1,7 +1,6 @@ # Copyright (C) 2023, Princeton University. # This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory # of this source tree. - import ast import logging import os @@ -15,12 +14,12 @@ os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1" # This must be done BEFORE import cv2. # See https://github.com/opencv/opencv/issues/21326#issuecomment-1008517425 +import addon_utils import gin import numpy as np from numpy.random import randint import infinigen -from infinigen.core.util import blender as butil from infinigen.core.util.logging import LogLevel from infinigen.core.util.math import int_hash from infinigen.core.util.organization import Task @@ -298,18 +297,16 @@ def configure_blender( addons = ["extra_mesh_objects", "real_snow", "antlandscape"] for addon in addons: long = f"bl_ext.blender_org.{addon}" - try: - with butil.Suppress(): - bpy.ops.preferences.addon_enable(module=long) - assert long in bpy.context.preferences.addons.keys() - logger.info(f"Add-on {addon} enabled.") - except RuntimeError: - with butil.Suppress(): - bpy.ops.extensions.userpref_allow_online() + all_addons = set(a.__name__ for a in addon_utils.modules(refresh=True)) + if long in all_addons: + bpy.ops.preferences.addon_enable(module=long) + else: + bpy.ops.extensions.userpref_allow_online() logger.info(f"Installing Add-on {addon}.") - with butil.Suppress(): - bpy.ops.extensions.package_install( - repo_index=0, pkg_id=addon, enable_on_install=True - ) - assert long in bpy.context.preferences.addons.keys() - logger.info(f"Add-on {addon} Installed.") + bpy.ops.extensions.repo_sync(repo_index=0) + bpy.ops.extensions.package_install( + repo_index=0, pkg_id=addon, enable_on_install=True + ) + bpy.ops.preferences.addon_enable(module=long) + assert long in bpy.context.preferences.addons.keys() + logger.info(f"{addon} enabled.") diff --git a/infinigen/datagen/customgt/dependencies/fast_obj b/infinigen/datagen/customgt/dependencies/fast_obj new file mode 160000 index 000000000..85778da5f --- /dev/null +++ b/infinigen/datagen/customgt/dependencies/fast_obj @@ -0,0 +1 @@ +Subproject commit 85778da5fc320b7e52885f8e869edc079695cc79 diff --git a/infinigen/datagen/customgt/dependencies/indicators b/infinigen/datagen/customgt/dependencies/indicators new file mode 160000 index 000000000..a5bc05f32 --- /dev/null +++ b/infinigen/datagen/customgt/dependencies/indicators @@ -0,0 +1 @@ +Subproject commit a5bc05f32a9c719535054b7fa5306ce5c8d055d8 diff --git a/infinigen/datagen/customgt/dependencies/tinycolormap b/infinigen/datagen/customgt/dependencies/tinycolormap new file mode 160000 index 000000000..67198d2b2 --- /dev/null +++ b/infinigen/datagen/customgt/dependencies/tinycolormap @@ -0,0 +1 @@ +Subproject commit 67198d2b2b48ca5e97600c83b5c0f2310cfd4c03 diff --git a/infinigen/infinigen_gpl b/infinigen/infinigen_gpl index e74d48869..10c1d76f5 160000 --- a/infinigen/infinigen_gpl +++ b/infinigen/infinigen_gpl @@ -1 +1 @@ -Subproject commit e74d48869e86e344ab31de6916c78a8d0b72cb37 +Subproject commit 10c1d76f5c35003e919be7265185c9c355e3b70c From 419f2f4ef7cd9bf62364151b222562065467ac58 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Mon, 16 Sep 2024 03:01:34 -0400 Subject: [PATCH 07/15] Fix inputs --- .../objects/creatures/parts/ridged_fin.py | 14 ++----- .../objects/creatures/util/part_util.py | 11 ++--- infinigen/assets/objects/seating/sofa.py | 2 +- .../assets/utils/extract_nodegroup_parts.py | 8 ++-- .../core/nodes/node_transpiler/transpiler.py | 3 +- infinigen/core/nodes/node_wrangler.py | 13 ++++-- infinigen/core/surface.py | 40 ++++++++----------- infinigen/core/util/blender.py | 8 ++-- .../terrain/surface_kernel/kernelizer.py | 7 ++-- infinigen/terrain/utils/mesh.py | 3 +- 10 files changed, 52 insertions(+), 57 deletions(-) diff --git a/infinigen/assets/objects/creatures/parts/ridged_fin.py b/infinigen/assets/objects/creatures/parts/ridged_fin.py index 60f7dd7f1..20d001ca5 100644 --- a/infinigen/assets/objects/creatures/parts/ridged_fin.py +++ b/infinigen/assets/objects/creatures/parts/ridged_fin.py @@ -12,7 +12,7 @@ from infinigen.assets.materials.utils.surface_utils import sample_range from infinigen.assets.objects.creatures.util.creature import Part, PartFactory from infinigen.core.nodes import node_utils -from infinigen.core.nodes.node_wrangler import Nodes, NodeWrangler +from infinigen.core.nodes.node_wrangler import Nodes, NodeWrangler, ng_outputs from infinigen.core.tagging import tag_object from infinigen.core.util import blender as butil @@ -649,17 +649,9 @@ def make_part(self, params): ) butil.set_geomod_inputs(mod, params) - id1 = next( - s - for s in mod.node_group.interface.items_tree - if s.in_out == "OUTPUT" and s.name == "Bump" - ).identifier + id1 = ng_outputs(mod.node_group)["Bump"].identifier mod[f"{id1}_attribute_name"] = "Bump" - id2 = next( - s - for s in mod.node_group.interface.items_tree - if s.in_out == "OUTPUT" and s.name == "BumpMask" - ).identifier + id2 = ng_outputs(mod.node_group)["BumpMask"].identifier mod[f"{id2}_attribute_name"] = "BumpMask" butil.apply_modifiers(fin, mod) diff --git a/infinigen/assets/objects/creatures/util/part_util.py b/infinigen/assets/objects/creatures/util/part_util.py index 49b5b5167..b61c205fb 100644 --- a/infinigen/assets/objects/creatures/util/part_util.py +++ b/infinigen/assets/objects/creatures/util/part_util.py @@ -15,6 +15,7 @@ ) from infinigen.assets.utils.extract_nodegroup_parts import extract_nodegroup_geo from infinigen.assets.utils.geometry import nurbs +from infinigen.core.nodes.node_wrangler import ng_outputs from infinigen.core.util import blender as butil @@ -29,11 +30,11 @@ def nodegroup_to_part( ng = nodegroup_func(**kwargs) else: ng = nodegroup_func() - geo_outputs = [ - s - for s in ng.interface.items_tree - if s.in_out == "OUTPUT" and s.bl_socket_idname == "NodeSocketGeometry" - ] + geo_outputs = { + o + for o in ng_outputs(ng).values() + if o.bl_socket_idname == "NodeSocketGeometry" + } objs = { o.name: extract_nodegroup_geo(base_obj, ng, o.name, ng_params=params) for o in geo_outputs diff --git a/infinigen/assets/objects/seating/sofa.py b/infinigen/assets/objects/seating/sofa.py index 1274b52df..ee0516dce 100644 --- a/infinigen/assets/objects/seating/sofa.py +++ b/infinigen/assets/objects/seating/sofa.py @@ -1446,7 +1446,7 @@ def create_placeholder(self, **_): ng_inputs={ **self.params, }, - apply=False, + apply=True, ) tagging.tag_system.relabel_obj(obj) surface.add_material(obj, self.sofa_fabric) diff --git a/infinigen/assets/utils/extract_nodegroup_parts.py b/infinigen/assets/utils/extract_nodegroup_parts.py index afa6e5e0c..8062e967b 100644 --- a/infinigen/assets/utils/extract_nodegroup_parts.py +++ b/infinigen/assets/utils/extract_nodegroup_parts.py @@ -10,14 +10,14 @@ Nodes, NodeWrangler, geometry_node_group_empty_new, + ng_inputs, + ng_outputs, ) from infinigen.core.util import blender as butil def extract_nodegroup_geo(target_obj, nodegroup, k, ng_params=None): - inputs = [s.name for s in nodegroup.interface.items_tree if s.in_out == "INPUT"] - outputs = [s.name for s in nodegroup.interface.items_tree if s.in_out == "OUTPUT"] - assert k in outputs + assert k in ng_outputs(nodegroup) assert target_obj.type == "MESH" vert = butil.spawn_vert("extract_nodegroup_geo.temp") @@ -31,7 +31,7 @@ def extract_nodegroup_geo(target_obj, nodegroup, k, ng_params=None): obj_inp = nw.new_node(Nodes.ObjectInfo, [target_obj]) group_input_kwargs = {**ng_params} - if "Geometry" in inputs: + if "Geometry" in ng_inputs(nodegroup): group_input_kwargs["Geometry"] = obj_inp.outputs["Geometry"] group = nw.new_node(nodegroup.name, input_kwargs=group_input_kwargs) diff --git a/infinigen/core/nodes/node_transpiler/transpiler.py b/infinigen/core/nodes/node_transpiler/transpiler.py index 80b23f9e7..79a58b484 100644 --- a/infinigen/core/nodes/node_transpiler/transpiler.py +++ b/infinigen/core/nodes/node_transpiler/transpiler.py @@ -17,6 +17,7 @@ import numpy as np from infinigen.core.nodes.node_info import OUTPUT_NODE_IDS, SINGLETON_NODES, Nodes +from infinigen.core.nodes.node_wrangler import ng_inputs logger = logging.getLogger(__name__) @@ -666,7 +667,7 @@ def create_node(node_tree, node, memo): # Special case: input node if node.bl_idname == Nodes.GroupInput: all_inps = [] - for inp in node_tree.inputs: + for inp in ng_inputs(node_tree).values(): repr_val, targets = ( represent_default_value(inp.default_value, simple=False) if hasattr(inp, "default_value") diff --git a/infinigen/core/nodes/node_wrangler.py b/infinigen/core/nodes/node_wrangler.py index 823b9c3ba..602592dbf 100644 --- a/infinigen/core/nodes/node_wrangler.py +++ b/infinigen/core/nodes/node_wrangler.py @@ -32,6 +32,14 @@ class NodeMisuseWarning(UserWarning): pass +def ng_inputs(node_group): + return {s.name: s for s in node_group.interface.items_tree if s.in_out == "INPUT"} + + +def ng_outputs(node_group): + return {s.name: s for s in node_group.interface.items_tree if s.in_out == "OUTPUT"} + + # This is for Blender 3.3 because of the nodetree change def geometry_node_group_empty_new(): group = bpy.data.node_groups.new("Geometry Nodes", "GeometryNodeTree") @@ -225,10 +233,7 @@ def expose_input( group_input = self.new_node(Nodes.GroupInput) # will reuse singleton - if any( - s.name == name and s.in_out == "INPUT" - for s in self.node_group.interface.items_tree - ): + if name in ng_inputs(self.node_group): assert len([o for o in group_input.outputs if o.name == name]) == 1 return group_input.outputs[name] diff --git a/infinigen/core/surface.py b/infinigen/core/surface.py index b7e3d56b0..492d29131 100644 --- a/infinigen/core/surface.py +++ b/infinigen/core/surface.py @@ -24,6 +24,8 @@ Nodes, NodeWrangler, geometry_node_group_empty_new, + ng_inputs, + ng_outputs, ) from infinigen.core.nodes.utils import infer_output_socket, isnode from infinigen.core.util import blender as butil @@ -390,39 +392,31 @@ def add_geomod( else: mod.node_group = ng - outputs = [ - s for s in mod.node_group.interface.items_tree if s.in_out == "OUTPUT" + non_geometries = [ + o + for o in ng_outputs(mod.node_group).values() + if o.socket_type != "NodeSocketGeometry" ] - identifiers = [ - outputs[i].identifier - for i in range(len(outputs)) - if outputs[i].socket_type != "NodeSocketGeometry" - ] - if len(identifiers) != len(attributes): + if len(non_geometries) != len(attributes): raise Exception( - f"has {len(identifiers)} identifiers, but {len(attributes)} attributes. Specifically, " - f"{identifiers=} and {attributes=}" + f"has {len(non_geometries)} identifiers, but {len(attributes)} attributes. Specifically, " + f"{non_geometries=} and {attributes=}" ) - for id, att_name in zip(identifiers, attributes): + for o, att_name in zip(non_geometries, attributes): # attributes are a 1-indexed list, and Geometry is the first element, so we start from 2 # while f'Output_{i}_attribute_name' not in - mod[id + "_attribute_name"] = att_name - os = [ - outputs[i] - for i in range(len(outputs)) - if outputs[i].socket_type != "NodeSocketGeometry" - ] - for o, domain in zip(os, domains): + mod[o.identifier + "_attribute_name"] = att_name + for o, domain in zip(non_geometries, domains): o.attribute_domain = domain - inputs = [s for s in mod.node_group.interface.items_tree if s.in_out == "INPUT"] + inputs = ng_inputs(mod.node_group) if not any(att_name is None for att_name in input_attributes): raise Exception("None should be provided for Geometry inputs.") - for i, att_name in zip(inputs, input_attributes): - id = i.identifier + for i, att_name in zip(inputs.values(), input_attributes): + o = i.identifier if att_name is not None: - mod[f"{id}_use_attribute"] = True - mod[f"{id}_attribute_name"] = att_name + mod[f"{o}_use_attribute"] = True + mod[f"{o}_attribute_name"] = att_name if apply: for obj in objs: diff --git a/infinigen/core/util/blender.py b/infinigen/core/util/blender.py index 5a60d048f..c22f88b51 100644 --- a/infinigen/core/util/blender.py +++ b/infinigen/core/util/blender.py @@ -22,6 +22,7 @@ from infinigen.core.nodes.node_info import DATATYPE_DIMS, DATATYPE_FIELDS +from ..nodes.node_wrangler import ng_inputs from . import math as mutil from .logging import Suppress @@ -555,11 +556,10 @@ def get_camera_res(): def set_geomod_inputs(mod, inputs: dict): assert mod.type == "NODES" for k, v in inputs.items(): - inputs = [s for s in mod.node_group.interface.items_tree if s.in_out == "INPUT"] - if not any(k == i.name for i in inputs): + inputs = ng_inputs(mod.node_group) + if k not in inputs: raise KeyError(f"Couldnt find {k=} in {mod.node_group.inputs.keys()=}") - - soc = next(i for i in inputs if k == i.name) + soc = inputs[k] if not hasattr(soc, "default_value"): if v is not None: diff --git a/infinigen/terrain/surface_kernel/kernelizer.py b/infinigen/terrain/surface_kernel/kernelizer.py index 95ac6cbd8..2db9dc7d4 100644 --- a/infinigen/terrain/surface_kernel/kernelizer.py +++ b/infinigen/terrain/surface_kernel/kernelizer.py @@ -9,6 +9,7 @@ import numpy as np +from infinigen.core.nodes.node_wrangler import ng_inputs, ng_outputs from infinigen.terrain.utils import ( NODE_ATTRS_AVAILABLE, NODE_FUNCTIONS, @@ -48,7 +49,7 @@ def my_getattr(x, a): class Kernelizer: def get_inputs(self, node_tree): inputs = OrderedDict() - for node_input in node_tree.inputs: + for node_input in ng_inputs(node_tree).values(): if node_input.type != SocketType.Geometry: assert node_input.type != SocketType.Image inputs[node_input.identifier] = SOCKETTYPE_KERNEL[node_input.type] @@ -59,7 +60,7 @@ def get_output(self, node_tree): for node in node_tree.nodes: if node.bl_idname == Nodes.SetPosition: outputs[Vars.Offset] = KernelDataType.float3 - for node_output in node_tree.outputs: + for node_output in ng_outputs(node_tree).values(): if node_output.type != SocketType.Geometry: outputs[node_output.identifier] = SOCKETTYPE_KERNEL[node_output.type] return outputs @@ -416,7 +417,7 @@ def __call__(self, modifier): code, imp_inputs, outputs = self.execute_node_tree( node_tree, collective_style=True ) - for nodeoutput in node_tree.outputs: + for nodeoutput in ng_outputs(node_tree).values(): id = nodeoutput.identifier if id != "Output_1": # not Geometry code = re.sub(rf"\b{id}\b", modifier[f"{id}_attribute_name"], code) diff --git a/infinigen/terrain/utils/mesh.py b/infinigen/terrain/utils/mesh.py index 77b2dd9f6..bc390f216 100644 --- a/infinigen/terrain/utils/mesh.py +++ b/infinigen/terrain/utils/mesh.py @@ -16,6 +16,7 @@ from infinigen.core.util.logging import Timer from infinigen.core.util.organization import Attributes +from ...core.nodes.node_wrangler import ng_inputs from .camera import getK from .ctype_util import ASDOUBLE, ASINT, load_cdll from .kernelizer_util import ATTRTYPE_DIMS, ATTRTYPE_FIELDS, NPTYPEDIM_ATTR, Vars @@ -427,7 +428,7 @@ def move_modifier(target_obj, m): with Timer(f"copying {m.name}"): modifier = target_obj.modifiers.new(m.name, "NODES") modifier.node_group = m.node_group - for i, inp in enumerate(modifier.node_group.inputs): + for i, inp in enumerate(ng_inputs(modifier.node_group).values()): if i > 0: id = inp.identifier modifier[f"{id}_attribute_name"] = inp.name From 6c4d2f306c36857c39ddd9e3a43d6993e1099d58 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Mon, 23 Sep 2024 19:08:18 -0400 Subject: [PATCH 08/15] Additional Fixes, fix exr output --- infinigen/core/nodes/node_info.py | 1 + infinigen/core/rendering/post_render.py | 21 +++++++++++++--- infinigen/core/rendering/render.py | 25 +++++++++++++------ infinigen/core/util/blender.py | 7 ++++-- .../terrain/surface_kernel/kernelizer.py | 17 +++++++------ infinigen/terrain/utils/kernelizer_util.py | 8 ++++++ 6 files changed, 58 insertions(+), 21 deletions(-) diff --git a/infinigen/core/nodes/node_info.py b/infinigen/core/nodes/node_info.py index 117554476..8144a0b4e 100644 --- a/infinigen/core/nodes/node_info.py +++ b/infinigen/core/nodes/node_info.py @@ -177,6 +177,7 @@ class Nodes: WorldOutput = "ShaderNodeOutputWorld" Composite = "CompositorNodeComposite" Viewer = "CompositorNodeViewer" + CompositorMixRGB = "CompositorNodeMixRGB" # Point DistributePointsOnFaces = "GeometryNodeDistributePointsOnFaces" diff --git a/infinigen/core/rendering/post_render.py b/infinigen/core/rendering/post_render.py index d0b0b79ae..9a1f2aeed 100644 --- a/infinigen/core/rendering/post_render.py +++ b/infinigen/core/rendering/post_render.py @@ -8,6 +8,8 @@ import logging import os +import OpenEXR + # ruff: noqa: E402 os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1" # This must be done BEFORE import cv2. @@ -30,8 +32,21 @@ def load_exr(path): load_flow = load_exr -def load_depth(p): - return load_exr(p)[..., 0] +def load_single_channel(p): + file = OpenEXR.InputFile(str(p)) + channel, channel_type = next(iter(file.header()["channels"].items())) + match str(channel_type.type): + case "FLOAT": + np_type = np.float32 + case _: + np_type = np.uint8 + data = np.frombuffer(file.channel(channel, channel_type.type), np_type) + dw = file.header()["dataWindow"] + sz = (dw.max.x - dw.min.x + 1, dw.max.y - dw.min.y + 1) + return data.reshape(sz) + + +load_depth = load_single_channel def load_normals(p): @@ -39,7 +54,7 @@ def load_normals(p): def load_seg_mask(p): - return load_exr(p)[..., 2].astype(np.int64) + return load_single_channel(p).astype(np.int64) def load_uniq_inst(p): diff --git a/infinigen/core/rendering/render.py b/infinigen/core/rendering/render.py index 75bfa9da9..43cc44d8c 100644 --- a/infinigen/core/rendering/render.py +++ b/infinigen/core/rendering/render.py @@ -192,14 +192,23 @@ def configure_compositor_output( slot_input = file_output_node.file_slots.new(socket_name) render_socket = render_layers.outputs[socket_name] - if viewlayer_pass == "vector": - separate_color = nw.new_node(Nodes.CompSeparateColor, [render_socket]) - comnbine_color = nw.new_node( - Nodes.CompCombineColor, [0, (separate_color, 3), (separate_color, 2), 0] - ) - nw.links.new(comnbine_color.outputs[0], slot_input) - else: - nw.links.new(render_socket, slot_input) + match viewlayer_pass: + case "vector": + separate_color = nw.new_node(Nodes.CompSeparateColor, [render_socket]) + comnbine_color = nw.new_node( + Nodes.CompCombineColor, + [0, (separate_color, 3), (separate_color, 2), 0], + ) + nw.links.new(comnbine_color.outputs[0], slot_input) + case "normal": + color = nw.new_node( + Nodes.CompositorMixRGB, + [None, render_socket, (0, 0, 0, 0)], + attrs={"blend_type": "ADD"}, + ).outputs[0] + nw.links.new(color, slot_input) + case _: + nw.links.new(render_socket, slot_input) file_slot_list.append(file_output_node.file_slots[slot_input.name]) slot_input = default_file_output_node.file_slots["Image"] diff --git a/infinigen/core/util/blender.py b/infinigen/core/util/blender.py index c22f88b51..86a3a661d 100644 --- a/infinigen/core/util/blender.py +++ b/infinigen/core/util/blender.py @@ -22,7 +22,6 @@ from infinigen.core.nodes.node_info import DATATYPE_DIMS, DATATYPE_FIELDS -from ..nodes.node_wrangler import ng_inputs from . import math as mutil from .logging import Suppress @@ -556,7 +555,11 @@ def get_camera_res(): def set_geomod_inputs(mod, inputs: dict): assert mod.type == "NODES" for k, v in inputs.items(): - inputs = ng_inputs(mod.node_group) + inputs = { + s.name: s + for s in mod.node_group.interface.items_tree + if s.in_out == "INPUT" + } if k not in inputs: raise KeyError(f"Couldnt find {k=} in {mod.node_group.inputs.keys()=}") soc = inputs[k] diff --git a/infinigen/terrain/surface_kernel/kernelizer.py b/infinigen/terrain/surface_kernel/kernelizer.py index 2db9dc7d4..dad7a2efb 100644 --- a/infinigen/terrain/surface_kernel/kernelizer.py +++ b/infinigen/terrain/surface_kernel/kernelizer.py @@ -13,7 +13,6 @@ from infinigen.terrain.utils import ( NODE_ATTRS_AVAILABLE, NODE_FUNCTIONS, - SOCKETTYPE_KERNEL, KernelDataType, Nodes, SocketType, @@ -29,6 +28,7 @@ value_string, var_list, ) +from infinigen.terrain.utils.kernelizer_util import SOCKETTYPE_KERNEL, SOCKETTYPES functional_nodes = [ Nodes.SetPosition, @@ -50,9 +50,10 @@ class Kernelizer: def get_inputs(self, node_tree): inputs = OrderedDict() for node_input in ng_inputs(node_tree).values(): - if node_input.type != SocketType.Geometry: - assert node_input.type != SocketType.Image - inputs[node_input.identifier] = SOCKETTYPE_KERNEL[node_input.type] + socket_type = SOCKETTYPES[node_input.socket_type] + if socket_type != SocketType.Geometry: + assert socket_type != SocketType.Image + inputs[node_input.identifier] = SOCKETTYPE_KERNEL[socket_type] return inputs def get_output(self, node_tree): @@ -61,8 +62,9 @@ def get_output(self, node_tree): if node.bl_idname == Nodes.SetPosition: outputs[Vars.Offset] = KernelDataType.float3 for node_output in ng_outputs(node_tree).values(): - if node_output.type != SocketType.Geometry: - outputs[node_output.identifier] = SOCKETTYPE_KERNEL[node_output.type] + socket_type = SOCKETTYPES[node_output.socket_type] + if socket_type != SocketType.Geometry: + outputs[node_output.identifier] = SOCKETTYPE_KERNEL[socket_type] return outputs def regularize(self, node_tree): @@ -418,8 +420,7 @@ def __call__(self, modifier): node_tree, collective_style=True ) for nodeoutput in ng_outputs(node_tree).values(): - id = nodeoutput.identifier - if id != "Output_1": # not Geometry + if nodeoutput.socket_type != "NodeSocketGeometry": code = re.sub(rf"\b{id}\b", modifier[f"{id}_attribute_name"], code) outputs[modifier[f"{id}_attribute_name"]] = outputs.pop(id) return code, imp_inputs, outputs diff --git a/infinigen/terrain/utils/kernelizer_util.py b/infinigen/terrain/utils/kernelizer_util.py index 72545c1a3..f29695a67 100644 --- a/infinigen/terrain/utils/kernelizer_util.py +++ b/infinigen/terrain/utils/kernelizer_util.py @@ -152,6 +152,14 @@ class KernelDataType: # BOOL todo when necessary } +SOCKETTYPES = { + "NodeSocketFloat": SocketType.Value, + "NodeSocketVector": SocketType.Vector, + "NodeSocketInt": SocketType.Int, + "NodeSocketColor": SocketType.RGBA, + "NodeSocketImage": SocketType.Image, + "NodeSocketGeometry": SocketType.Geometry, +} NODE_FUNCTIONS = { Nodes.WaveTexture: "node_shader_tex_wave", From 1005f5fe2dd5eb62c791d0274caf56cf307d7600 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Mon, 23 Sep 2024 23:09:17 -0400 Subject: [PATCH 09/15] Fix additional bugs. --- infinigen/assets/objects/creatures/crustacean.py | 2 +- .../assets/objects/creatures/insects/utils/geom_utils.py | 2 +- infinigen/assets/objects/creatures/parts/eye_new.py | 2 +- .../assets/objects/wall_decorations/skirting_board.py | 1 - infinigen/core/nodes/shader_utils.py | 8 ++++++-- infinigen/core/placement/particles.py | 3 ++- infinigen/core/util/blender.py | 2 +- infinigen/terrain/utils/mesh.py | 4 ++-- 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/infinigen/assets/objects/creatures/crustacean.py b/infinigen/assets/objects/creatures/crustacean.py index 62da7d55a..d400f0681 100644 --- a/infinigen/assets/objects/creatures/crustacean.py +++ b/infinigen/assets/objects/creatures/crustacean.py @@ -225,7 +225,7 @@ def shader_crustacean(nw: NodeWrangler, params): "Metallic": metallic, "Roughness": roughness, "Specular IOR Level": specular, - "Specular IOR Level Tint": specular_tint, + "Specular Tint": specular_tint, "Coat Weight": clearcoat, }, ) diff --git a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py index 5c286324b..d0705619b 100644 --- a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py +++ b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py @@ -652,7 +652,7 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Tangent Rot"], - 1: if_normal_rot.outputs[3], + 1: if_normal_rot, 2: rotate_euler_1, }, label="if_tangent_rot", diff --git a/infinigen/assets/objects/creatures/parts/eye_new.py b/infinigen/assets/objects/creatures/parts/eye_new.py index f440b68a0..66a53a2f9 100644 --- a/infinigen/assets/objects/creatures/parts/eye_new.py +++ b/infinigen/assets/objects/creatures/parts/eye_new.py @@ -2623,7 +2623,7 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): Nodes.Switch, input_kwargs={ 0: group_input.outputs["Do Tangent Rot"], - 1: if_normal_rot.outputs[3], + 1: if_normal_rot, 2: rotate_euler_1, }, label="if_tangent_rot", diff --git a/infinigen/assets/objects/wall_decorations/skirting_board.py b/infinigen/assets/objects/wall_decorations/skirting_board.py index f7ec2144e..17a6c48f8 100644 --- a/infinigen/assets/objects/wall_decorations/skirting_board.py +++ b/infinigen/assets/objects/wall_decorations/skirting_board.py @@ -89,7 +89,6 @@ def nodegroup_make_skirting_board(nw: NodeWrangler, control_points): Nodes.ResampleCurve, input_kwargs={ "Curve": transform_geometry, - "Count": 220, "Length": group_input.outputs["Resolution"], }, attrs={"mode": "LENGTH"}, diff --git a/infinigen/core/nodes/shader_utils.py b/infinigen/core/nodes/shader_utils.py index 8c804ea2f..71aacaeb8 100644 --- a/infinigen/core/nodes/shader_utils.py +++ b/infinigen/core/nodes/shader_utils.py @@ -38,8 +38,12 @@ def convert_shader_displacement(mat: bpy.types.Material): geo_node_group = bpy.data.node_groups.new("GeometryNodes", "GeometryNodeTree") group_input = geo_node_group.nodes.new("NodeGroupInput") group_output = geo_node_group.nodes.new("NodeGroupOutput") - geo_node_group.outputs.new("NodeSocketGeometry", "Geometry") - geo_node_group.inputs.new("NodeSocketGeometry", "Geometry") + geo_node_group.interface.new_socket( + name="Geometry", in_out="INPUT", socket_type="NodeSocketGeometry" + ) + geo_node_group.interface.new_socket( + name="Geometry", in_out="OUTPUT", socket_type="NodeSocketGeometry" + ) set_pos = geo_node_group.nodes.new("GeometryNodeSetPosition") normal = geo_node_group.nodes.new("GeometryNodeInputNormal") scale = geo_node_group.nodes.new("ShaderNodeVectorMath") diff --git a/infinigen/core/placement/particles.py b/infinigen/core/placement/particles.py index 00b6f9489..23ce8015a 100644 --- a/infinigen/core/placement/particles.py +++ b/infinigen/core/placement/particles.py @@ -47,7 +47,8 @@ def configure_boids(system_config, settings): context = bpy.context.copy() context["particle_settings"] = system_config for _ in boids.states[0].rules.keys(): - bpy.ops.boid.rule_del(context) + with bpy.context.temp_override(context): + bpy.ops.boid.rule_del() for r in rules: bpy.ops.boid.rule_add(context, type=r.pop("type")) for k, v in r.items(): diff --git a/infinigen/core/util/blender.py b/infinigen/core/util/blender.py index 86a3a661d..284329cd8 100644 --- a/infinigen/core/util/blender.py +++ b/infinigen/core/util/blender.py @@ -561,7 +561,7 @@ def set_geomod_inputs(mod, inputs: dict): if s.in_out == "INPUT" } if k not in inputs: - raise KeyError(f"Couldnt find {k=} in {mod.node_group.inputs.keys()=}") + raise KeyError(f"Couldnt find {k=} in {inputs=}") soc = inputs[k] if not hasattr(soc, "default_value"): diff --git a/infinigen/terrain/utils/mesh.py b/infinigen/terrain/utils/mesh.py index bc390f216..972da1b98 100644 --- a/infinigen/terrain/utils/mesh.py +++ b/infinigen/terrain/utils/mesh.py @@ -16,7 +16,7 @@ from infinigen.core.util.logging import Timer from infinigen.core.util.organization import Attributes -from ...core.nodes.node_wrangler import ng_inputs +from ...core.nodes.node_wrangler import ng_inputs, ng_outputs from .camera import getK from .ctype_util import ASDOUBLE, ASINT, load_cdll from .kernelizer_util import ATTRTYPE_DIMS, ATTRTYPE_FIELDS, NPTYPEDIM_ATTR, Vars @@ -433,7 +433,7 @@ def move_modifier(target_obj, m): id = inp.identifier modifier[f"{id}_attribute_name"] = inp.name modifier[f"{id}_use_attribute"] = True - for i, outp in enumerate(modifier.node_group.outputs): + for i, outp in enumerate(ng_outputs(modifier.node_group).values()): if i > 0: id = outp.identifier modifier[f"{id}_attribute_name"] = m[f"{id}_attribute_name"] From c8223da01da23fc9d1d0e1f6b69b4d98eec6b110 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Tue, 24 Sep 2024 10:53:43 -0400 Subject: [PATCH 10/15] Fix additional bugs. --- infinigen/assets/objects/creatures/crustacean.py | 2 +- .../assets/objects/creatures/insects/utils/geom_utils.py | 2 +- .../core/constraints/example_solver/room/solidifier.py | 1 - infinigen/core/placement/camera.py | 6 +++++- infinigen/core/placement/particles.py | 3 ++- infinigen/infinigen_gpl | 2 +- infinigen/tools/process_static_meshes.py | 5 ++++- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/infinigen/assets/objects/creatures/crustacean.py b/infinigen/assets/objects/creatures/crustacean.py index d400f0681..016781bca 100644 --- a/infinigen/assets/objects/creatures/crustacean.py +++ b/infinigen/assets/objects/creatures/crustacean.py @@ -190,7 +190,7 @@ def shader_crustacean(nw: NodeWrangler, params): ) light_color = hsv2rgba(base_hue, uniform(0.0, 0.4), log_uniform(0.2, 1.0)) specular = uniform(0.6, 0.8) - specular_tint = uniform(0, 1) + specular_tint = [uniform(0, 1)] * 3 clearcoat = uniform(0.2, 0.8) roughness = uniform(0.1, 0.3) metallic = uniform(0.6, 0.8) diff --git a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py index d0705619b..07371e81d 100644 --- a/infinigen/assets/objects/creatures/insects/utils/geom_utils.py +++ b/infinigen/assets/objects/creatures/insects/utils/geom_utils.py @@ -660,7 +660,7 @@ def nodegroup_raycast_rotation(nw: NodeWrangler): ) group_output = nw.new_node( - Nodes.GroupOutput, input_kwargs={"Output": if_tangent_rot.outputs[3]} + Nodes.GroupOutput, input_kwargs={"Output": if_tangent_rot} ) diff --git a/infinigen/core/constraints/example_solver/room/solidifier.py b/infinigen/core/constraints/example_solver/room/solidifier.py index 0077cba3f..cf9077c6f 100644 --- a/infinigen/core/constraints/example_solver/room/solidifier.py +++ b/infinigen/core/constraints/example_solver/room/solidifier.py @@ -670,7 +670,6 @@ def tag(self, obj, visible=True): obj, f"{PREFIX}{t.Subpart.SupportSurface.value}", floor, "BOOLEAN", "FACE" ) write_attr_data(obj, f"{PREFIX}{t.Subpart.Wall.value}", wall, "BOOLEAN", "FACE") - write_attr_data(obj, "segment_id", np.arange(len(center)), "BOOLEAN", "FACE") full = np.ones_like(ceiling) if visible: write_attr_data( diff --git a/infinigen/core/placement/camera.py b/infinigen/core/placement/camera.py index fe3213c93..62a92f09c 100644 --- a/infinigen/core/placement/camera.py +++ b/infinigen/core/placement/camera.py @@ -357,7 +357,11 @@ def keep_cam_pose_proposal( return None coverage = len(dists) / n_pix - if coverage < terrain_coverage_range[0] or coverage > terrain_coverage_range[1]: + if ( + coverage < terrain_coverage_range[0] + or coverage > terrain_coverage_range[1] + or coverage == 0 + ): logger.debug( f"keep_cam_pose_proposal rejects {coverage=} for {terrain_coverage_range=}" ) diff --git a/infinigen/core/placement/particles.py b/infinigen/core/placement/particles.py index 23ce8015a..0b6b442c7 100644 --- a/infinigen/core/placement/particles.py +++ b/infinigen/core/placement/particles.py @@ -33,7 +33,8 @@ def bake(emitter, system): } with Suppress(): bpy.context.scene.frame_end += 1 - bpy.ops.ptcache.bake(override, bake=True) + with bpy.context.temp_override(override): + bpy.ops.ptcache.bake(bake=True) bpy.context.scene.frame_end -= 1 emitter.hide_viewport = hide_orig diff --git a/infinigen/infinigen_gpl b/infinigen/infinigen_gpl index 10c1d76f5..78d34b2d4 160000 --- a/infinigen/infinigen_gpl +++ b/infinigen/infinigen_gpl @@ -1 +1 @@ -Subproject commit 10c1d76f5c35003e919be7265185c9c355e3b70c +Subproject commit 78d34b2d4b7bd373d22b455dfc59716a78e3f9dd diff --git a/infinigen/tools/process_static_meshes.py b/infinigen/tools/process_static_meshes.py index f0145b9f9..835eac7f7 100644 --- a/infinigen/tools/process_static_meshes.py +++ b/infinigen/tools/process_static_meshes.py @@ -40,7 +40,10 @@ ) as f: json.dump(current_json, f) for npz_path in os.listdir(static_mesh_folder): - if npz_path.endswith(".npz"): + if ( + npz_path.endswith(".npz") + and not (static_mesh_folder / npz_path).exists() + ): os.symlink( static_mesh_folder / npz_path, args.target_frames_dir From e9c76d83c52a2cc22d67be9c11a36fe6f0f506d8 Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Mon, 30 Sep 2024 18:43:28 -0400 Subject: [PATCH 11/15] Fix additional bugs. --- infinigen/assets/objects/creatures/crustacean.py | 2 +- infinigen/core/placement/particles.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/infinigen/assets/objects/creatures/crustacean.py b/infinigen/assets/objects/creatures/crustacean.py index 016781bca..97d3f7a84 100644 --- a/infinigen/assets/objects/creatures/crustacean.py +++ b/infinigen/assets/objects/creatures/crustacean.py @@ -190,7 +190,7 @@ def shader_crustacean(nw: NodeWrangler, params): ) light_color = hsv2rgba(base_hue, uniform(0.0, 0.4), log_uniform(0.2, 1.0)) specular = uniform(0.6, 0.8) - specular_tint = [uniform(0, 1)] * 3 + specular_tint = *([uniform(0, 1)] * 3), 1 clearcoat = uniform(0.2, 0.8) roughness = uniform(0.1, 0.3) metallic = uniform(0.6, 0.8) diff --git a/infinigen/core/placement/particles.py b/infinigen/core/placement/particles.py index 0b6b442c7..4ba827b43 100644 --- a/infinigen/core/placement/particles.py +++ b/infinigen/core/placement/particles.py @@ -33,7 +33,7 @@ def bake(emitter, system): } with Suppress(): bpy.context.scene.frame_end += 1 - with bpy.context.temp_override(override): + with bpy.context.temp_override(**override): bpy.ops.ptcache.bake(bake=True) bpy.context.scene.frame_end -= 1 @@ -48,10 +48,11 @@ def configure_boids(system_config, settings): context = bpy.context.copy() context["particle_settings"] = system_config for _ in boids.states[0].rules.keys(): - with bpy.context.temp_override(context): + with bpy.context.temp_override(**context): bpy.ops.boid.rule_del() for r in rules: - bpy.ops.boid.rule_add(context, type=r.pop("type")) + with bpy.context.temp_override(**context): + bpy.ops.boid.rule_add(type=r.pop("type")) for k, v in r.items(): setattr(boids.states[0].rules[-1], k, v) assert len(boids.states[0].rules) == len(rules) From 7f0262642720377d96771fc07bb6ea732cbc8cfb Mon Sep 17 00:00:00 2001 From: Lingjie Mei Date: Thu, 10 Oct 2024 00:13:58 -0400 Subject: [PATCH 12/15] Fix normalize bug in MusgraveTexture --- infinigen/core/nodes/compatibility.py | 1 + 1 file changed, 1 insertion(+) diff --git a/infinigen/core/nodes/compatibility.py b/infinigen/core/nodes/compatibility.py index 34c1c5afb..9e9977c1b 100644 --- a/infinigen/core/nodes/compatibility.py +++ b/infinigen/core/nodes/compatibility.py @@ -145,6 +145,7 @@ def compat_musgrave_texture(nw, orig_type, input_args, attrs, input_kwargs): attrs["noise_dimensions"] = attrs.pop("musgrave_dimensions") if "musgrave_type" in attrs: attrs["noise_type"] = attrs.pop("musgrave_type") + attrs["normalize"] = False return nw.new_node( node_type=Nodes.NoiseTexture, input_args=[], From 769309134dea8350a2394ac3635126c60cc9bf19 Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Mon, 11 Nov 2024 13:47:22 -0500 Subject: [PATCH 13/15] Fix test failures for BarChair and RangeHood --- infinigen/assets/objects/seating/chairs/bar_chair.py | 2 +- infinigen/assets/objects/table_decorations/utils.py | 2 +- infinigen/assets/objects/tables/lofting.py | 2 +- infinigen/infinigen_gpl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infinigen/assets/objects/seating/chairs/bar_chair.py b/infinigen/assets/objects/seating/chairs/bar_chair.py index cbdaab0a9..9f765024b 100644 --- a/infinigen/assets/objects/seating/chairs/bar_chair.py +++ b/infinigen/assets/objects/seating/chairs/bar_chair.py @@ -194,7 +194,7 @@ def create_asset(self, **params): obj = bpy.context.active_object surface.add_geomod( - obj, geometry_assemble_chair, apply=False, input_kwargs=self.params + obj, geometry_assemble_chair, apply=True, input_kwargs=self.params ) tagging.tag_system.relabel_obj(obj) diff --git a/infinigen/assets/objects/table_decorations/utils.py b/infinigen/assets/objects/table_decorations/utils.py index 68b12bd15..e27b7936f 100644 --- a/infinigen/assets/objects/table_decorations/utils.py +++ b/infinigen/assets/objects/table_decorations/utils.py @@ -388,7 +388,7 @@ def nodegroup_lofting_poly(nw: NodeWrangler): evaluate_on_domain = nw.new_node( Nodes.EvaluateonDomain, - input_kwargs={1: index}, + input_kwargs={0: index}, attrs={"domain": "CURVE", "data_type": "INT"}, ) diff --git a/infinigen/assets/objects/tables/lofting.py b/infinigen/assets/objects/tables/lofting.py index da7fb5096..d65f5a9ca 100644 --- a/infinigen/assets/objects/tables/lofting.py +++ b/infinigen/assets/objects/tables/lofting.py @@ -244,7 +244,7 @@ def nodegroup_lofting(nw: NodeWrangler): evaluate_on_domain = nw.new_node( Nodes.EvaluateonDomain, - input_kwargs={1: index}, + input_kwargs={0: index}, attrs={"domain": "CURVE", "data_type": "INT"}, ) diff --git a/infinigen/infinigen_gpl b/infinigen/infinigen_gpl index 78d34b2d4..10c1d76f5 160000 --- a/infinigen/infinigen_gpl +++ b/infinigen/infinigen_gpl @@ -1 +1 @@ -Subproject commit 78d34b2d4b7bd373d22b455dfc59716a78e3f9dd +Subproject commit 10c1d76f5c35003e919be7265185c9c355e3b70c From 26c00d71d9f1dfb9c47a80f6ee7c5e3c03f1d2ce Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Mon, 11 Nov 2024 14:18:28 -0500 Subject: [PATCH 14/15] Add CONDA_PREFIX to interactive_blender.sh to fix missing Python.h headers --- docs/Installation.md | 2 ++ scripts/install/interactive_blender.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/Installation.md b/docs/Installation.md index a7d9ac7e1..58abd3b12 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -87,6 +87,8 @@ On Linux / Mac / WSL: ```bash git clone https://github.com/princeton-vl/infinigen.git cd infinigen +conda create --name infinigen python=3.11 +conda activate infinigen ``` Then, install using one of the options below: diff --git a/scripts/install/interactive_blender.sh b/scripts/install/interactive_blender.sh index 495cecc60..1f8f792d5 100644 --- a/scripts/install/interactive_blender.sh +++ b/scripts/install/interactive_blender.sh @@ -66,4 +66,4 @@ fi # Install Blender dependencies "${BLENDER_PYTHON}" -m ensurepip -CFLAGS="-I/usr/include/python3.11 ${CFLAGS}" "${BLENDER_PYTHON}" -m pip install -e . \ No newline at end of file +CFLAGS="-I/usr/include/python3.11 -I$CONDA_PREFIX/include/python3.11 $CFLAGS" ${BLENDER_PYTHON} -m pip install -e . \ No newline at end of file From 31a7286c1c635808410541400b2ded5176e3e71a Mon Sep 17 00:00:00 2001 From: Alexander Raistrick Date: Tue, 22 Oct 2024 11:35:28 -0400 Subject: [PATCH 15/15] Update Changelog for v1.11, fix formatting, fix submodules, add OpenEXR dependency --- docs/CHANGELOG.md | 5 ++++- infinigen/__init__.py | 2 +- infinigen/datagen/customgt/dependencies/fast_obj | 1 - infinigen/datagen/customgt/dependencies/indicators | 1 - infinigen/datagen/customgt/dependencies/tinycolormap | 1 - infinigen/terrain/utils/mesh.py | 2 +- pyproject.toml | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) delete mode 160000 infinigen/datagen/customgt/dependencies/fast_obj delete mode 160000 infinigen/datagen/customgt/dependencies/indicators delete mode 160000 infinigen/datagen/customgt/dependencies/tinycolormap diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 99cb3d943..1986b71f0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -139,4 +139,7 @@ v1.10.0 v1.10.1 - Fix missing validity checks for camera-rig cameras which are not the 0th index -- Fix missing seat in dining chair \ No newline at end of file +- Fix missing seat in dining chair + +v1.11.0 +- Update to Blender == 4.2.0 diff --git a/infinigen/__init__.py b/infinigen/__init__.py index a2aabb54e..f7218326c 100644 --- a/infinigen/__init__.py +++ b/infinigen/__init__.py @@ -6,7 +6,7 @@ import logging from pathlib import Path -__version__ = "1.10.1" +__version__ = "1.11.0" def repo_root(): diff --git a/infinigen/datagen/customgt/dependencies/fast_obj b/infinigen/datagen/customgt/dependencies/fast_obj deleted file mode 160000 index 85778da5f..000000000 --- a/infinigen/datagen/customgt/dependencies/fast_obj +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85778da5fc320b7e52885f8e869edc079695cc79 diff --git a/infinigen/datagen/customgt/dependencies/indicators b/infinigen/datagen/customgt/dependencies/indicators deleted file mode 160000 index a5bc05f32..000000000 --- a/infinigen/datagen/customgt/dependencies/indicators +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a5bc05f32a9c719535054b7fa5306ce5c8d055d8 diff --git a/infinigen/datagen/customgt/dependencies/tinycolormap b/infinigen/datagen/customgt/dependencies/tinycolormap deleted file mode 160000 index 67198d2b2..000000000 --- a/infinigen/datagen/customgt/dependencies/tinycolormap +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 67198d2b2b48ca5e97600c83b5c0f2310cfd4c03 diff --git a/infinigen/terrain/utils/mesh.py b/infinigen/terrain/utils/mesh.py index 972da1b98..0f73d4644 100644 --- a/infinigen/terrain/utils/mesh.py +++ b/infinigen/terrain/utils/mesh.py @@ -12,11 +12,11 @@ import trimesh from numpy import ascontiguousarray as AC +from infinigen.core.nodes.node_wrangler import ng_inputs, ng_outputs from infinigen.core.util import blender as butil from infinigen.core.util.logging import Timer from infinigen.core.util.organization import Attributes -from ...core.nodes.node_wrangler import ng_inputs, ng_outputs from .camera import getK from .ctype_util import ASDOUBLE, ASINT, load_cdll from .kernelizer_util import ATTRTYPE_DIMS, ATTRTYPE_FIELDS, NPTYPEDIM_ATTR, Vars diff --git a/pyproject.toml b/pyproject.toml index 0ad95e6ee..33a43478c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ dependencies = [ "submitit", "tqdm", "trimesh", + "OpenEXR", # used by trimesh, we could specify "trimesh[easy]" but this brings more packages "python-fcl",