My GLTF model is not loaded
Hello :)
With the following code i try to load a GLTF file located on local disc:
ILoader loader = null; GLTFSceneImporter sceneImporter = null;
try {
modelPath = modelPath.TrimStart(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar });
string directoryPath = URIHelper.GetDirectoryName(modelPath);
loader = new FileLoader(directoryPath);
sceneImporter = new GLTFSceneImporter(
Path.GetFileName(modelPath),
loader
);
sceneImporter.SceneParent = gameObject.transform;
yield return sceneImporter.LoadScene(-1, Multithreaded);
Debug.Log("loaded");
}
finally {
if (loader != null) {
sceneImporter.Dispose();
sceneImporter = null;
loader = null;
}
}
But no error occurs and the Debug.Log("loaded") is never be shown.
Ah it gets loaded after some minutes. Is it normal that it takes so long when loading a GLTF model with millions of vertices?
Hi Jennifer - yes, this is currently expected for large glTF models. This should get better with perf improvements to the project, but feel free to submit a PR or open a new issue if you have a proposal for how to better handle your particular scenario.