mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-03 21:07:27 +08:00
refactor: simplify Load3DModelInfo schema and rename model_info to model_3d_info
This commit is contained in:
parent
d9caddfcfc
commit
1161959952
@ -779,19 +779,13 @@ class Load3DCamera(ComfyTypeIO):
|
|||||||
|
|
||||||
@comfytype(io_type="LOAD3D_MODEL_INFO")
|
@comfytype(io_type="LOAD3D_MODEL_INFO")
|
||||||
class Load3DModelInfo(ComfyTypeIO):
|
class Load3DModelInfo(ComfyTypeIO):
|
||||||
class ModelTransform(TypedDict):
|
class Model3DTransform(TypedDict):
|
||||||
uuid: str
|
# Coordinate system: right-handed, Y-up, world space
|
||||||
name: str
|
position: dict[str, float | int] # scene units
|
||||||
type: str
|
quaternion: dict[str, float | int] # normalized, dimensionless; world rotation
|
||||||
position: dict[str, float | int]
|
scale: dict[str, float | int] # dimensionless multiplier
|
||||||
rotation: dict[str, float | int | str]
|
|
||||||
quaternion: dict[str, float | int]
|
|
||||||
scale: dict[str, float | int]
|
|
||||||
up: dict[str, float | int]
|
|
||||||
visible: bool
|
|
||||||
matrix: list[float]
|
|
||||||
|
|
||||||
Type = list[ModelTransform]
|
Type = list[Model3DTransform]
|
||||||
|
|
||||||
|
|
||||||
@comfytype(io_type="LOAD_3D")
|
@comfytype(io_type="LOAD_3D")
|
||||||
@ -803,7 +797,7 @@ class Load3D(ComfyTypeIO):
|
|||||||
normal: str
|
normal: str
|
||||||
camera_info: Load3DCamera.CameraInfo
|
camera_info: Load3DCamera.CameraInfo
|
||||||
recording: NotRequired[str]
|
recording: NotRequired[str]
|
||||||
model_info: NotRequired[list[Load3DModelInfo.ModelTransform]]
|
model_3d_info: NotRequired[list[Load3DModelInfo.Model3DTransform]]
|
||||||
|
|
||||||
Type = Model3DDict
|
Type = Model3DDict
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class Load3D(IO.ComfyNode):
|
|||||||
IO.Load3DCamera.Output(display_name="camera_info"),
|
IO.Load3DCamera.Output(display_name="camera_info"),
|
||||||
IO.Video.Output(display_name="recording_video"),
|
IO.Video.Output(display_name="recording_video"),
|
||||||
IO.File3DAny.Output(display_name="model_3d"),
|
IO.File3DAny.Output(display_name="model_3d"),
|
||||||
IO.Load3DModelInfo.Output(display_name="model_info"),
|
IO.Load3DModelInfo.Output(display_name="model_3d_info"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -74,8 +74,8 @@ class Load3D(IO.ComfyNode):
|
|||||||
if model_file and model_file != "none":
|
if model_file and model_file != "none":
|
||||||
file_3d = Types.File3D(folder_paths.get_annotated_filepath(model_file))
|
file_3d = Types.File3D(folder_paths.get_annotated_filepath(model_file))
|
||||||
mesh_path = model_file
|
mesh_path = model_file
|
||||||
model_info = image.get('model_info', [])
|
model_3d_info = image.get('model_3d_info', [])
|
||||||
return IO.NodeOutput(output_image, output_mask, mesh_path, normal_image, image['camera_info'], video, file_3d, model_info)
|
return IO.NodeOutput(output_image, output_mask, mesh_path, normal_image, image['camera_info'], video, file_3d, model_3d_info)
|
||||||
|
|
||||||
process = execute # TODO: remove
|
process = execute # TODO: remove
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user