Getting shader graph nodes by type rather than name #3316

Because relying on names doesn't work for non english users
This commit is contained in:
Andrej730
2023-06-19 16:09:42 +05:00
parent dfc5a280a4
commit a34be6ae5d
7 changed files with 27 additions and 16 deletions
@@ -176,7 +176,8 @@ def import_ifc(filename, use_names, process_relations, blender_booleans):
mat.use_screen_refraction = True
mat.refraction_depth = 0.1
mat.use_nodes = True
mat.node_tree.nodes["Principled BSDF"].inputs[15].default_value = v
bsdf = next(n for n in mat.node_tree.nodes if n.type == "BSDF_PRINCIPLED")
bsdf.inputs[15].default_value = v
else:
setattr(mat, k, v)
me.materials.append(mat)