Bpy_speckle is hardcoded to require specific material shaders (Principled BSDF)

I have a scene I was looking to push to speckle (more tests) that fails because I’m using different shader nodes from that which is hardcoded into bpy_speckle.

Using “Diffuse BSDF”, addon expecting “Principled BSDF”

def material_to_speckle(blender_object) -> RenderMaterial:
    """Create and return a render material from a blender object"""


    if blender_mat.use_nodes is True:
        inputs = blender_mat.node_tree.nodes["Principled BSDF"].inputs
        speckle_mat.diffuse = to_argb_int(inputs["Base Color"].default_value)
        speckle_mat.emissive = to_argb_int(inputs["Emission"].default_value)


While the addon is still developing Is it better to report this as an issue directly to the repo or rather than report it here?



feel free to raise this as an issue in the repo :rocket:

tbh I am not very familiar with the different shader and renderer options in blender so at the time this seemed like the simplest method that worked with all the test files I was using. however I am totally happy to take a deeper dive into blender materials to find a better and more general solution. if you also happen to have a file that you’d be willing to share privately with me, that would be lit!

1 Like