Skip to content

Commit

Permalink
New changes and new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Jun 13, 2024
1 parent d33178d commit 22a41d4
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 126 deletions.
15 changes: 8 additions & 7 deletions infinigen/assets/materials/aluminumdisp2tut.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ def shader_aluminumdisp2tut(nw: NodeWrangler, rand=False, **input_kwargs):
input_kwargs={'Vector': texture_coordinate.outputs["Generated"]})

multiply = nw.new_node(Nodes.Math,
input_kwargs={'Value': separate_xyz.outputs["X"], 'Value_1': 0.1},
input_kwargs={'Value': separate_xyz.outputs["X"], 'Value_001': 0.1},
attrs={'operation': 'MULTIPLY'})
if rand:
multiply.inputs['Value_1'].default_value = sample_range(-1, 1)
multiply.inputs['Value_001'].default_value = sample_range(-1, 1)

multiply_1 = nw.new_node(Nodes.Math,
input_kwargs={'Value': separate_xyz.outputs["Y"], 'Value_1': 0.1},
input_kwargs={'Value': separate_xyz.outputs["Y"], 'Value_001': 0.1},
attrs={'operation': 'MULTIPLY'})
if rand:
multiply_1.inputs['Value_1'].default_value = sample_range(-1, 1)
multiply_1.inputs['Value_001'].default_value = sample_range(-1, 1)

add = nw.new_node(Nodes.Math,
input_kwargs={'Value': multiply.outputs["Value"], 'Value_1': multiply_1.outputs["Value"]},
input_kwargs={'Value': multiply.outputs["Value"], 'Value_001': multiply_1.outputs["Value"]},
attrs={'operation': 'ADD'})

combine_xyz = nw.new_node(Nodes.CombineXYZ,
Expand All @@ -45,9 +45,10 @@ def shader_aluminumdisp2tut(nw: NodeWrangler, rand=False, **input_kwargs):
attrs={'operation': 'MULTIPLY'})

musgrave_texture = nw.new_node(Nodes.MusgraveTexture,
input_kwargs={'Vector': mapping.outputs["Vector"], 'W': 0.7, 'Scale': 2.0, 'Detail': 10.0, 'Dimensions': '4D'})
input_kwargs={'Vector': mapping.outputs["Vector"], 'Roughness': 0.7, 'Scale': 2.0, 'Detail': 10.0},
attrs={'musgrave_dimensions': '4D'})
if rand:
musgrave_texture.inputs['W'].default_value = sample_range(0, 5)
musgrave_texture.inputs['Roughness'].default_value = sample_range(0, 5)
musgrave_texture.inputs['Scale'].default_value = sample_ratio(2, 0.5, 2)

colorramp_4 = nw.new_node(Nodes.ColorRamp,
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 @@ -24,7 +24,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
6 changes: 3 additions & 3 deletions infinigen/assets/materials/bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def shader_bird_body(nw: NodeWrangler, rand=True, kind='duck', **input_kwargs):
group.inputs['W'].default_value = sample_range(-2, 2)

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': group, 'Subsurface IOR': 0.0, 'Specular': 0.0, 'Roughness': 1.0})
input_kwargs={'Base Color': group, 'Subsurface Weight': 0.0, 'Roughness': 1.0})

material_output = nw.new_node(Nodes.MaterialOutput,
input_kwargs={'Surface': principled_bsdf})
Expand Down Expand Up @@ -356,7 +356,7 @@ def shader_bird_feather(nw: NodeWrangler, rand=True, kind='duck', tail=False, **
input_kwargs={'Fac': 0.5 if tail else 1.0, 'Color1': colorramp2.outputs["Color"], 'Color2': colorramp.outputs["Color"]})

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"), 'Roughness': 1.0},
attrs={'subsurface_method': 'BURLEY'})

material_output = nw.new_node(Nodes.MaterialOutput,
Expand Down Expand Up @@ -445,7 +445,7 @@ def shader_bird_claw(nw: NodeWrangler, rand=True, **input_kwargs):
# Code generated using version 2.4.3 of the node_transpiler

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': (0.0091, 0.0091, 0.0091, 1.0), 'Specular': 0.0, 'Roughness': 0.4409})
input_kwargs={'Base Color': (0.0091, 0.0091, 0.0091, 1.0), 'Roughness': 0.4409})

