The
vsg::External class provides a mechanism for loading scene graph from files and then object sharing support within the VSG loader can map these to the appropriate parts of the scene graph. This mechanism works for all types of objects, so you could load models, textures using it.
Unfortunately, there are not currently any examples that illustrate how it's used. I wrote it very early in the project's life as a proof of concept alternative to implementing external file support for textures such as what the OSG has. The neat thing about it is that it's completely general purpose, all vsg::Object types supported, from all loaders, without any local support for external file support to local classes - they are essentially oblivious to how they are loaded/saved.
The concept behind it is that a root node of the scene graph would have a vsg::External attached to it as user data and then all the parts of the scene graph you want to be stored in an external file you add that object to the vsg::External object associating it with a filename. i.e.
auto group = vsg::Group::create();
auto child = vsg::read_cast<vsg::Node>("models/teapot.vsgt");
group->addChild(goup);
vsg:write(group, "group.vsgt"); // standard no external reference, everything inlined
auto external = vsg::External::create();
external->add(""models/teapot.vsgt", child);
group->setObject("external", external);
vsg::write(group, "group_using_external.vsgt");
If you wanted to be creative you could probably have a .vsgt file that uses vsg::External to load components of a gltf - the bin, png etc as externals so have a minimal .gltf replacement. It'd be daft but technically should be possible :-)
On a more practical note, while none of the existing loaders support it, it should be possible to have them assign vsg::External and all the texture files associated with a subgraph to it. Again this isn't on my TODO list for 1.0, if I keep adding stuff I'll never get 1.0 out the door...
Cheers,
Robert.