Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/texture/nodes/node_texture_math.c
| Context not available. | |||||
| tex_output(node, execdata, in, out[0], &valuefn, data); | tex_output(node, execdata, in, out[0], &valuefn, data); | ||||
| } | } | ||||
| static void node_tex_update_math(bNodeTree *UNUSED(ntree), bNode *node) | |||||
| { | |||||
| bNodeSocket *sock; | |||||
| int operation = node->custom1; | |||||
| // There are only two sockets, you want to always toggle the second one on/off | |||||
| sock = node->inputs.last; | |||||
| // All of the following are one socket operations | |||||
| if (operation == NODE_MATH_SIN || | |||||
| operation == NODE_MATH_COS || | |||||
| operation == NODE_MATH_TAN || | |||||
| operation == NODE_MATH_ASIN || | |||||
| operation == NODE_MATH_ACOS || | |||||
| operation == NODE_MATH_ATAN || | |||||
| operation == NODE_MATH_ROUND || | |||||
| operation == NODE_MATH_ABS | |||||
| ) | |||||
| sock->flag |= SOCK_UNAVAIL; | |||||
| else | |||||
| sock->flag &= ~SOCK_UNAVAIL; | |||||
| } | |||||
| void register_node_type_tex_math(void) | void register_node_type_tex_math(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| Context not available. | |||||
| node_type_label(&ntype, node_math_label); | node_type_label(&ntype, node_math_label); | ||||
| node_type_storage(&ntype, "", NULL, NULL); | node_type_storage(&ntype, "", NULL, NULL); | ||||
| node_type_exec(&ntype, NULL, NULL, exec); | node_type_exec(&ntype, NULL, NULL, exec); | ||||
| node_type_update(&ntype, node_tex_update_math, NULL); | |||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||
| Context not available. | |||||