スポンサーリンク
import bpy nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes nodes.new('ShaderNodeBsdfDiffuse')
import bpy nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes nodes.remove( nodes['Diffuse BSDF'] )
import bpy nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes diffuse = nodes['Diffuse BSDF'] MaterialOutput = nodes['Material Output'] nodetree.links.new(diffuse.outputs[0],MaterialOutput.inputs[0])
import bpy nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes diffuse = nodes['Diffuse BSDF'] diffuse.label = "Diffuse BSDF -added"