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

SharpGLTF assumes hardwired folder structure #137

Closed
deccer opened this issue Apr 24, 2022 · 4 comments
Closed

SharpGLTF assumes hardwired folder structure #137

deccer opened this issue Apr 24, 2022 · 4 comments

Comments

@deccer
Copy link

deccer commented Apr 24, 2022

Excuse the amount of tickets but I am either too stupid to use this library, or just dont know how to use this library.

After I cant use relative paths (as stated in #136) I tried to provide the full path which is
P:\Private\Code\Games\SpaceConflict\src\SpaceConflict\bin\Debug\Models\BarberShopChair_01_1k.gltf

But now it seems SharpGLTF assumes a hardcoded folder structure to resolve all the things it needs to load (glb/textures/whatever)

Could not find a part of the path 'P:\Private\Code\Games\SpaceConflict\src\SpaceConflict\bin\Debug\Models\textures\BarberShopChair_01_nor_gl_1k.jpg'.

:(

A Getting Started or Wiki might shed some light on how to use that thing.

@vpenades
Copy link
Owner

I've recently updated the code to handle relative paths.

Did this change fix this and the other issue for you?

@deccer
Copy link
Author

deccer commented May 1, 2022

Hey, thanks for taking a look.

I have played a bit with your current master version. For meshes with embedded textures or no external ones it seems to be working so far.
But as soon as I am trying to load a mesh with external textures I am getting this exception again

Could not find a part of the path 'P:\Private\Code\Games\SpaceConflict\src\SpaceConflict\bin\Debug\Models\textures\head_diffuse.png'

Obviously I don't keep textures in Models\ Hmm unless one would keep each model asset as its own folder. Hmm I have to think about that kind of system :)

Anyway, I have attached the model file in question (minus texture files).

Models.zip

I don't know if it makes sense to provide a readerSetting/Option to not just try to load texture data right when loading the model itself, but just provide the fileName in the inner structures, so that I can take care of image/texture loading in my own time/engine.

@vpenades
Copy link
Owner

vpenades commented May 1, 2022

with the model you attached, I created a subdirectory called "textures" and added 4 textures matching the paths in the gltf, and the model loads just fine with the latest code.

So can you write a working demo so I can reproduce it?

@deccer
Copy link
Author

deccer commented Oct 6, 2022

I am sorry for the late reply.

Currently I am using 1.0.0-alpha0026 and it does work almost as intended.
I am able to load various models, and found a flaw on my side consuming your library.

I will therefor close this issue and make sure to provide a repro-repo next time.

I like to start sentences with I :)

I wanted to thank you for this library by the way, works better than Khronos' "official" one.

@deccer deccer closed this as completed Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants