Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Jolly <charlie>2020-02-11 18:31:40 +0300
committerCharlie Jolly <mistajolly@gmail.com>2020-02-11 19:09:25 +0300
commit7b0aca2a530fb1a42367eebf595a1c6ca93dba7d (patch)
treef439158ad17e09591daba9ae10c6a3a9f83ed531 /source/blender/nodes/texture
parent64e65442a1857033a9f139893eaff56b53cbd667 (diff)
Nodes: Add dynamic label support for Math Nodes
Reviewed By: brecht Differential Revision: https://developer.blender.org/D6375
Diffstat (limited to 'source/blender/nodes/texture')
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_math.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c
index 310300df204..8abe638216c 100644
--- a/source/blender/nodes/texture/nodes/node_texture_math.c
+++ b/source/blender/nodes/texture/nodes/node_texture_math.c
@@ -336,43 +336,6 @@ static void exec(void *data,
tex_output(node, execdata, in, out[0], &valuefn, data);
}
-static void node_shader_update_math(bNodeTree *UNUSED(ntree), bNode *node)
-{
- bNodeSocket *sock = BLI_findlink(&node->inputs, 1);
- nodeSetSocketAvailability(sock,
- !ELEM(node->custom1,
- NODE_MATH_SQRT,
- NODE_MATH_SIGN,
- NODE_MATH_CEIL,
- NODE_MATH_SINE,
- NODE_MATH_ROUND,
- NODE_MATH_FLOOR,
- NODE_MATH_COSINE,
- NODE_MATH_ARCSINE,
- NODE_MATH_TANGENT,
- NODE_MATH_ABSOLUTE,
- NODE_MATH_RADIANS,
- NODE_MATH_DEGREES,
- NODE_MATH_FRACTION,
- NODE_MATH_ARCCOSINE,
- NODE_MATH_ARCTANGENT) &&
- !ELEM(node->custom1,
- NODE_MATH_INV_SQRT,
- NODE_MATH_TRUNC,
- NODE_MATH_EXPONENT,
- NODE_MATH_COSH,
- NODE_MATH_SINH,
- NODE_MATH_TANH));
- bNodeSocket *sock2 = BLI_findlink(&node->inputs, 2);
- nodeSetSocketAvailability(sock2,
- ELEM(node->custom1,
- NODE_MATH_COMPARE,
- NODE_MATH_MULTIPLY_ADD,
- NODE_MATH_WRAP,
- NODE_MATH_SMOOTH_MIN,
- NODE_MATH_SMOOTH_MAX));
-}
-
void register_node_type_tex_math(void)
{
static bNodeType ntype;
@@ -382,7 +345,7 @@ void register_node_type_tex_math(void)
node_type_label(&ntype, node_math_label);
node_type_storage(&ntype, "", NULL, NULL);
node_type_exec(&ntype, NULL, NULL, exec);
- node_type_update(&ntype, node_shader_update_math);
+ node_type_update(&ntype, node_math_update);
nodeRegisterType(&ntype);
}