This is a very weird question, I'm aware :)
I have several meshes, each with its own material, each material with its own texture. This is for a game mod, so they're all simple diffuse textures. I used texture painting to mark the different parts of my texture on some objects. At some point, texture painting stopped working* on a particular object (let's call it object X).
*stopped working = I can paint the texture in the UV editor (Paint mode), but I can't paint the model in the 3D view.
After a bit of frustrated trial and error, I tried texture painting a different object, and... it turns out that on any other object the image of object X's texture appears as a "mask"! What I mean is that, if object Y has a green texture and I paint it with a large red "draw" brush, object Y's texture becomes red where object X's texture is not white, but remains untouched where X's texture is white.
I'm pretty new to texture painting, so I probably did something wrong without noticing. It looks like somehow X's texture has become a sort of "global" mask, but I can't find anything like that anywhere.
I also thought that it may be caused by X's texture having a non-completely-white alpha channel, but after filling it nothing changed. The mask effect seems to be based on the white pixels in that texture. Also, the issue was there also before I edited the image with GIMP, and back then it had no alpha channel.
How can I fix this issue?
Here is a minimal file that shows the bug:
There are two objects, one of which cannot be painted (but its texture can be edited with the "mask" tool), the other one can be painted but the texture of the first object is applied as a mask.
I also noticed that, if I paint on the second object with the "mask" tool, then the first object's texture is modified.