ComfyUI-3D-Pack icon indicating copy to clipboard operation
ComfyUI-3D-Pack copied to clipboard

load and save glb meshes

Open imperator-maximus opened this issue 1 year ago • 1 comments

Hi,

I made a very simple test workflow for just testing the load and save nodes: image

I used a simple cube mesh for testing.

But I am getting in load mesh node:

Error occurred when executing [Comfy3D] Load 3D Mesh:

invalid index to scalar variable.

File "E:\SD\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\SD\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\SD\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack\nodes.py", line 196, in load_mesh
mesh = Mesh.load(mesh_file_path, resize, renormal, retex)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack\mesh_processer\mesh.py", line 93, in load
mesh = cls.load_trimesh(path, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\SD\ComfyUI\custom_nodes\ComfyUI-3D-Pack\mesh_processer\mesh.py", line 386, in load_trimesh
mesh.albedo = torch.tensor(texture[..., :3], dtype=torch.float32, device=device).contiguous()
~~~~~~~^^^^^^^^^

Thank you

imperator-maximus avatar May 20 '24 18:05 imperator-maximus

Thanks for testing, I'll add it into bug fix

MrForExample avatar May 21 '24 00:05 MrForExample

Screenshot 2024-07-02 162119 Problem turns out to be one edge case when loading .glb file without albedo texture maps, it will be fixed in next release, along with many other updates to make the system more robust!

MrForExample avatar Jul 02 '24 22:07 MrForExample