By default babylon-viewer refuses to open .babylon
file with the warning: Unable to find a plugin to load .babylon files. Trying to use .babylon default plugin.
while the https://sandbox.babylonjs.com/ opens the same file without any problem.
As I understand .babylon
file may contain the whole scene which is probably too much for light-weight babylon-viewer. Then is there a way to extract particular mesh from .babylon
file and show it in the viewer without loading the original full-weight babylon.js?
cc @ryantrem
The babylon-viewer does not currently support .babylon files. To support them, we need to do some work to make it possible for the .babylon loader to be dynamically imported, such that the babylon-viewer bundle does not always have the size impact of the .babylon loader. If you have a scene in the Sandbox, one option is to export to to glb from the Inspector and then load that glb into the babylon-viewer. If it’s important to you for other reasons to specifically be able to load .babylon files, will you please post a new message in Feature requests - Babylon.js?
I am making an app that has a file viewer, including 3D assets viewer. And I would love to be able to show .babylon
files content as well (at least meshes). So, some helper function that can extract meshes from .babylon
and pass it to the viewer would be awesome. Because if I have to load the original babylon.js for .babylon
processing, I can just create the scene and load the .babylon
file normally.
Are you installing the @babylonjs/viewer npm package and building your own bundle, or are you using the Babylon viewer via CDN (eg jsdelivr)?