Nodes/MKRShift_Nodes/Blender Material Return Plan
ComfyUI Node

Blender Material Return Plan

Which generated map lands in which slot

By criskb·Created 7 months ago·Updated 5 months ago· 0
Blender Material Return Plan
    • material_return_plan_json
    • manifest_line
    • summary_json
    material_nameMKRShift Material
    base_color_path
    normal_path
    roughness_path
    metallic_path
    emission_path
    alpha_path
    target_object_name
    target_material_slot
    notes

    A PBR material isn't one image - it's a stack: base color, normal, roughness, metallic, emission, alpha. When you generate textures in ComfyUI, you want to hand all of them back to Blender and have them land in the right slots, not shuffled into a folder of numbered files. MKRBlenderMaterialReturnPlan is the node that writes that contract down. You tell it where each map lives and which Blender object and material slot they belong to, and it produces a material_return_plan_json plus a manifest line that the add-on side can act on.

    Part of MKRShift_Nodes by criskb. Install via ComfyUI Manager (search "MKRShift_Nodes") or git clone https://github.com/criskb/MKRShift_Nodes into custom_nodes/, restart.

    The inputs - it's mostly a list of paths

    The node is basically six file-path fields plus targeting:

    • base_color_path, normal_path, roughness_path, metallic_path, emission_path, alpha_path - where each generated map sits on disk. Leave the ones you don't have empty; the plan only lists what you fill in.
    • material_name - the name the rebuilt material should carry.
    • target_object_name and target_material_slot - where in the scene it applies. These are optional in effect: empty means "first/best guess," filled means "this object, this slot."
    • notes (optional) - free text riders for the plan.

    Outputs: material_return_plan_json (the structured plan), manifest_line (a compact CSV-style summary for logging or a downstream manifest node), and summary_json.

    How to think about it

    This node plans; it doesn't write. The actual write-back of generated maps is handled by the runtime side (the pack's MKRBlenderReturnOutput family for single assets, and the add-on for the material rebuild). So the flow is: generate your six maps → point this node at them → get the plan → the plan tells the runtime where everything goes. The pattern keeps the intent (which slot gets which map) as inspectable JSON rather than burying it in the graph.

    The one thing to keep straight is that an empty path means "no map," not "Blender should figure it out." If your normal map silently goes missing, the first thing to check is whether normal_path actually got wired from your generation node - this node faithfully reports what you gave it, and the summary won't lie about the count.

    CategoryMKRShift Nodes/Addons/Blender

    Inputs (10)

    NameTypeDefaultDescription
    material_nameSTRINGMKRShift Material
    base_color_pathSTRING
    normal_pathSTRING
    roughness_pathSTRING
    metallic_pathSTRING
    emission_pathSTRING
    alpha_pathSTRING
    target_object_nameSTRING
    target_material_slotSTRING
    notesoptSTRING

    Outputs (3)

    NameTypeDescription
    material_return_plan_jsonSTRING
    manifest_lineSTRING
    summary_jsonSTRING