FBXLoader: Use getHandler() for custom texture loaders.#31032
Conversation
|
I had a similar issue recently with KTX2Loader not passing 'path' or 'crossOrigin' options to its internal FileLoader, just haven't made a PR yet. I think probably we want to make sure that any options set on the parent loader are passed down to its internal loaders, rather than introducing a factory pattern? Perhaps don't change the PR yet, though – I'm curious if other maintainers agree. |
|
How about adding By default, an instance of |
|
@Mugen87 |
I agree with this. I would prefer not to introduce a new pattern - my expectation would always be that the settings (or intent of the settings) on the parent loader should be passed to any other child loaders. Without knowing more this sounds like a bug. Is there a reason you wouldn't want this behavior?
Where else is |
|
@gkjohnson Thank you.
Like this? |
That sounds even better! @tatsuya-ogawa Do you mind updating the PR with the suggested approach? If you are not familiar with the manager.addHandler( /\.tga$/i, new TGALoader() );This would mean all TGA textures are now loaded with an instance of However, |
getHandler() for custom texture loaders.
|
I'm checking e2e testcase |
…er-with-customtextureloader
|
I think allowing for
The problem raised in the original post doesn't sound like something that should require custom texture loader handlers to fix. |
Clean up.
|
@Mugen87 @gkjohnson @donmccurdy |
* add capable of custom texture loader * replace factory to setXXXLoader * Update FBXLoader.js * fix indent * use manager.getHandler * fix loader variable name * fix url * use getHandler for all extensions * Update FBXLoader.js Clean up. --------- Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
* add capable of custom texture loader * replace factory to setXXXLoader * Update FBXLoader.js * fix indent * use manager.getHandler * fix loader variable name * fix url * use getHandler for all extensions * Update FBXLoader.js Clean up. --------- Co-authored-by: Michael Herzog <michael.herzog@human-interactive.org>
#31031
Description
I’d like to submit a PR to three.js because the TextureLoader inside FbxLoader isn’t receiving any credentials—this causes errors when loading textures.
so add manager.addHandler to instantiate TextureLoader.