From 9222104a1ae95012beb4a23884b231192dd48109 Mon Sep 17 00:00:00 2001 From: brothermechanic Date: Mon, 16 Oct 2023 15:25:37 +0300 Subject: [PATCH] Blender: improve import Material generation --- cg/blender/import_cad/import_materials.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cg/blender/import_cad/import_materials.py b/cg/blender/import_cad/import_materials.py index dc957ad..82bb114 100644 --- a/cg/blender/import_cad/import_materials.py +++ b/cg/blender/import_cad/import_materials.py @@ -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)