nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree print(nodetree)
あるいは、以下でも可
出力結果:
nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes for n in nodes: print(n)
出力結果:
nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes for i in nodes["Material Output"].inputs : print(i)
または:
または:
出力結果:
nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes print(nodes["Material Output"].inputs[0].links[0].from_node )
出力結果:
nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes for n in nodes["RGB"].outputs[0].links : print(n.to_node)
または:
出力結果:
nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes print(nodes["RGB"].outputs[0].default_value[0]) print(nodes["RGB"].outputs[0].default_value[1]) print(nodes["RGB"].outputs[0].default_value[2])
出力結果
import bpy nodetree = bpy.context.active_object.material_slots["Material-red"].material.node_tree nodes = nodetree.nodes print("Base Color ", nodes["Principled BSDF"].inputs["Base Color"].default_value[0]) print("Base Color ", nodes["Principled BSDF"].inputs["Base Color"].default_value[1]) print("Base Color ", nodes["Principled BSDF"].inputs["Base Color"].default_value[2]) print("Subsurface ", nodes["Principled BSDF"].inputs["Subsurface"].default_value)
出力結果