material_output = nw.new_node(Nodes.MaterialOutput,
input_kwargs={'Surface': principled_bsdf})
Expand Down
9 changes: 4 additions & 5 deletions infinigen/assets/materials/face_size_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ def shader_material(nw: NodeWrangler):
input_kwargs={'Surface': principled_bsdf})

def geo_face_colors(nw: NodeWrangler):
# Code generated using version 2.4.3 of the node_transpiler
# Code generated using version 2.6.5 of the node_transpiler

group_input = nw.new_node(Nodes.GroupInput,
expose_input=[('NodeSocketGeometry', 'Geometry', None)])
group_input = nw.expose_input('Geometry', dtype='NodeSocketGeometry')

random_value = nw.new_node(Nodes.RandomValue,
attrs={'data_type': 'FLOAT_VECTOR'})

store_named_attribute = nw.new_node(Nodes.StoreNamedAttribute,
input_kwargs={'Geometry': group_input.outputs["Geometry"], 'Name': 'col', "Value": random_value.outputs["Value"]},
input_kwargs={'Geometry': group_input, 'Name': 'col', "Value": random_value.outputs["Value"]},
attrs={'data_type': 'FLOAT_VECTOR', 'domain': 'FACE'})

group_output = nw.new_node(Nodes.GroupOutput,
nw.new_node(Nodes.GroupOutput,
input_kwargs={'Geometry': store_named_attribute})


Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/grass_blade_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def shader_grass_texture_original(nw: NodeWrangler):
input_kwargs={'Vector': separate_xyz.outputs["Y"], 'Scale': 25.0, 'Distortion': 8.0, 'Detail Scale': 6.0})

musgrave_texture = nw.new_node(Nodes.MusgraveTexture,
input_kwargs={'Vector': combine_xyz, 'Scale': 8.0, 'Detail': 5.0, 'Dimension': 0.1, 'Lacunarity': 3.0})
input_kwargs={'Vector': combine_xyz, 'Scale': 8.0, 'Detail': 5.0, 'Roughness': 0.1, 'Lacunarity': 3.0})

mix_1 = nw.new_node(Nodes.MixRGB,
input_kwargs={'Fac': 0.2, 'Color1': wave_texture.outputs["Color"], 'Color2': musgrave_texture})
Expand Down
3 changes: 1 addition & 2 deletions infinigen/assets/materials/ice.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ 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"],
'IOR': 1.3100
},
Expand Down
6 changes: 3 additions & 3 deletions infinigen/assets/materials/mountain.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def geo_MOUNTAIN_general(
crack_modulation_params,
selection=None
):
position = nw.new_node("GeometryNodeInputPosition", [])
normal = nw.new_node("GeometryNodeInputNormal", [])
position = nw.new_node(Nodes.InputPosition, [])
normal = nw.new_node(Nodes.InputNormal, [])

noises = []

