vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
454 stars 72 forks source link

Loading Back Empty Node From File in Scene Builder #164

Closed GlitcherOG closed 1 year ago

GlitcherOG commented 1 year ago

Might just be doing this wrong again but I added two empty nodes and after saving the file and reopening in scene builder it appears it didn't load the nodes but did load all the mesh data i saved. I did confirm that in blender the nodes do appear so they were saved in the file.

vpenades commented 1 year ago

As per glTF standard, empty nodes are considered a waste of resources and the standard recomends optimizing them out. The glTF validator issues warnings on empty nodes.

What the standard does not precisely specify is what is an empty node. In my library an empty node is a node that does not have any child, no mesh, no skin, no extension, no extras and NO NAME.

You can exploit this to prevent the nodes to be optimized out, simply give names to these nodes.

GlitcherOG commented 1 year ago

But I am giving it a name when building the node. image

vpenades commented 1 year ago

Hmm.. so it's a case of reimporting.... I'll look into it