Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading texture from disk #79

Closed
jonasolof opened this issue Jun 7, 2020 · 1 comment
Closed

Error loading texture from disk #79

jonasolof opened this issue Jun 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@jonasolof
Copy link

jonasolof commented Jun 7, 2020

When trying to load any .gltf file from a local path I run into the error when loading textures.

Code I'm running:
GameObject model = Importer.LoadFromFile(aPathInMyAssetFolderOrElsewhereOnMyDisk);

Console says:
Invalid AssetDatabase path: /Users/me/Library/Application Support/DefaultCompany/ProjectName/Files/GLTF_Models/Model/texture.jpg. Use path relative to the project folder.

It doesn't matter if the gltf is within our outside the project folder.

As well as:
GLTFImage.cs ToTexture2D() ERROR: Cannot connect to destination host UnityEngine.Debug:LogError(Object) Siccity.GLTFUtility.<CreateTextureAsync>d__3:MoveNext() (at Assets/Plugins/GLTFUtility-master/Scripts/Spec/GLTFImage.cs:65) Siccity.GLTFUtility.<GetTextureCached>d__3:MoveNext() (at Assets/Plugins/GLTFUtility-master/Scripts/Spec/GLTFTexture.cs:29) Siccity.GLTFUtility.<CreateMaterial>d__5:MoveNext() (at Assets/Plugins/GLTFUtility-master/Scripts/Spec/GLTFMaterial.cs:166) Siccity.GLTFUtility.<CreateMaterial>d__14:MoveNext() (at Assets/Plugins/GLTFUtility-master/Scripts/Spec/GLTFMaterial.cs:42) Siccity.GLTFUtility.<OnCoroutine>d__4:MoveNext() (at Assets/Plugins/GLTFUtility-master/Scripts/Spec/GLTFMaterial.cs:318) Siccity.GLTFUtility.ImportTask1:RunSynchronously() (at Assets/Plugins/GLTFUtility-master/Scripts/Importer.cs:161) Siccity.GLTFUtility.Importer:LoadInternal(GLTFObject, String, Byte[], Int64, ImportSettings, AnimationClip[]&) (at Assets/Plugins/GLTFUtility-master/Scripts/Importer.cs:205) Siccity.GLTFUtility.Importer:ImportGLTF(String, ImportSettings, AnimationClip[]&) (at Assets/Plugins/GLTFUtility-master/Scripts/Importer.cs:141) Siccity.GLTFUtility.Importer:LoadFromFile(String, ImportSettings, AnimationClip[]&, Format) (at Assets/Plugins/GLTFUtility-master/Scripts/Importer.cs:32) Siccity.GLTFUtility.Importer:LoadFromFile(String, Format) (at Assets/Plugins/GLTFUtility-master/Scripts/Importer.cs:16) FirebaseGLTFLoader:LoadModel(String) (at Assets/FirebaseGLTFLoader.cs:77) FirebaseGLTFLoader:DebugMethod() (at Assets/FirebaseGLTFLoader.cs:26)

I realise that this might be down to user error but if so I'd be happy to be corrected on how to use this tool correctly!

I can't understand how to run Importer.LoadFromFile with a local path that perhaps would make UnityEditor.AssetDatabase.LoadAssetAtPath() happy...

@Siccity Siccity added the bug Something isn't working label Jun 15, 2020
@Siccity
Copy link
Owner

Siccity commented Sep 10, 2020

Both the texture and gltf file has to be inside the assets folder. GLTFUtility uses this automatically when importing glft files into the unity editor. This feature does not work in runtime.

@Siccity Siccity closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants