Update Files

This commit is contained in:
2025-01-22 16:18:30 +01:00
parent ed4603cf95
commit a36294b518
16718 changed files with 2960346 additions and 0 deletions

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class ClearMapNode(LnxLogicTreeNode):
"""Clear Map"""
bl_idname = 'LNClearMapNode'
bl_label = 'Clear Map'
lnx_version = 1
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Map')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,38 @@
from lnx.logicnode.lnx_nodes import *
class CreateMapNode(LnxLogicTreeNode):
"""Create Map"""
bl_idname = 'LNCreateMapNode'
bl_label = 'Create Map'
lnx_version = 1
property0: HaxeEnumProperty(
'property0',
items = [('string', 'String', 'String Map Key Type'),
('int', 'Int', 'Int Map key type'),
('enumvalue', 'EnumValue', 'EnumValue Map key type'),
('object', 'Object', 'Object Map key type')],
name='Key',
default='string')
property1: HaxeEnumProperty(
'property1',
items = [('string', 'String', 'String Map Value Type'),
('vector', 'Vector', 'Vector Map Value Type'),
('float', 'Float', 'Float Map Value Type'),
('integer', 'Integer', 'Integer Map Value Type'),
('boolean', 'Boolean', 'Boolean Map Value Type'),
('dynamic', 'Dynamic', 'Dynamic Map Value Type')],
name='Value',
default='string')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
layout.prop(self, 'property1')
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxDynamicSocket', 'Map')

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class GetMapValueNode(LnxLogicTreeNode):
"""Get Map Value"""
bl_idname = 'LNGetMapValueNode'
bl_label = 'Get Map Value'
lnx_version = 1
def init(self, context):
self.add_input('LnxDynamicSocket', 'Map')
self.add_input('LnxDynamicSocket', 'Key')
self.add_output('LnxDynamicSocket', 'Value')

View File

@ -0,0 +1,18 @@
from lnx.logicnode.lnx_nodes import *
class ParseJsonNode(LnxLogicTreeNode):
"""Parse a JSON String to Haxe object.
@input JSON: JSON string.
@output Value: Parsed value.
"""
bl_idname = 'LNParseJsonNode'
bl_label = 'Parse JSON'
lnx_version = 1
def init(self, context):
self.add_input('LnxStringSocket', 'JSON')
self.add_output('LnxDynamicSocket', 'Value')

View File

@ -0,0 +1,18 @@
from lnx.logicnode.lnx_nodes import *
class JsonStringifyNode(LnxLogicTreeNode):
"""Convert a Haxe object to JSON String.
@input Value: Value to convert.
@output String: JSON String.
"""
bl_idname = 'LNJsonStringifyNode'
bl_label = 'JSON Stringify'
lnx_version = 1
def init(self, context):
self.add_input('LnxDynamicSocket', 'Value')
self.add_output('LnxStringSocket', 'JSON')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
class MapKeyExistsNode(LnxLogicTreeNode):
"""Map Key Exists"""
bl_idname = 'LNMapKeyExistsNode'
bl_label = 'Map Key Exists'
lnx_version = 1
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Map')
self.add_input('LnxDynamicSocket', 'Key')
self.add_output('LnxNodeSocketAction', 'True')
self.add_output('LnxNodeSocketAction', 'False')

View File

@ -0,0 +1,18 @@
from lnx.logicnode.lnx_nodes import *
class MapLoopNode(LnxLogicTreeNode):
"""Map Loop"""
bl_idname = 'LNMapLoopNode'
bl_label = 'Map Loop'
lnx_version = 1
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Map')
self.add_output('LnxNodeSocketAction', 'Loop')
self.add_output('LnxDynamicSocket', 'Key')
self.add_output('LnxDynamicSocket', 'Value')
self.add_output('LnxNodeSocketAction', 'Done')

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class RemoveMapKeyNode(LnxLogicTreeNode):
"""Remove Map Key"""
bl_idname = 'LNRemoveMapKeyNode'
bl_label = 'Remove Map Key'
lnx_version = 1
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Map')
self.add_input('LnxDynamicSocket', 'Key')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,26 @@
from lnx.logicnode.lnx_nodes import *
class SetMapFromArrayNode(LnxLogicTreeNode):
"""Set Map From Arrays.
@input In: Set the map.
@input Map: Map to set values.
@input Key: Array of keys to be set.
@input Value: Array of corresponding values for the keys.
"""
bl_idname = 'LNSetMapFromArrayNode'
bl_label = 'Set Map From Array'
lnx_version = 1
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Map')
self.add_input('LnxNodeSocketArray', 'Keys')
self.add_input('LnxNodeSocketArray', 'Values')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,26 @@
from lnx.logicnode.lnx_nodes import *
class SetMapValueNode(LnxLogicTreeNode):
"""Set Map Value.
@input In: Set the map.
@input Map: Map to set values.
@input Key: Key to be set.
@input Value: Value for the key.
"""
bl_idname = 'LNSetMapValueNode'
bl_label = 'Set Map Value'
lnx_version = 1
def init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxDynamicSocket', 'Map')
self.add_input('LnxDynamicSocket', 'Key')
self.add_input('LnxDynamicSocket', 'Value')
self.add_output('LnxNodeSocketAction', 'Out')

View File

@ -0,0 +1,55 @@
from lnx.logicnode.lnx_nodes import *
class StringMapNode(LnxLogicTreeNode):
"""Create String Map.
@input In: Create a map using given keys and values.
@input Key: Key.
@input Value: Value.
@output Out: Run after map is created.
@output Map: The created map.
"""
bl_idname = 'LNStringMapNode'
bl_label = 'String Map'
lnx_version = 1
min_inputs = 1
property0: HaxeIntProperty('property0', name='Number of keys', default=0)
def __init__(self):
super(StringMapNode, self).__init__()
self.register_id()
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxDynamicSocket', 'Map')
def add_sockets(self):
self.add_input('LnxStringSocket', f'Key [{self.property0}]')
self.add_input('LnxStringSocket', f'Value [{self.property0}]')
self.property0 += 1
def remove_sockets(self):
if self.property0 > 0:
self.inputs.remove(self.inputs.values()[-1])
self.inputs.remove(self.inputs.values()[-1])
self.property0 -= 1
def draw_buttons(self, context, layout):
row = layout.row(align=True)
op = row.operator('lnx.node_call_func', text='New', icon='PLUS', emboss=True)
op.node_index = self.get_id_str()
op.callback_name = 'add_sockets'
column = row.column(align=True)
op = column.operator('lnx.node_call_func', text='', icon='X', emboss=True)
op.node_index = self.get_id_str()
op.callback_name = 'remove_sockets'
if len(self.inputs) == self.min_inputs:
column.enabled = False

View File

@ -0,0 +1 @@