Expand Down Expand Up @@ -231,7 +231,7 @@ def shader_MOUNTAIN(
z_noise.inputs[1].default_value = np.random.uniform(0.1, 0.3)
z = nw.add2(z, z_noise)

ramp = nw.new_node('ShaderNodeValToRGB', [z])
ramp = nw.new_node(Nodes.ColorRamp, [z])
elements = ramp.color_ramp.elements
elements.remove(elements[0])
# todo: better way to sample the initial color
Expand Down
5 changes: 1 addition & 4 deletions infinigen/assets/materials/new_whitewater.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def new_whitewater(nw: NodeWrangler):
input_kwargs={
"Base Color": (1.0000, 1.0000, 1.0000, 1.0000),
"Subsurface Weight": 1.0,
"Subsurface Color": random_color_neighbour((0.7147, 0.6062, 0.8000, 1.0000), 0.05, 0.05, 0.05),
"Specular IOR Level": 0.0886 + 0.01 * normal(),
"Subsurface Radius": (0.05, 0.05, 0.05),
"Roughness": 0.1500,
"IOR": 1.1000,
"Transmission Weight": 0.5000,
Expand All @@ -33,9 +32,7 @@ def new_whitewater(nw: NodeWrangler):
material_output = nw.new_node(
Nodes.MaterialOutput,
input_kwargs={"Surface": principled_bsdf, "Volume": volume_scatter},
attrs={"is_active_output": True},
)


def apply(obj, selection=None, **kwargs):
surface.add_material(obj, new_whitewater, selection=selection)
2 changes: 1 addition & 1 deletion infinigen/assets/materials/nose.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def shader_nose(nw: NodeWrangler):
# Code generated using version 2.4.3 of the node_transpiler

musgrave_texture = nw.new_node(Nodes.MusgraveTexture,
input_kwargs={'Scale': U(2, 6), 'Detail': 14.699999999999999, 'Dimension': 1.5})
input_kwargs={'Scale': U(2, 6), 'Detail': 14.699999999999999, 'Roughness': 1.5})

colorramp = nw.new_node(Nodes.ColorRamp,
input_kwargs={'Fac': musgrave_texture})
Expand Down
4 changes: 2 additions & 2 deletions infinigen/assets/materials/sand.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def geo_SAND(nw,
selection=None,
):
nw.force_input_consistency()
normal = nw.new_node("GeometryNodeInputNormal", [])
position = nw.new_node("GeometryNodeInputPosition", [])
normal = nw.new_node(Nodes.InputNormal, [])
position = nw.new_node(Nodes.InputPosition, [])

offsets = []
for i in range(n_waves):
Expand Down
3 changes: 1 addition & 2 deletions infinigen/assets/materials/slimy.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ def shader_slimy(nw, rand=False, **input_kwargs):
input_kwargs={'Color1': colorramp_1.outputs["Color"], 'Color2': colorramp_4.outputs["Color"]})

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': (0.6605, 0.0279, 0.0359, 1.0), 'Subsurface': 0.2, 'Subsurface Color': (0.4621, 0.0213, 0.0265, 1.0), 'Specular': 0.8591, 'Roughness': mix_1})
input_kwargs={'Base Color': (0.6605, 0.0279, 0.0359, 1.0), 'Subsurface Weight': 0.2, 'Roughness': mix_1})
if rand:
sample_color(principled_bsdf.inputs['Base Color'].default_value)
sample_color(principled_bsdf.inputs['Subsurface Color'].default_value)

material_output = nw.new_node(Nodes.MaterialOutput,
input_kwargs={'Surface': principled_bsdf})
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/snake_plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def shader_snake_plant(nw: NodeWrangler):
'Color2': colorramp_3.outputs["Color"]})

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': mix, 'Roughness': U(8.0, 15.0), 'Clearcoat Roughness': 0.0})
input_kwargs={'Base Color': mix, 'Roughness': U(8.0, 15.0), 'Coat Roughness': 0.0})

material_output = nw.new_node(Nodes.MaterialOutput,
input_kwargs={'Surface': principled_bsdf})
Expand Down
6 changes: 3 additions & 3 deletions infinigen/assets/materials/snake_shaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def shader_black_white_snake(nw: NodeWrangler, rand=True):
sample_color(e.color, offset=0.05, keep_sum=True)

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': colorramp.outputs["Color"], 'Metallic': 0.6, 'Specular': 0.2, 'Roughness': 0.4},
input_kwargs={'Base Color': colorramp.outputs["Color"], 'Metallic': 0.6, 'Roughness': 0.4},
attrs={'subsurface_method': 'BURLEY'})

material_output = nw.new_node(Nodes.MaterialOutput,
Expand Down Expand Up @@ -83,7 +83,7 @@ def shader_brown(nw: NodeWrangler, rand=False):
sample_color(e.color, offset=0.05)

principled_bsdf_1 = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': colorramp_2.outputs["Color"], 'Metallic': 0.4, 'Specular': 0.3, 'Roughness': 1},
input_kwargs={'Base Color': colorramp_2.outputs["Color"], 'Metallic': 0.4, 'Roughness': 1},
attrs={'subsurface_method': 'BURLEY'})

noise_texture_1 = nw.new_node(Nodes.NoiseTexture,
Expand Down Expand Up @@ -183,7 +183,7 @@ def shader_golden(nw: NodeWrangler, rand=False):
sample_color(e.color, offset=0.05, keep_sum=True)

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': colorramp.outputs["Color"], 'Metallic': 0.4, 'Specular': 0.2, 'Roughness': 0.4},
input_kwargs={'Base Color': colorramp.outputs["Color"], 'Metallic': 0.4, 'Roughness': 0.4},
attrs={'subsurface_method': 'BURLEY'})

material_output = nw.new_node(Nodes.MaterialOutput,
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/spider_plant.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def shader_spider_plant(nw: NodeWrangler):
main_color = hsv2rgba(main_hsv_color)

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': main_color, 'Subsurface IOR': 1.01,
input_kwargs={'Base Color': main_color, 'Subsurface Weight': 1.01,
'Roughness': 2.0})

