blender-scripting
blender-scripting copied to clipboard
Materials broken in blender 4.0 (solution)
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