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:
Brecht Van Lommel 2013-05-10 12:39:11 +00:00
parent 1c9a24b8ff
commit 5424c1fe55
2 changed files with 5 additions and 1 deletions

@ -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);