forked from bartvdbraak/blender
Fix #35278: textures nodes Mix RGB node did not have a Use Alpha option like
the compositing node. Note the shader nodes can't have this because color sockets there are only RGB, not RGBA.
This commit is contained in:
parent
1c9a24b8ff
commit
5424c1fe55
@ -177,7 +177,7 @@ static void node_buts_mix_rgb(uiLayout *layout, bContext *UNUSED(C), PointerRNA
|
|||||||
col = uiLayoutColumn(layout, FALSE);
|
col = uiLayoutColumn(layout, FALSE);
|
||||||
row = uiLayoutRow(col, TRUE);
|
row = uiLayoutRow(col, TRUE);
|
||||||
uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
|
uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE);
|
||||||
if (ntree->type == NTREE_COMPOSIT)
|
if (ELEM(ntree->type, NTREE_COMPOSIT, NTREE_TEXTURE))
|
||||||
uiItemR(row, ptr, "use_alpha", 0, "", ICON_IMAGE_RGB_ALPHA);
|
uiItemR(row, ptr, "use_alpha", 0, "", ICON_IMAGE_RGB_ALPHA);
|
||||||
|
|
||||||
uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE);
|
uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE);
|
||||||
|
@ -53,6 +53,10 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor
|
|||||||
tex_input_rgba(col1, in[1], p, thread);
|
tex_input_rgba(col1, in[1], p, thread);
|
||||||
tex_input_rgba(col2, in[2], p, thread);
|
tex_input_rgba(col2, in[2], p, thread);
|
||||||
|
|
||||||
|
/* use alpha */
|
||||||
|
if (node->custom2 & 1)
|
||||||
|
fac *= col2[3];
|
||||||
|
|
||||||
CLAMP(fac, 0.0f, 1.0f);
|
CLAMP(fac, 0.0f, 1.0f);
|
||||||
|
|
||||||
copy_v4_v4(out, col1);
|
copy_v4_v4(out, col1);
|
||||||
|
Loading…
Reference in New Issue
Block a user