Blender: improve import Material generation

This commit is contained in:
brothermechanic 2023-10-16 15:25:37 +03:00 committed by Igor Brylyov
parent 25c9cbfbe9
commit 9222104a1a

View file

@ -74,6 +74,12 @@ def assign_materials(bobj, fem_mat):
principled.roughness = rg
principled.emission_color = e_col
principled.alpha = alpha
bevel = bmat.node_tree.nodes.new(type="ShaderNodeBevel")
bevel.location = -300, -300
bevel.samples = 32
bevel.inputs[0].default_value = 0.001
principled_node = bmat.node_tree.nodes["Principled BSDF"]
bmat.node_tree.links.new(bevel.outputs['Normal'], principled_node.inputs['Normal'])
# prepare for reimport
if len(bobj.material_slots) < 1:
bobj.data.materials.append(bmat)