From 78a86daaf71dab5be34b90b13491460854718485 Mon Sep 17 00:00:00 2001 From: Mel Massadian Date: Sat, 27 Apr 2024 21:11:53 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20FloatToFloats=20(the?= =?UTF-8?q?=20counterpart)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodes/graph_utils.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/nodes/graph_utils.py b/nodes/graph_utils.py index 279c69a..a70576c 100644 --- a/nodes/graph_utils.py +++ b/nodes/graph_utils.py @@ -168,11 +168,28 @@ class MTB_MatchDimensions: return (resized_source, new_width, new_height) -class MTB_FloatsToFloat: - """AD, IPA, Fitz etc have commonly choose to mistype float lists as FLOAT. +class MTB_FloatToFloats: + """Conversion utility for compatibility with other extensions (AD, IPA, Fitz are using FLOAT to represent list of floats.)""" - This is just a hack to be compatible with these - """ + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "float": ("FLOAT",), + } + } + + RETURN_TYPES = ("FLOATS",) + RETURN_NAMES = ("floats",) + CATEGORY = "mtb/utils" + FUNCTION = "convert" + + def convert(self, floats): + return (floats,) + + +class MTB_FloatsToFloat: + """Conversion utility for compatibility with other extensions (AD, IPA, Fitz are using FLOAT to represent list of floats.)""" @classmethod def INPUT_TYPES(cls): @@ -596,4 +613,5 @@ __nodes__ = [ MTB_MatchDimensions, MTB_AutoPanEquilateral, MTB_FloatsToFloat, + MTB_FloatToFloats, ]