-
Notifications
You must be signed in to change notification settings - Fork 439
Fix collada textures not being loaded #7407
Fix collada textures not being loaded #7407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, though I do want to make sure: there's no problem with these models only being cleaned up on panel unmount? They shouldn't grow over time otherwise?
No I don't think that there is an issue, especially since models are cached, so temporary object URLs are created only once for every model URL |
@@ -220,25 +219,21 @@ export class ModelCache { | |||
const objectUrl = URL.createObjectURL( | |||
new Blob([textureAsset.data], { type: textureAsset.mediaType }), | |||
); | |||
textureUrls.set(textureUrl, objectUrl); | |||
this.#colladaTextureObjectUrls.set(textureUrl, objectUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if one already exists before creating a new one here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good remark, I'll create a follow-up PR for this
**User-Facing Changes** None **Description** Follow up of #7407 (comment)
User-Facing Changes
Fix collada textures not being loaded
Description
We were revoking temporary object URLs to early, resulting in errors when loading these URLs. This PR ties the lifetime of these temporary object URLs to the lifetime of the ModelCache.