GLB or GLTF shapediver exporter from Rhino

Hello guys,
I have a question regarding the gltf exporter. Our backend can only handle glb, and your “save type” actually says (*.glb). I am not a file format expert but is there a way we can save in glb?.
If I understood correctly in this link and this link, the file needs to be a gltf, but we used glb in the past. Is that not possible anymore?

Many thanks for your question. Let me explain:

All the files exported by the ShapeDiver glTF exporter plugin are binary glTFs. You can choose between binary glTF 1.0 and binary glTF 2.0.
In case you choose binary glTF version 2.0 (the standard version used in the exporter, and the version we recommend to use for external geometry), then the exporter changes the file ending to .gltf instead of .glb . Don’t worry about this and don’t touch the file ending. It needs to be like this to make the files work with the external geometry component of our GH plugin, because our backend makes a distinction between glTF version 1.0 and 2.0 based on the file ending. The reason for this is that the glb loader contained in the current version of the viewer can’t differentiate by itself between versions 1.0 and 2.0. For this reason the API of the viewer defines different values for the SceneAssetItemFormat for glTF 1.0 and 2.0 (see SceneAssetItemFormat)
This is going to change in the not so far future (from viewer release 2.19.0), when the file ending is not going to matter anymore. Once the glb loader in the viewer can make the distinction between 1.0 and 2.0 itself, we will also change the exporter not to tamper with the file ending anymore.

1 Like

thank you!

We are still having a problem because we are trying to export the glTF through the Rhino exporter but we don’t see the whole mesh in the Shapediver viewer. I made screenshots of the different steps. Maybe you can tell me what is wrong:
This is how the mesh looks like in Rhino. I checked the normals and they are all fine


They were originally separate meshes but I joined together to see if that was the reason why we were not getting all the parts

I save it on the Shapediver glTF file format
3
and this are the options I picked:

The problem is that we get this on your viewer:


Just on part of the mesh.

When I tested a version of the rhino file in which the meshes were not joined but apart, the resulting file in the viewer only showed one of the meshes, which is why I thought that maybe by having one mesh I could solve the issue:

Why is this happening?

Please post the 3dm and the exported glTF, such that we can review what might be the problem.

If someone else is looking at this thread, I unfortunately cannot share the original data, but the Shapediver team, notice that there was a bug and they are working on it

There turned out to be a bug in the glTF 2.0 loader which caused some mesh primitives to be ignored. This has been fixed in viewer 2.17.0.

@snabela I just wanted to let you know that the V7 WIP that was just released today contains support in RhinoCommon for Google’s Draco compression.
Rhino.FileIO.DracoCompression
can be used to compress meshes with draco.

If you aren’t already using draco compression, you may want to check this out for glTF as it can considerably decrease file sizes based on the compression options you choose.

1 Like

@stevebaer this is great news, many thanks for letting us know, we will certainly give it a try and add support for it. I am curious to check out how fast the compression algorithm is.

There is also a DracoCompressionOptions class that you can fiddle with. This has settings that provide tradeoffs between compression size and speed

1 Like

@snabela - how would you recommend sending/uploading exported glTF files to a server using an HTTP request? I have been exporting a model in GH, writing to disk, then attempting to upload it to an S3 bucket for further processing and curious if you had any recommendations. I cannot seem to figure out the correct encoding to send along on a form-input or application/json - still pretty new to this file type and excited to learn more.