Fix #115214: Incorrect vertex paint with image texture
The issue is caused by 087612c042 which changed type of
vpd->paintcol from byte to float. Some of the code was
expecting it to be byte, and did C-style cast to a pointer
of uchar.
This is a minimalistic fix, which makes it so the
paint_and_tex_color_alpha() operates on proper types and
avoids reading from the result color before overriding the
value.
Pull Request: https://projects.blender.org/blender/blender/pulls/117030
This commit is contained in:
committed by
Sergey Sharybin
parent
9a7ea993d0
commit
fd3669c3db
@@ -1623,11 +1623,9 @@ static float paint_and_tex_color_alpha(VPaint *vp,
|
||||
Color *r_color)
|
||||
{
|
||||
ColorPaint4f rgba;
|
||||
ColorPaint4f rgba_br = toFloat(*r_color);
|
||||
|
||||
paint_and_tex_color_alpha_intern(vp, &vpd->vc, v_co, &rgba.r);
|
||||
|
||||
rgb_uchar_to_float(&rgba_br.r, (const uchar *)&vpd->paintcol);
|
||||
ColorPaint4f rgba_br = toFloat(vpd->paintcol);
|
||||
mul_v3_v3(rgba_br, rgba);
|
||||
|
||||
*r_color = fromFloat<Color>(rgba_br);
|
||||
|
||||
Reference in New Issue
Block a user