trigger.library.arithmetic ========================== .. py:module:: trigger.library.arithmetic .. autoapi-nested-parse:: Module to ease the arithmetic operations Attributes ---------- .. autoapisummary:: trigger.library.arithmetic.LOG Functions --------- .. autoapisummary:: trigger.library.arithmetic.abs trigger.library.arithmetic.add trigger.library.arithmetic.average_matrix trigger.library.arithmetic.clamp trigger.library.arithmetic.decompose_matrix trigger.library.arithmetic.divide trigger.library.arithmetic.if_else trigger.library.arithmetic.invert trigger.library.arithmetic.multiply trigger.library.arithmetic.multiply_matrix trigger.library.arithmetic.power trigger.library.arithmetic.reverse trigger.library.arithmetic.subtract trigger.library.arithmetic.switch Module Contents --------------- .. py:function:: abs(a, return_plug=True, name='absolute') Return absolute value of a. Args: a (String): Value or plug to get absolute value from return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: add(a=None, b=None, value_list=None, return_plug=True, name='add') Create plusMinusAverage Node, add the values or plugs and return the output node or plug. Accepts nodes or values, you can also use a list of nodes or plugs. Args: a (String): First value or plug to add b (String): Second value or plug to add value_list (List): List of values or plugs to add return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: average_matrix(matrices_list, return_plug=True, name='averageMatrix') Average a list of matrices. Args: matrices_list (List): List of matrices to average return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: clamp(a, minimum=0, maximum=1, return_plug=True, name='clamp') Clamp a value or plug between min and max. Args: a (String): Value or plug to clamp minimum (Float): Minimum value (optional). Defaults to 0. maximum (Float): Maximum value (optional). Defaults to 1. return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: decompose_matrix(matrix, return_plug=True, name='decomposeMatrix') Decompose a matrix into its components. Args: matrix (String): Matrix to decompose return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: divide(a, b, return_plug=True, name='divide') Create multiplyDivide Node, multiply the values and return the output node or plug. Args: a (String): First value or plug to divide b (String): Second value or plug to divide return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: if_else(first_term, operation, second_term, if_true, if_false, return_plug=True, name='condition') Create a condition node with given information Args: first_term (String): First term of the condition. Value or Plug operation (String): Operation to perform. Valid values are: ">", "<", ">=", "<=", "==", "!=" second_term (String): Second term of the condition. Value or Plug if_true (String): Value or plug to return if condition is true if_false (String): Value or plug to return if condition is false return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: invert(a, return_plug=True, name='invert') Invert a value or plug. Args: a (String): Value or plug to invert return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: multiply(a, b, return_plug=True, name='multiply') Create multiplyDivide Node, multiply the values and return the output node or plug. Args: a (String): First value or plug to multiply b (String): Second value or plug to multiply return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: multiply_matrix(matrices_list, return_plug=True, name='multMatrix') Multiply a list of matrices. Args: matrices_list (List): List of matrices to multiply return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: power(a, b, return_plug=True, name='power') Get power of a and b. Accepts nodes or values. Args: a (String): First value or plug to power b (String): Second value or plug to power return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: reverse(a, return_plug=True, name='reverse') Reverse a value or plug. Args: a (String): Value or plug to reverse return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: subtract(a=None, b=None, value_list=None, return_plug=True, name='subtract') Create plusMinusAverage Node, subtract the values and return the output node or plug. Accepts nodes or values, you can also use a list of nodes or plugs. Args: a (String): First value or plug to subtract b (String): Second value or plug to subtract value_list (List): List of values or plugs to subtract return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:function:: switch(a, b, switch_value, return_plug=True, name='switch') Switch between a and b based on switch value. Args: a (String): First value or plug to switch b (String): Second value or plug to switch switch_value (String): Switch value or plug return_plug (Bool): Return the output plug or the node (optional) name (String): Name of the node (optional) Returns: String: Output plug or node .. py:data:: LOG