Skip to content

Commit 43e79b2

Browse files
committed
add preview 3d node
1 parent 6d1a3f7 commit 43e79b2

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

comfy_extras/nodes_load_3d.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,38 @@ def process(self, model_file, image, **kwargs):
8484

8585
return output_image, output_mask, model_file,
8686

87+
class Preview3D():
88+
@classmethod
89+
def INPUT_TYPES(s):
90+
return {"required": {
91+
"model_file": ("STRING", {"default": "", "multiline": False}),
92+
"show_grid": ([True, False],),
93+
"camera_type": (["perspective", "orthographic"],),
94+
"view": (["front", "right", "top", "isometric"],),
95+
"material": (["original", "normal", "wireframe", "depth"],),
96+
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
97+
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
98+
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
99+
}}
100+
101+
OUTPUT_NODE = True
102+
RETURN_TYPES = ()
103+
104+
CATEGORY = "3d"
105+
106+
FUNCTION = "process"
107+
108+
def process(self, model_file, **kwargs):
109+
return {"ui": {"model_file": [model_file]}, "result": ()}
110+
87111
NODE_CLASS_MAPPINGS = {
88112
"Load3D": Load3D,
89-
"Load3DAnimation": Load3DAnimation
113+
"Load3DAnimation": Load3DAnimation,
114+
"Preview3D": Preview3D
90115
}
91116

92117
NODE_DISPLAY_NAME_MAPPINGS = {
93118
"Load3D": "Load 3D",
94-
"Load3DAnimation": "Load 3D - Animation"
119+
"Load3DAnimation": "Load 3D - Animation",
120+
"Preview3D": "Preview 3D"
95121
}

0 commit comments

Comments
 (0)