42 lines
997 B
Python
42 lines
997 B
Python
|
|
|
|
NODE_NAME = 'TextJoin'
|
|
|
|
class TextJoin:
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {
|
|
"required": {
|
|
"text_1": ("STRING", {"multiline": False}),
|
|
|
|
},
|
|
"optional": {
|
|
"text_2": ("STRING", {"multiline": False}),
|
|
"text_3": ("STRING", {"multiline": False}),
|
|
"text_4": ("STRING", {"multiline": False}),
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("STRING",)
|
|
RETURN_NAMES = ("text",)
|
|
FUNCTION = "text_join"
|
|
CATEGORY = '😺dzNodes/LayerUtility/Data'
|
|
|
|
def text_join(self, **kwargs):
|
|
|
|
texts = [kwargs[key] for key in kwargs if key.startswith('text')]
|
|
combined_text = ', '.join(texts)
|
|
return (combined_text.encode('unicode-escape').decode('unicode-escape'),)
|
|
|
|
|
|
NODE_CLASS_MAPPINGS = {
|
|
"LayerUtility: TextJoin": TextJoin
|
|
}
|
|
|
|
NODE_DISPLAY_NAME_MAPPINGS = {
|
|
"LayerUtility: TextJoin": "LayerUtility: TextJoin"
|
|
} |