translucent_bsdf = nw.new_node(Nodes.TranslucentBSDF,
Expand Down
2 changes: 1 addition & 1 deletion infinigen/assets/materials/tongue.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def shader_tongue(nw: NodeWrangler):
colorramp.color_ramp.elements[1].color = (0.0979, 0.0979, 0.0979, 1.0)

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': (0.8, 0.0605, 0.0437, 1.0), 'Subsurface': 0.0312, 'Subsurface Color': (0.8, 0.0, 0.2679, 1.0), 'Roughness': colorramp.outputs["Color"]})
input_kwargs={'Base Color': (0.8, 0.0605, 0.0437, 1.0), 'Subsurface Weight': 0.0312, 'Roughness': colorramp.outputs["Color"]})

material_output = nw.new_node(Nodes.MaterialOutput,
input_kwargs={'Surface': principled_bsdf})
Expand Down
46 changes: 20 additions & 26 deletions infinigen/assets/materials/waterfall_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

# Authors: Karhan Kayan

import bpy
import mathutils
from numpy.random import uniform, normal, randint
from infinigen.core.nodes.node_wrangler import Nodes, NodeWrangler
from infinigen.core.nodes import node_utils
from infinigen.core.util.color import color_category
from infinigen.core import surface

def waterfall_shader(nw: NodeWrangler):
Expand All @@ -23,69 +18,68 @@ def waterfall_shader(nw: NodeWrangler):
input_kwargs={'Color': rgb})

principled_bsdf = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Base Color': rgb, 'Roughness': 0.0, 'IOR': 1.33, 'Transmission': 1.0})
input_kwargs={'Base Color': rgb, 'Roughness': 0.0, 'IOR': 1.33, 'Transmission Weight': 1.0})

mix_shader = nw.new_node(Nodes.MixShader,
input_kwargs={'Fac': light_path.outputs["Is Camera Ray"], 1: transparent_bsdf, 2: principled_bsdf})
input_kwargs={'Fac': light_path.outputs["Is Camera Ray"], 'Shader': transparent_bsdf, 'Shader_001': principled_bsdf})

texture_coordinate = nw.new_node(Nodes.TextureCoord)

mapping = nw.new_node(Nodes.Mapping,
input_kwargs={'Vector': texture_coordinate.outputs["Object"]})

musgrave_texture_1 = nw.new_node(Nodes.MusgraveTexture,
input_kwargs={'Vector': mapping, 'Scale': 3.3, 'Detail': 13.0, 'Dimension': 0.3})
input_kwargs={'Vector': mapping, 'Scale': 3.3, 'Detail': 13.0, 'Roughness': 0.3})

colorramp = nw.new_node(Nodes.ColorRamp,
input_kwargs={'Fac': musgrave_texture_1})
colorramp.color_ramp.interpolation = "B_SPLINE"
colorramp.color_ramp.elements[0].position = 0.325
colorramp.color_ramp.interpolation = "EASE"
colorramp.color_ramp.elements[0].position = 0.325
colorramp.color_ramp.elements[0].color = (0.0, 0.0, 0.0, 1.0)
colorramp.color_ramp.elements[1].position = 0.6727
colorramp.color_ramp.elements[1].color = (1.0, 1.0, 1.0, 1.0)

principled_bsdf_1 = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Metallic': 0.2636, 'Specular': 1.0, 'Roughness': 0.0, 'IOR': 1.333, 'Transmission': 0.8205, 'Alpha': colorramp.outputs["Color"]})
principled_bsdf_1 = nw.new_node(Nodes.PrincipledBSDF,
input_kwargs={'Metallic': 0.2636, 'Roughness': 0.0, 'IOR': 1.333, 'Transmission Weight': 0.8205, 'Alpha': colorramp.outputs["Color"]})

mix_shader_1 = nw.new_node(Nodes.MixShader,
input_kwargs={1: mix_shader, 2: principled_bsdf_1})
input_kwargs={'Shader': mix_shader, 'Shader_001': principled_bsdf_1})

