29 lines
827 B
Python
29 lines
827 B
Python
import bpy
|
|
|
|
from lnx.logicnode.lnx_nodes import *
|
|
|
|
|
|
class ScriptNode(LnxLogicTreeNode):
|
|
"""Executes the given script."""
|
|
bl_idname = 'LNScriptNode'
|
|
bl_label = 'Script'
|
|
lnx_section = 'haxe'
|
|
lnx_version = 1
|
|
|
|
@property
|
|
def property0(self):
|
|
return bpy.data.texts[self.property0_].as_string() if self.property0_ in bpy.data.texts else ''
|
|
|
|
|
|
property0_: HaxeStringProperty('property0', name='Text', default='')
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxNodeSocketAction', 'In')
|
|
self.add_input('LnxNodeSocketArray', 'Array')
|
|
|
|
self.add_output('LnxNodeSocketAction', 'Out')
|
|
self.add_output('LnxDynamicSocket', 'Result')
|
|
|
|
def draw_buttons(self, context, layout):
|
|
layout.prop_search(self, 'property0_', bpy.data, 'texts', icon='NONE', text='')
|