LNXSDK/leenkx/blender/lnx/logicnode/string/LN_string_contains.py
2025-01-22 16:18:30 +01:00

24 lines
804 B
Python

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')