Blender: improve import Material generation
This commit is contained in:
parent
25c9cbfbe9
commit
9222104a1a
1 changed files with 6 additions and 0 deletions
|
@ -74,6 +74,12 @@ def assign_materials(bobj, fem_mat):
|
||||||
principled.roughness = rg
|
principled.roughness = rg
|
||||||
principled.emission_color = e_col
|
principled.emission_color = e_col
|
||||||
principled.alpha = alpha
|
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
|
# prepare for reimport
|
||||||
if len(bobj.material_slots) < 1:
|
if len(bobj.material_slots) < 1:
|
||||||
bobj.data.materials.append(bmat)
|
bobj.data.materials.append(bmat)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue