blender-scripting icon indicating copy to clipboard operation
blender-scripting copied to clipboard

Materials broken in blender 4.0 (solution)

Open mbit-gh opened this issue 2 years ago • 0 comments

If you can't properly see materials you need to change create_material() in utils/init.py to

def create_material(base_color=(1, 1, 1, 1), metalic=0.0, roughness=0.5):
    mat = bpy.data.materials.new('Material')

    if len(base_color) == 3:
        base_color = list(base_color)
        base_color.append(1)

    mat.use_nodes = True
    bsdfnode = mat.node_tree.nodes["Principled BSDF"]
    bsdfnode.inputs[0].default_value = base_color
    bsdfnode.inputs[1].default_value = metalic
    bsdfnode.inputs[2].default_value = roughness

    return mat

mbit-gh avatar Apr 09 '24 00:04 mbit-gh