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
+2 -2
View File
@@ -478,7 +478,7 @@ class TestShouldGenerateUVs(NewFile):
obj.data.materials.append(material)
material.use_nodes = True
bsdf = material.node_tree.nodes["Principled BSDF"]
bsdf = tool.Blender.get_material_node(material, "BSDF_PRINCIPLED")
node = material.node_tree.nodes.new(type="ShaderNodeTexImage")
material.node_tree.links.new(bsdf.inputs["Base Color"], node.outputs["Color"])
@@ -494,7 +494,7 @@ class TestShouldGenerateUVs(NewFile):
obj.data.materials.append(material)
material.use_nodes = True
bsdf = material.node_tree.nodes["Principled BSDF"]
bsdf = tool.Blender.get_material_node(material, "BSDF_PRINCIPLED")
node = material.node_tree.nodes.new(type="ShaderNodeTexImage")
material.node_tree.links.new(bsdf.inputs["Base Color"], node.outputs["Color"])