File size: 759 Bytes
d5779bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ์™€์ผ๋“œ ์นด๋“œ๋ฅผ ์†์ด๋Š” ์šฉ๋„? ์ž„ํŒฉํŠธํŒฉ์—์„œ ๊ฐ€์ ธ์˜ด
class AnyType(str):
    def __ne__(self, __value: object) -> bool:
        return False

any_typ = AnyType("*")

class NodeSwitch:
	def __init__(self):
		pass

	@classmethod
	def INPUT_TYPES(self):
		return {
			"required": {
				"DeTK": ("BOOLEAN", { "default": True, "label_on": "case1", "label_off": "case2" }),
			},
			"optional": {
				"case1": (any_typ,),
    		"case2": (any_typ,)
			}
		}
	CATEGORY = "Switch"
	FUNCTION = "run"
	RETURN_TYPES = (any_typ,)

	def run(self, DeTK, case1, case2):
		return ((case1 if DeTK else case2),)

NODE_CLASS_MAPPINGS = {
	"NodeSwitch": NodeSwitch
}
NODE_DISPLAY_NAME_MAPPINGS = {
	"NodeSwitch": "NodeSwitch",
}