atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.24k stars 250 forks source link

Export - Export in a single glb file #562

Open Pourfex opened 1 year ago

Pourfex commented 1 year ago

Is your feature request related to a problem? Please describe. The runtime export of GLTFast provides a .bin and a .glb If I want to load the result later in the app or in other apps, I would need to merge them in a single .zip file or a .glb file (as many don't succeed to load the .bin - actually only mccurdy gltf viewer succeed to do it).

Describe the solution you'd like The export should result in a single .glb file without the .bin file. Or there should be an option to do so.

Describe alternatives you've considered Merge the .bin and .glb, make a zip file and load it.

atteneder commented 1 year ago

Hi @Pourfex ,

Depending on the ExportSettings.Format (which can be Json or Binary) it should always be either a single .glb file (containing everything) or multiple files (.gltf, .bin and separate textures).

I'd consider .glb plus a .bin files an issue indeed (are you sure you did not mean .gltf plus .bin?)

atteneder commented 1 year ago

@Pourfex Have your followed the runtime export documentation?

What does your export code look like?

Pourfex commented 1 year ago

@atteneder Yeah I just followed the exemple as is. ` var exportSettings = new ExportSettings { Format = GltfFormat.Binary, FileConflictResolution = FileConflictResolution.Overwrite, };

    var export = new GameObjectExport( exportSettings);

    export.AddScene(rootLevelNodes, "My new glTF scene");

    // path is something like streaming assets / test.glb   
    var success = await export.SaveToFileAndDispose(path);

`

I was expecting a single glb file instead of glb + bin file.

atteneder commented 3 weeks ago

I cannot reproduce. Could you provide a full scene that reproduces the problem?