* Renamed Call Haxe node to Call Function because it will now be able to call node functions as well. * Added ability to pass arguments to the Call Function node. * Created Function and Function output nodes that allow you to create functions in node trees. Node functions can be called from other nodes and from Haxe.
23 lines
653 B
Python
23 lines
653 B
Python
import bpy
|
|
from bpy.props import *
|
|
from bpy.types import Node, NodeSocket
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
class FunctionOutputNode(Node, ArmLogicTreeNode):
|
|
'''Function output node'''
|
|
bl_idname = 'LNFunctionOutputNode'
|
|
bl_label = 'Function Output'
|
|
bl_icon = 'CURVE_PATH'
|
|
|
|
def init(self, context):
|
|
self.inputs.new('ArmNodeSocketAction', 'In')
|
|
self.inputs.new('NodeSocketShader', 'Value')
|
|
|
|
function_name = StringProperty(name="Name")
|
|
|
|
def draw_buttons(self, context, layout):
|
|
row = layout.row(align=True)
|
|
row.prop(self, 'function_name')
|
|
|
|
add_node(FunctionOutputNode, category='Logic')
|