Why is single Principled, not really " single "

Issue #1752 invalid
bouich jules created an issue

Hello,

I just wondering why is a simple single principled import for materials, still not considered as simple or single:

here is an exemple, a simple principled should be image texture -) principled bdsf -) output ( very easy)

and not a lot of other coordinates, because for people who dont use blender we dont really need them and we have to manually delete them, we just want simple stuff and we do the shading in our game engine, those coordinate and other stuff they can be included in the extended principled but not the single.

Comments (7)

  1. Alessandro Padovani

    To get that type of “simple shader“ you have to bake the textures, then after baking you can use a single image plugged to principled. This is not actually supported you have to do it by hand. There’s plenty of tutorials how to bake textures in blender.

    The single principled option is actually poor in design since it just strips the extras from extended principled, so it’s more a simplification for people who want to edit their own materials than a “ready to use” shader. It is intended to be used with “unused textures“ in global settings. This is not a bug it works as intended.

  2. bouich jules reporter
    import bpy
    
    # Specify the name of your object here
    obj_name = 'YourObjectName'
    
    # Get the object
    obj = bpy.data.objects[obj_name]
    
    # For each material of the object, remove all nodes except for Principled BSDF, Material Output, and Image Texture
    for mat in obj.data.materials:
        if mat.use_nodes:
            nodes = mat.node_tree.nodes
            links = mat.node_tree.links
    
            # Find the Principled BSDF, Material Output, and the first Image Texture nodes
            principled_bsdf = None
            material_output = None
            image_texture = None
            for node in nodes:
                if node.type == 'BSDF_PRINCIPLED':
                    principled_bsdf = node
                elif node.type == 'OUTPUT_MATERIAL':
                    material_output = node
                elif node.type == 'TEX_IMAGE':
                    image_texture = node
    
            # Clear all nodes except the ones we found
            for node in nodes:
                if node != principled_bsdf and node != material_output and node != image_texture:
                    nodes.remove(node)
    
            # Connect Image Texture to Principled BSDF and Principled BSDF to Material Output
            if image_texture and principled_bsdf and material_output:
                links.new(image_texture.outputs['Color'], principled_bsdf.inputs['Base Color'])
                links.new(principled_bsdf.outputs['BSDF'], material_output.inputs['Surface'])
    

    well it works with this script, but no baking.

    i will see if we can automatize the baking

  3. Log in to comment