pynodes.core#

Module Contents#

Classes#

Functions#

camel_to_snake

new_node

new_link

get_param_name

dispath_tree

tree

Decorate a function to make it represent a Node Tree.

frame

simulate

repeat

reload

Data#

API#

pynodes.core.is_4_0_beta_or_higher = None#
pynodes.core.camel_to_snake(name)#
class pynodes.core.NodeWraper(bnode: bpy.types.Node)#

Initialization

property outputs#
property inputs#
property color#
property label: str#
plug_inputs(inputs_all: list[tuple])#
__setitem__(key: str | int, value)#
class pynodes.core.SocketWraper(bsocket: bpy.types.NodeSocket)#

Initialization

property default_value#
class pynodes.core.Socket(bsocket: bpy.types.NodeSocket)#

Bases: pynodes.core.SocketWraper

Base class of datasocks and geosocks, represents an output socket

Initialization

bl_idname = 'NodeSocket'#
property node#
__call__(name: str)#
__setitem__(key: str, value)#
delete()#
copy(number: int)#
property name: str#
func_ret_to_tree_output()#
property linked_to_group_output#
classmethod Input(default=None, name=None, min=None, max=None, description=None, bl_idname=None)#
property Float#
property Angle#
property Distance#
property Factor#
property Percentage#
property FloatTime#
property FloatTimeAbsolute#
property Unsigned#
property Integer#
property IntFactor#
property IntPercentage#
property IntUnsigned#
property Boolean#
property Vector#
property VectorAcceleration#
property VectorDirection#
property VectorEuler#
property VectorTranslation#
property VectorVelocity#
property VectorXYZ#
property Color#
property Geometry#
property Mesh#
property Points#
property Volume#
property Instances#
property Curve#
property String#
property Object#
property Collection#
property Texture#
property Material#
property Image#
property Shader#
class pynodes.core.Tree(node_tree: bpy.types.NodeTree)#

Initialization

tree: pynodes.core.Tree = None#
property group_input_node#
remove_orphan_input_node()#
property group_output_node#
property tree_output_node#
property is_embedded#

True if self.btree is the node_tree of a material object

property cur_frame#

Get the current layout for the newly created nodes.

new_node(bl_idname: str, properties: list[tuple] = None, inputs: list[tuple] = None)#
new_group_node(node_tree: bpy.types.NodeTree)#
new_input(type='NodeSocketGeometry', name='Geometry')#
new_output(type='NodeSocketGeometry', name='Geometry')#
frame(label='Layout')#
simulate(*input_sockets: pynodes.core.Socket, fakes: list[int] | int = None)#
repeat(*input_sockets: pynodes.core.Socket, iterations=1, fakes: list[int] | int = None)#
class pynodes.core.Group(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

__call__(**kwargs)#
__getitem__(name: str)#
__setitem__(name: str, value)#
class pynodes.core.Frame(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

bl_idname = 'NodeFrame'#
class pynodes.core.SimulationInput(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

bl_idname = 'GeometryNodeSimulationInput'#
property delta_time#
class pynodes.core.SimulationOutput(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

bl_idname = 'GeometryNodeSimulationOutput'#
class pynodes.core.RepeatInput(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

bl_idname = 'GeometryNodeRepeatInput'#
class pynodes.core.RepeatOutput(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

bl_idname = 'GeometryNodeRepeatOutput'#
class pynodes.core.SimulationZone(input_node: pynodes.core.SimulationInput, output_node: pynodes.core.SimulationOutput)#

Initialization

to_outputs(*sockets: pynodes.core.Socket)#
property delta_time#
class pynodes.core.RepeatZone(input_node: pynodes.core.RepeatInput, output_node: pynodes.core.RepeatOutput)#

Initialization

to_outputs(*sockets: pynodes.core.Socket)#
class pynodes.core.Script(bnode: bpy.types.Node)#

Bases: pynodes.core.NodeWraper

Initialization

bl_idname = 'ShaderNodeScript'#
__setitem__(key: str | int, value)#
__getitem__(key: str | int)#
property fac#
property height#
property color#
property vector#
pynodes.core.new_node(bl_idname: str, properties: list[tuple] = None, inputs: list[tuple] = None)#
pynodes.core.Param = None#
pynodes.core.RT = None#
pynodes.core.get_param_name(param: inspect.Parameter) str#
pynodes.core.dispath_tree(func: Callable)#
pynodes.core.tree(func: Callable[pynodes.core.Param, pynodes.core.RT]) Callable[pynodes.core.Param, pynodes.core.RT]#

Decorate a function to make it represent a Node Tree.

The function documentation(docstring) defines the type of the Node Tree.

  • Examples:

@tree
def node_group_name(): # A Geometry Node Group Tree with tree name `Node Group Name`
    ...
@tree
def foo(): # A Geometry Node Froup Tree with tree name `Node Group Name In __docstring__`
    '''Node Group Name In __docstring__'''
@tree
def node_group_name(): # A Shader Node Group Tree with tree name `Node Group Name`
    '''@Shader'''
@tree
def foo(): # A Shader Node Group Tree with tree name `Node Group Name In __docstring__`
    '''@Shader: Node Group Name In __docstring__'''
@tree
def mat_name(): # A material tree with material name `Mat Name`
    '''@Material'''
@tree
def foo(): # An material tree with material name `Mat Name In __docstring__`
    '''@Material: Mat Name In __docstring__'''
@tree
def world_name(): # A world shader tree with world name `World Name`
    '''@World'''
@tree
def foo(): # An world shader tree with world name `World Name In __docstring__`
    '''@World: World Name In __docstring__'''
@tree
def light_name(): # A light shader tree with light name `Light Name`
    '''@Light'''
@tree
def foo(): # An light shader tree with light name `Light Name In __docstring__`
    '''@Light: Light Name In __docstring__'''
@tree
def scene_name(): # A scene compositor tree with scene name `Scene Name`
    '''@Scene'''
@tree
def foo(): # A scene compositor tree with light name `Scene Name In __docstring__`
    '''@Scene: Scene Name In __docstring__'''
@tree
def scene_name(): # A scene compositor tree with scene name `Scene Name`
    '''@Compositor'''
@tree
def foo(): # A scene compositor tree with light name `Scene Name In __docstring__`
    '''@Compositor: Scene Name In __docstring__'''
pynodes.core.frame(label='Layout')#
pynodes.core.simulate(*input_sockets: pynodes.core.Socket, fakes: list[int] | int = None)#
pynodes.core.repeat(*input_sockets: pynodes.core.Socket, iterations=1, fakes: list[int] | int = None)#
pynodes.core.reload()#