Skip to content

Commit

Permalink
+ Fix Add on installation and enabling
Browse files Browse the repository at this point in the history
+ 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
  • Loading branch information
JerryLingjieMei authored and pvl-bot committed Nov 11, 2024
1 parent 6638a81 commit c2dc8f7
Show file tree
Hide file tree
Showing 146 changed files with 642 additions and 481 deletions.
3 changes: 1 addition & 2 deletions infinigen/assets/fluid/fluid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions infinigen/assets/fluid/liquid_particle_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
)
Expand Down
8 changes: 4 additions & 4 deletions infinigen/assets/materials/bark_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
)

Expand Down Expand Up @@ -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),
],
)

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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"],
),
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/basic_bsdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
)
Expand Down
4 changes: 2 additions & 2 deletions infinigen/assets/materials/beverage_fridge_shaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
12 changes: 8 additions & 4 deletions infinigen/assets/materials/bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down Expand Up @@ -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"},
)

Expand Down Expand Up @@ -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,
},
)
Expand Down
4 changes: 2 additions & 2 deletions infinigen/assets/materials/bumpy_rubber_floor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
],
)

Expand Down Expand Up @@ -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"],
},
)
Expand Down
8 changes: 4 additions & 4 deletions infinigen/assets/materials/ceramic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
)
Expand Down
8 changes: 4 additions & 4 deletions infinigen/assets/materials/cobble_stone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down Expand Up @@ -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},
Expand Down
6 changes: 5 additions & 1 deletion infinigen/assets/materials/cracked_ground.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions infinigen/assets/materials/dishwasher_shaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
8 changes: 6 additions & 2 deletions infinigen/assets/materials/fabrics/coarse_knit_fabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
},
)
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/fabrics/general_fabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/fabrics/sofa_fabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)

Expand Down
5 changes: 2 additions & 3 deletions infinigen/assets/materials/fabrics/velvet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)

Expand Down
6 changes: 5 additions & 1 deletion infinigen/assets/materials/fish_eye_shader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions infinigen/assets/materials/fishbody.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down
3 changes: 2 additions & 1 deletion infinigen/assets/materials/glass_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/ice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
5 changes: 2 additions & 3 deletions infinigen/assets/materials/lamp_shaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
8 changes: 3 additions & 5 deletions infinigen/assets/materials/lava.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/metal/brushed_metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
)
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/metal/galvanized_metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
)
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/metal/hammered_metal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/metal/metal_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/mud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
Expand Down
Loading

0 comments on commit c2dc8f7

Please sign in to comment.