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 color attribute initialization of InstancedMesh #22171

Merged
merged 3 commits into from
Jul 22, 2021

Conversation

FoolHen
Copy link
Contributor

@FoolHen FoolHen commented Jul 22, 2021

Fixes #22170

Description

Color attribute of InstancedMesh is not initialized on the constructor but when first calling setColorAt(), and it creates the BufferAtribute with the current count value, which can be lower than the initial one. This leads to issues if the count is increased after.

This PR saves the maximum count to later correctly initialize the color BufferAtribute.

@mrdoob mrdoob added this to the r131 milestone Jul 22, 2021
@mrdoob mrdoob merged commit ea3762d into mrdoob:dev Jul 22, 2021
@mrdoob
Copy link
Owner

mrdoob commented Jul 22, 2021

Thanks!

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.

InstancedMesh color attribute initialization is done with current count value instead of the maximum count.
3 participants