franMarz / TexTools-Blender

TexTools is a UV and Texture toolset created several years ago for Blender and Max by @renderhjs. In this open repository, originally created by @SavMartin, we develop the current version of this popular Blender add-on.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object turns to red after color id map bake

yavuzselimyayla opened this issue · comments

Before & After Bake (ID map is correct but object turns to red)
(Element ID bake, Mode: Vertex Colors)
e41cce194ce8cd06603074767e9309e9cbf3b719

If i click again without changing anything (a second bake) color map changes to red too.
If there are multiple objects secondary object turns to blue. I think the pattern follows the default color values. You can see that i changed the first color to white before bake

This is happening both Blender 3.5 & 3.6

https://blenderartists.org/t/textools-for-blender/700811/965

Element ID bake mode is not designed to make what you're trying to do; its scope is to bake a mask with different colors for every isolated mesh (mesh Element) inside your object, not to bake the Vertex Colors you assing to your mesh, that would be other method that we don't have. Material ID seems to work fine with that in my tests, as long as no materials are assigned to your object... A new mode for baking just Vertex Colors is indeed needed, it seems.
In any case, you helped me discover a glitch here: Element ID uses a custom, temporary Vertex Colors Layer to assign colors to bake from, and it's using the TexTools_colorID, something it shouldn't. That for sure needs a fix.

This worked correctly in 3.3, the issue is caused by recent changes in the Blender side regarding Attributes management. Need to find the version of the change to apply a different approach to create the Vertex Color Layer and make it active before modifying it. After fixing this, we'll need to look for other modules where Vertex Colors are used (like Color ID) because they might be behaving badly as well.