nod.op

Nod operators

Operators are functions that create a part of the node operations network. This is an extension of the default operators attached to NodChannel objects i.e. + - * / **

Example of an operator in a statement:

op.reversed(nodeA.v) >> nodeB.v

Note

Refer to the docs and examples for more information.

Module contents

nod.op.abs(channel)

Creates an abs. Currently this has to be done via two power node power1/2(power2)

Parameters

channel (nod.channels.base.NodChannel) – Input Channel

Returns

nod.channels.base.NodChannel

nod.op.average()

Not Implemented.

nod.op.blend(channel, other, driver=None, name=None)

Blend given channels via blendTwoAttr node

Parameters
Returns

nod.channels.base.NodChannel

nod.op.clamp(channel, min=None, max=None, name=None)

Clamp given channel value via clamp node

Parameters
Returns

nod.channels.base.NodChannel

nod.op.condition(firstTerm, operator, secondTerm, ifTrue=None, ifFalse=None, name=None)

Condition operation where inputs and outputs can be either constant values or other channels

Parameters
  • firstTerm (nod.channels.base.NodChannel) – A driving channel

  • operator (str) – Compare operator: ‘==’, ‘!=’, ‘>’, ‘>=’, ‘<’, ‘<=’ Alternatively operation name can be provided following maya description: ‘equal’, ‘not equal’, ‘greater than’, ‘greater or equal’, ‘less than’, ‘less or equal’

  • secondTerm (NodChannel, float) – A driving channel or value

  • ifTrue (NodChannel, float or tuple) – A resulting channel or value(s) if condition is True

  • ifFalse (NodChannel, float or tuple) – A resulting channel or value(s) if condition is False

  • name (str) – Utility node name. If not specified creates the name based on channel names

Returns

nod.channels.base.NodChannel

nod.op.distanceBetween(node1, node2)

Builds distanceBetween node and returns an output channel for further connections

Parameters
Returns

nod.channels.base.NodChannel

nod.op.remap(channel, inputRange=None, outputRange=None, positions=None, values=None, interpolations=None, name=None)

Remap given channel value via remapValue node

Parameters
  • channel (nod.channels.base.NodChannel) – Input Channel

  • inputRange (tuple) – Tuple of Min and Max input values (or NodChannel)

  • outputRange (tuple) – Tuple of Min and Max output values (or NodChannel)

  • positions (list) – List of positions for each value provided. Ignored if no values

  • values (list) – List of values for each position. Ignored if no positions

  • interpolations (list)) – List of interpolation modes for each position. If None, all use default Linear mode 0 - None 1 - Linear (default) 2 - Smooth 3 - Spline

  • name (str) – Utility node name. If not specified creates the name based on channel names

Returns

nod.channels.base.NodChannel

nod.op.reverse(channel, name=None)

Reverse given channel value via reverse node

Parameters
  • channel (nod.channels.base.NodChannel) – Input Channel

  • name (str) – Utility node name. If not specified creates the name based on channel names

Returns

nod.channels.base.NodChannel