How to load a gltf file from a zip?

Started by bingo2k, August 31, 2024, 08:17:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bingo2k

How to load a gltf file from a zip?
I do this:
local zipf = "E:/truck.zip"
local model_filename = "scene.gltf"
local model_directory = ""
model = gh_model.create_from_zip_file_loader_assimp(zipf, model_filename, model_directory, model_directory, "")
As a result I get the error: [Assimp] loading from memory failed: GLTF: could not open referenced file "scene.bin"
"scene.bin" is located in the same directory as "scene.gltf" in the zip file

JeGX

Currently the Assimp loader can't load glFT files from a zip. But you have a solution: yo can use the glft loader:

local zipf = "E:/truck.zip"
local model_filename = "scene.gltf"
local model_directory = ""
model = gh_model.create_from_zip_file_loader_gltf(zipf, model_filename, model_directory, model_directory, "")