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,34 @@
from lnx.logicnode.lnx_nodes import *
class ConcatenateStringNode(LnxLogicTreeNode):
"""Concatenates the given string."""
bl_idname = 'LNConcatenateStringNode'
bl_label = 'Concatenate String'
lnx_version = 2
min_inputs = 1
def __init__(self):
super(ConcatenateStringNode, self).__init__()
array_nodes[str(id(self))] = self
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'Input 0')
self.add_output('LnxStringSocket', 'String')
def draw_buttons(self, context, layout):
row = layout.row(align=True)
op = row.operator('lnx.node_add_input', text='New', icon='PLUS', emboss=True)
op.node_index = str(id(self))
op.socket_type = 'LnxStringSocket'
column = row.column(align=True)
op = column.operator('lnx.node_remove_input', text='', icon='X', emboss=True)
op.node_index = str(id(self))
if len(self.inputs) == self.min_inputs:
column.enabled = False
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if self.lnx_version not in (0, 1):
raise LookupError()
return NodeReplacement.Identity(self)

View File

@ -0,0 +1,13 @@
from lnx.logicnode.lnx_nodes import *
class ParseFloatNode(LnxLogicTreeNode):
"""Returns the floats that are in the given string."""
bl_idname = 'LNParseFloatNode'
bl_label = 'Parse Float'
lnx_section = 'parse'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxFloatSocket', 'Float')
self.add_input('LnxStringSocket', 'String')

View File

@ -0,0 +1,13 @@
from lnx.logicnode.lnx_nodes import *
class ParseIntNode(LnxLogicTreeNode):
"""Returns the Ints that are in the given string."""
bl_idname = 'LNParseIntNode'
bl_label = 'Parse Int'
lnx_section = 'parse'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxIntSocket', 'Int')
self.add_input('LnxStringSocket', 'String')

View File

@ -0,0 +1,13 @@
from lnx.logicnode.lnx_nodes import *
class SplitStringNode(LnxLogicTreeNode):
"""Splits the given string."""
bl_idname = 'LNSplitStringNode'
bl_label = 'Split String'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxNodeSocketArray', 'Array')
self.add_input('LnxStringSocket', 'String')
self.add_input('LnxStringSocket', 'Split')

View File

@ -0,0 +1,16 @@
from lnx.logicnode.lnx_nodes import *
class StringNode(LnxLogicVariableNodeMixin, LnxLogicTreeNode):
"""Stores the given string as a variable."""
bl_idname = 'LNStringNode'
bl_label = 'String'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'String In')
self.add_output('LnxStringSocket', 'String Out', is_var=True)
def synchronize_from_master(self, master_node: LnxLogicVariableNodeMixin):
self.inputs[0].default_value_raw = master_node.inputs[0].get_default_value()

View File

@ -0,0 +1,21 @@
from lnx.logicnode.lnx_nodes import *
class CaseStringNode(LnxLogicTreeNode):
"""Changes the given string case."""
bl_idname = 'LNCaseStringNode'
bl_label = 'String Case'
lnx_version = 1
property0: HaxeEnumProperty(
'property0',
items = [('Upper Case', 'Upper Case', 'Upper Case'),
('Lower Case', 'Lower Case', 'Lower Case'),
],
name='', default='Upper Case')
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'String In')
self.add_output('LnxStringSocket', 'String Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -0,0 +1,18 @@
from lnx.logicnode.lnx_nodes import *
class StringCharAtNode(LnxLogicTreeNode):
"""String CharAt"""
bl_idname = 'LNStringCharAtNode'
bl_label = 'String CharAt'
bl_description = 'Returns the character at position index of the String. If the index is negative or exceeds the string.length, an empty String "" is returned.'
lnx_category = 'String'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxStringSocket', 'String')
self.add_input('LnxIntSocket', 'Index')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxStringSocket', 'Char')

View File

@ -0,0 +1,23 @@
from lnx.logicnode.lnx_nodes import *
class ContainsStringNode(LnxLogicTreeNode):
"""Returns whether the given string contains a given part."""
bl_idname = 'LNContainsStringNode'
bl_label = 'String Contains'
lnx_version = 1
property0: HaxeEnumProperty(
'property0',
items = [('Contains', 'Contains', 'Contains'),
('Starts With', 'Starts With', 'Starts With'),
('Ends With', 'Ends With', 'Ends With'),
],
name='', default='Contains')
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'String')
self.add_input('LnxStringSocket', 'Find')
self.add_output('LnxBoolSocket', 'Contains')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')

View File

@ -0,0 +1,12 @@
from lnx.logicnode.lnx_nodes import *
class LengthStringNode(LnxLogicTreeNode):
"""Returns the length of the given string."""
bl_idname = 'LNLengthStringNode'
bl_label = 'String Length'
lnx_version = 1
def lnx_init(self, context):
self.add_output('LnxIntSocket', 'Length')
self.add_input('LnxStringSocket', 'String')

View File

@ -0,0 +1,15 @@
from lnx.logicnode.lnx_nodes import *
class StringReplaceNode(LnxLogicTreeNode):
"""Replace all ocurrences of string to find in the input String"""
bl_idname = 'LNStringReplaceNode'
bl_label = 'String Replace'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'String')
self.add_input('LnxStringSocket', 'Find')
self.add_input('LnxStringSocket', 'Replace')
self.add_output('LnxStringSocket', 'String')

View File

@ -0,0 +1,14 @@
from lnx.logicnode.lnx_nodes import *
class SubStringNode(LnxLogicTreeNode):
"""Returns a part of the given string."""
bl_idname = 'LNSubStringNode'
bl_label = 'Sub String'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxStringSocket', 'String In')
self.add_input('LnxIntSocket', 'Start')
self.add_input('LnxIntSocket', 'End')
self.add_output('LnxStringSocket', 'String Out')

View File

@ -0,0 +1,4 @@
from lnx.logicnode.lnx_nodes import add_node_section
add_node_section(name='default', category='String')
add_node_section(name='parse', category='String')