paya.runtime.plugs.Angle#

class Angle(*args, **kwargs)#

Inheritance

Unit Math1D Math Attribute Attribute PyNode ProxyUnicode

classmethod create(node, attrName, **kwargs)#

Creates a doubleAngle attribute.

Parameters
Returns

The generated attribute.

Return type

Angle

get(plug=False, default=None, **kwargs)#

Overloads paya.runtime.plugs.Attribute.get() to return an Angle instance instead of a float. The instance will have embedded unit information (access via .unit).

set(*args, **kwargs)#

Overloads set() for improved unit management. If the argument is a float, then it will be set directly. If the argument is an Angle instance with units that are different from the UI, it will be converted accordingly.

To set values with a float in degrees regardless of UI setting, use degToUI(), available on paya.runtime.

unwind360()#
Returns

This angle, rolled so that it always remains in the -360 ->

360 range. :rtype: Angle

unwindShortest()#
Returns

This angle, unwound and, if over 180, converted to negative form.

Return type

Angle

unwindPositive()#
Returns

The unwound positive form of the angle.

Return type

Angle

unwindNegative()#
Returns

The unwound negative form of the angle.

Return type

Angle

unwindSwitch(switchAttr, shortestIndex=0, positiveIndex=1, negativeIndex=2)#

Unwinds this angle, with the ‘shortest’ / ‘positive’ / ‘negative’ modes chosen from a user attribute (typically an enum). Useful for twist setups.

This method is more efficient than switching between the outputs of unwindShortest(), unwindPositive() and unwindNegative().

Parameters
  • switchAttr (str, Math1D) – the switch attribute; should be of type enum or long

  • shortestIndex (int) – the attribute index for ‘shortest’; defaults to 0

  • positiveIndex (int) – the attribute index for ‘positive’; defaults to 1

  • negativeIndex (int) – the attribute index for ‘negative’; defaults to 2

Returns

The unwound angle.

Return type

Angle