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

Fix/apply-texture-prop #3431

Closed
wants to merge 2 commits into from
Closed

Conversation

roelkok
Copy link

@roelkok roelkok commented Jan 18, 2025

Currenty if a texture prop changes, the new texture gets copied into the previous one. This is incorrect, since the original texture might also be used elsewhere or be used later on.

The proposed fix is to check whether the target has an UUID. If that's the case, we assume it's an object we don't copy new values into with a prop change.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c8ecb44:

Sandbox Source
example Configuration

@drcmda
Copy link
Member

drcmda commented Jan 18, 2025

we're discussing atm. i think uuid check is a little sketchy, we don't know which and how many classes this would affect. it could create quite unreliable behaviour.

there might be a solution in sight. my current instinct is to check if the prop used to be null originally which indicates a non-read-only non-default prop, which should later be assigned, not copied.

for the moment please either key={...} your material or useMemo-clone the texture, this should solve it temporarily. v9 will then have a fix.

@drcmda
Copy link
Member

drcmda commented Jan 19, 2025

fix c89e20a

@roelkok roelkok closed this Jan 22, 2025
@roelkok roelkok deleted the fix/apply-texture-prop branch January 22, 2025 09:09
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

Successfully merging this pull request may close these issues.

2 participants