trigger.library.arithmetic

Module to ease the arithmetic operations

Attributes

LOG

Functions

abs(a[, return_plug, name])

Return absolute value of a.

add([a, b, value_list, return_plug, name])

Create plusMinusAverage Node, add the values or plugs and

average_matrix(matrices_list[, return_plug, name])

Average a list of matrices.

clamp(a[, minimum, maximum, return_plug, name])

Clamp a value or plug between min and max.

decompose_matrix(matrix[, return_plug, name])

Decompose a matrix into its components.

divide(a, b[, return_plug, name])

Create multiplyDivide Node, multiply the values and

if_else(first_term, operation, second_term, if_true, ...)

Create a condition node with given information

invert(a[, return_plug, name])

Invert a value or plug.

multiply(a, b[, return_plug, name])

Create multiplyDivide Node, multiply the values and

multiply_matrix(matrices_list[, return_plug, name])

Multiply a list of matrices.

power(a, b[, return_plug, name])

Get power of a and b.

reverse(a[, return_plug, name])

Reverse a value or plug.

subtract([a, b, value_list, return_plug, name])

Create plusMinusAverage Node, subtract the values and

switch(a, b, switch_value[, return_plug, name])

Switch between a and b based on switch value.

Module Contents

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

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

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

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

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

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

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

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

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

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

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

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

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

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

LOG