volume_scatter = nw.new_node('ShaderNodeVolumeScatter',
volume_scatter = nw.new_node(Nodes.VolumeScatter,
input_kwargs={'Color': (0.5841, 0.7339, 0.8, 1.0)})

material_output = nw.new_node(Nodes.MaterialOutput,
material_output = nw.new_node(Nodes.MaterialOutput,
input_kwargs={'Surface': mix_shader_1, 'Volume': volume_scatter})

def geometry_geo_water(nw: NodeWrangler):
# Code generated using version 2.4.3 of the node_transpiler

group_input = nw.new_node(Nodes.GroupInput,
expose_input=[('NodeSocketGeometry', 'Geometry', None)])

group_input = nw.expose_input('Geometry', dtype='NodeSocketGeometry')

position = nw.new_node(Nodes.InputPosition)

add = nw.new_node(Nodes.VectorMath,
input_kwargs={0: position, 1: (630.0, 564.0, 374.0)})
input_kwargs={'Vector': position, 'Vector_001': (630.0, 564.0, 374.0)})

musgrave_texture = nw.new_node(Nodes.MusgraveTexture,
input_kwargs={'Vector': add.outputs["Vector"], 'Scale': 4.1307, 'Detail': 9.7953, 'Dimension': 1.34, 'Lacunarity': 1.8087})
input_kwargs={'Vector': add.outputs["Vector"], 'Scale': 4.1307, 'Detail': 9.7953, 'Roughness': 1.34, 'Lacunarity': 1.8087})

multiply = nw.new_node(Nodes.VectorMath,
input_kwargs={0: musgrave_texture, 1: (0.0, 0.0, 0.0128)},
input_kwargs={'Vector': musgrave_texture, 'Vector_001': (0.0, 0.0, 0.0128)},
attrs={'operation': 'MULTIPLY'})

value = nw.new_node(Nodes.Value)
value = nw.new_node(Nodes.Value)
value.outputs[0].default_value = 1.0

multiply_1 = nw.new_node(Nodes.VectorMath,
input_kwargs={0: multiply.outputs["Vector"], 1: value},
input_kwargs={'Vector': multiply.outputs["Vector"], 'Vector_001': value},
attrs={'operation': 'MULTIPLY'})

set_position = nw.new_node(Nodes.SetPosition,
input_kwargs={'Geometry': group_input.outputs["Geometry"], 'Offset': multiply_1.outputs["Vector"]})

input_kwargs={'Geometry': group_input, 'Offset': multiply_1.outputs["Vector"]})
group_output = nw.new_node(Nodes.GroupOutput,
input_kwargs={'Geometry': set_position})
input_kwargs={'Geometry': set_position.outputs['Geometry']})



Expand Down
8 changes: 4 additions & 4 deletions infinigen/core/execute_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
pine_needle, seaweed, coral_reef, jellyfish, urchin
)

from infinigen.assets.materials import (
mountain, sand, water, atmosphere_light_haze, sandstone, cracked_ground, \
soil, dirt, cobble_stone, chunkyrock, stone, lava, ice, mud, snow
)
# from infinigen.assets.materials import (
# mountain, sand, water, atmosphere_light_haze, sandstone, cracked_ground, \
# soil, dirt, cobble_stone, chunkyrock, stone, lava, ice, mud, snow
# )

from infinigen.assets import (
fluid,
Expand Down
1 change: 1 addition & 0 deletions infinigen/core/nodes/node_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Nodes:
Mix = "ShaderNodeMix"
VolumeScatter = "ShaderNodeVolumeScatter"
Displacement = "ShaderNodeDisplacement"
Tree = "ShaderNodeTree"

# Attribute
Attribute = "ShaderNodeAttribute"
Expand Down
5 changes: 3 additions & 2 deletions infinigen/core/nodes/node_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import bpy

from infinigen.core import surface
from infinigen.core.nodes.node_wrangler import Nodes, NodeWrangler
from infinigen.core.nodes.node_wrangler import Nodes, NodeWrangler, geometry_node_group_empty_new
from infinigen.core.util.blender import group_in_collection
from infinigen.core.util.color import random_color_mapping

Expand Down Expand Up @@ -47,7 +47,8 @@ def init_fn(*args, **kwargs):
if singleton and name in bpy.data.node_groups:
return bpy.data.node_groups[name]
else:
ng = bpy.data.node_groups.new(name, type)
ng = geometry_node_group_empty_new()
ng.name = name
nw = NodeWrangler(ng)
fn(nw, *args, **kwargs)
return ng
Expand Down
Loading

0 comments on commit 22a41d4

Please sign in to comment.