mirror of
https://github.com/justUmen/Bjornulf_custom_nodes.git
synced 2026-03-21 20:52:11 -03:00
0.61
This commit is contained in:
26
anything_to_text.py
Normal file
26
anything_to_text.py
Normal file
@@ -0,0 +1,26 @@
|
||||
class AnythingToText:
|
||||
@classmethod
|
||||
def INPUT_TYPES(s):
|
||||
return {
|
||||
"required": {
|
||||
"anything": (Everything("*"), {"forceInput": True})
|
||||
},
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def VALIDATE_INPUTS(s, input_types):
|
||||
return True
|
||||
|
||||
RETURN_TYPES = ("STRING",)
|
||||
RETURN_NAMES = ("text",)
|
||||
FUNCTION = "any_to_text"
|
||||
CATEGORY = "Bjornulf"
|
||||
|
||||
def any_to_text(self, anything):
|
||||
# Convert the input to string representation
|
||||
return (str(anything),)
|
||||
|
||||
# Keep the Everything class definition as it's needed for type handling
|
||||
class Everything(str):
|
||||
def __ne__(self, __value: object) -> bool:
|
||||
return False
|
||||
Reference in New Issue
Block a user