-
Notifications
You must be signed in to change notification settings - Fork 325
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
Clarify texture filesystem lookup #9
Comments
@zellski are you currently working on this? I'd be interested in contributing to this as it would allow us to export valid .gltf files with external images. The AFrame community is in need of a better way of exporting from Maya and this project is fairly close. |
@robertlong I'm planning on doing some cleanup here for sure, sooner rather than later. Can you clarify what exactly you want to do? By external images do you mean, "not literally embedded in the FBX" or do you mean URIs, for something like WebGL deployment? We have no way of mapping filenames to URIs right now, although that'd be interesting. You could imagine something like FBX2glTF --resource-prefix https://foo.com/assets/textures/ If it's just a bunch of texture files and they're referenced in the FBX, chances are it already works. The current strategy is to take the basename of each texture's filename, and then look for a file with that same basename in the directory where the FBX file is. Thus if the FBX references C:\Work\Birds\Sparrow_diffuse.png, you're doing the conversion on a Mac, and you put a Sparrow_diffuse.png next to the FBX, which can exist anywhere in the filesystem, that should already work right. (In fact, it should match even if you change the suffix to a .jpg). We handle textures very poorly in non-binary mode at the moment. That's part of what I want to fix. |
The non-binary support would be nice. Currently it just outputs a uri with |
Oh, yes -- that .ktx line is a bizarre holdover from a very early version. I think we agree that leaning on relative paths by simply outputting the basename of the texture's FBX-internal filename should do what you're looking for. We could possibly copy the texture files too. I'll take a pass at the cleanup in the next day or two, then we can see where we're at; if there is further work you'd like to see at that point, contributions are more than welcome! |
That would be great, thanks! |
@robertlong Take a look at #16 and see what you think. |
name
(logical texture name),fbxFilename
(the original filename, usually an absolute path on the model author's machine), andlocalFilename
, a path that's guaranteed to exist on the local file system.The text was updated successfully, but these errors were encountered: