Pages

duminică, 29 decembrie 2024

Blender 3D : ... all available nodes !

An old surce code in python for Blender 3D to see available nodes :
import bpy

node_tree = bpy.context.object.active_material.node_tree

location_x = 0
location_y = 0

for type in dir(bpy.types):
    real_type = getattr(bpy.types, type)
    if issubclass(real_type, bpy.types.ShaderNode):
        try:
            node = node_tree.nodes.new(type)
            node.width = 250
            node.location = (location_x, location_y)
            location_x += 300
            if location_x > 3000:
                location_x = 0
                location_y -= 600
        except:
            pass