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

Vertex color breaks if number of colors mismatches number of polygon vertices #25120

Open
insomniacUNDERSCORElemon opened this issue Jan 19, 2019 · 4 comments

Comments

@insomniacUNDERSCORElemon

As of 3.1 beta 2. Likely related to #20601. Having a different number causes the vertex color to not work at all. This can be tested in 2 ways: either changing the vertex colors array size or by adding/deleting vertices (in either case, vertex colors will pop off or on depending on if the number matches).

Behavior in beta 1 and before is that undefined vertex colors were inherited from the color property.

Now it seems this is likely an intentional change, at least because adding internal vertices causes the vertex colors array size to automatically update (the new color defaulting to white rather than the color property)... but aside from breakage, it also makes working with polygons+vertex colors even more clunky (and it's bad enough coloring vertices by number rather than having an editor).

In many cases, this isn't just a matter of changing the array size to match the number of vertices either, as the inheritance of the color property (as I mentioned before) is now gone. So not only would you need to paste it in for every unspecified vertex, you'd also better hope that you don't plan on changing it (or the number of vertices in the polygon!) for any reason (that would be mitigated if there were some sort of a palette system, particularly if you could specify colors in groups. Like vertices 22-46 are this color and vertices 1, 2, 5, 7 are this color etc.).

That and I think it's fairly obvious the old method was a more helpful/intuitive behavior.

@reduz
Copy link
Member

reduz commented Jan 22, 2019

I think vertex colors should probably be implemented properly, including the ability to paint them in the UV editor.. but did not have much time for this. I want to eventually rewrite the internals of Polygon2D so it does not expose arrays any longer and everything is done via the editor (Which should be moved to the bottom).

Unfortunately these changes both break compatibility and it's too late on the 3.1 cycle to do them. I have noted those and many other changes to be done for 4.0 to improve Polygon2D.

@akien-mga akien-mga modified the milestones: 3.1, 4.0 Jan 24, 2019
@insomniacUNDERSCORElemon
Copy link
Author

Sorry about the late response... but the vertex color editor thing was only a mention with this issue, as in can't the array mis-match behavior be restored to how it was in previous versions? Or was there a reason (perhaps internal, related to internal vertices) for changing that?

@KoBeWi
Copy link
Member

KoBeWi commented Jul 5, 2020

Still valid in 0287508

@reduz
Copy link
Member

reduz commented Jan 13, 2023

The whole Polgon2D class is in need of a refactor, but I guess it was not enough priority for 4.0, hoping next versions improve this.

@YuriSizov YuriSizov removed this from the 4.1 milestone Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants