forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
28
leenkx/blender/lnx/logicnode/native/LN_script.py
Normal file
28
leenkx/blender/lnx/logicnode/native/LN_script.py
Normal file
@ -0,0 +1,28 @@
|
||||
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='')
|
Reference in New Issue
Block a user