Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Materials broken in blender 4.0 (solution) #13

Open
MauBorre opened this issue Apr 9, 2024 · 0 comments
Open

Materials broken in blender 4.0 (solution) #13

MauBorre opened this issue Apr 9, 2024 · 0 comments

Comments

@MauBorre
Copy link

MauBorre commented Apr 9, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant