meshlab icon indicating copy to clipboard operation
meshlab copied to clipboard

glTF2 format support

Open vpenades opened this issue 6 years ago • 23 comments

It could be nice if MeshLab could provide support for the glTF format.

There's already a number of libraries in C++ for it, like https://github.com/Microsoft/glTF-Toolkit

vpenades avatar Apr 10 '19 09:04 vpenades

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 19 '20 19:06 stale[bot]

Is there any progress on this issue? If not, I'd like to start with it.

goldragoon avatar Aug 06 '20 07:08 goldragoon

Hi @goldragoon, sorry but there is no progress on this :( But PRs are welcome :)

alemuntoni avatar Aug 06 '20 15:08 alemuntoni

Hi everybody, I've just added a gltf importer into meshlab! Right now, only *.gltf files are supported (some material info, animations, skeleton etc. are ignored since they are not supported natively into meshlab). I plan to add support also for importing *.glb files and exporting gltf/glb in the future, therefore we can say that this feature request is done at 25% :). I still don't know when though. You can try the importer by downloading the last nightly build, and of course it will be included in the next meshlab version. Looking forward for your feedbacks!

alemuntoni avatar Jul 01 '21 12:07 alemuntoni

Another small update: now also *.glb files are supported (it was easier than I thought), therefore we can say that we are at 50%. :) Hope to add the exporter in the near future!

alemuntoni avatar Jul 02 '21 15:07 alemuntoni

@alemuntoni thanks for the work so far! Do you have any update on exporting glb or gltf? I would find it really helpful!

Tzanker avatar Aug 02 '21 22:08 Tzanker

@Tzanker nope, sorry. It will require some time to implement it. Hope to have it by October/November..

alemuntoni avatar Aug 03 '21 08:08 alemuntoni

@alemuntoni Regarding writing glTFs, I would like to give you some advices:

It's not my use case, but I am aware that many MeshLab users do use it with models with millions of polygons. Now, glTF does support very large meshes, but only under certain conditions.

  • GLB files have a practical limit of 2Gb in size.
  • glTF files have a practical limit of 2Gb on each binary blob, but a single glTF file can use multiple binary blobs.

So, for relatively (*) small meshes, I would use a generic glTF exporter... but for very large meshes, I would use a domain specific exporter, where, each individual mesh would have a separated binary blob for positions, normals and UV coords. That way, the maximum number of vertices for a single mesh could be increased to 2Gb / 12 = 178 million vertices.

vpenades avatar Aug 03 '21 10:08 vpenades

Thanks for letting me know this, @vpenades! I need to check if tinygltf allows to control these scenarios, since it is the library we use for parse gltf in the importer, but should be fine.

alemuntoni avatar Aug 03 '21 13:08 alemuntoni

This is very awesome, having the possibility to use pymeshlab and export glb would be really great!

vanous avatar Aug 18 '21 08:08 vanous

@vanous see #911

alemuntoni avatar Aug 18 '21 09:08 alemuntoni

Yes, yes, i corrected myself fast, after noticing it :) . I just tested pymeshlab and it works well, great job!

vanous avatar Aug 18 '21 09:08 vanous

Oh ok, sorry @vanous! I still receive questions asking for meshlabserver, therefore it's kind of automatic for me to link that issue :D

alemuntoni avatar Aug 18 '21 09:08 alemuntoni

thrilled to see glb and gltf in meshlab! seeing some issues, tho, and filed this.

elenzil avatar Aug 18 '21 17:08 elenzil

@alemuntoni I am trying to load some .gltf files downloaded from the sketchfab, e.g. https://sketchfab.com/3d-models/hydria-apothecary-vase-7d6938c0c0b54b06a0210a982a73023e however there is no texture loaded: image

Any idea what could be wrong?

ttsesm avatar Dec 20 '21 15:12 ttsesm

@Tzanker nope, sorry. It will require some time to implement it. Hope to have it by October/November..

Just curious if there has been any new updates for gLTF exporting, thanks!

mikeucfl avatar Jan 12 '22 18:01 mikeucfl

I am using pymeshlab. I am trying to export a glb to obj. I am getting this error. failed to save ouput file Image processed/texture_1 cannot be saved. Your MeshLab version has not plugin to save file format. What format is it trying to save? Can it be fixed?

mark2142 avatar Mar 08 '22 18:03 mark2142

I wanted to do the something similar as @mark2142

  • load a gltf/glb
  • simplify it
  • export as obj (because there is no gltf/glb exporter)

The problem seems to be embedded images in the gltf/glb file. If i use gltf/glb with external buffers/images the conversion works.

gunmiosb avatar Oct 04 '22 11:10 gunmiosb