From 6c0008c7cf577547b9362b35f7fa7e688e22f4b9 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Fri, 24 Jan 2025 16:19:51 -0500 Subject: [PATCH] Add node for preview 3d animation --- comfy_extras/nodes_load_3d.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/comfy_extras/nodes_load_3d.py b/comfy_extras/nodes_load_3d.py index 436131aba..60934d735 100644 --- a/comfy_extras/nodes_load_3d.py +++ b/comfy_extras/nodes_load_3d.py @@ -121,14 +121,40 @@ class Preview3D(): def process(self, model_file, **kwargs): return {"ui": {"model_file": [model_file]}, "result": ()} +class Preview3DAnimation(): + @classmethod + def INPUT_TYPES(s): + return {"required": { + "model_file": ("STRING", {"default": "", "multiline": False}), + "material": (["original", "normal", "wireframe", "depth"],), + "bg_color": ("STRING", {"default": "#000000", "multiline": False}), + "light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}), + "up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],), + "animation_speed": (["0.1", "0.5", "1", "1.5", "2"], {"default": "1"}), + "fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}), + }} + + OUTPUT_NODE = True + RETURN_TYPES = () + + CATEGORY = "3d" + + FUNCTION = "process" + EXPERIMENTAL = True + + def process(self, model_file, **kwargs): + return {"ui": {"model_file": [model_file]}, "result": ()} + NODE_CLASS_MAPPINGS = { "Load3D": Load3D, "Load3DAnimation": Load3DAnimation, - "Preview3D": Preview3D + "Preview3D": Preview3D, + "Preview3DAnimation": Preview3DAnimation } NODE_DISPLAY_NAME_MAPPINGS = { "Load3D": "Load 3D", "Load3DAnimation": "Load 3D - Animation", - "Preview3D": "Preview 3D" + "Preview3D": "Preview 3D", + "Preview3DAnimation": "Preview 3D - Animation" }