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