anchorTransform.utils module

class anchorTransform.utils.UndoChunkContext

Bases: object

The undo context is used to combine a chain of commands into one undo. Can be used in combination with the “with” statement.

with UndoChunkContext():
# code
anchorTransform.utils.applyEulerFilter(transform)

Apply an euler filter to fix euler issues on curves connected to the transforms rotation attributes.

Parameters:transform (str) – Path to transform
anchorTransform.utils.decomposeMatrix(matrix, rotOrder, rotPivot)

Decompose a matrix into translation, rotation and scale values. A rotation order has to be provided to make sure the euler values are correct.

Parameters:
  • matrix (OpenMaya.MMatrix) –
  • rotOrder (int) – Rotation order
  • rotPivot (list) – Rotation pivot
Returns:

Translate, rotate and scale values

Return type:

list

anchorTransform.utils.displayConfirmDialog(invalidAttributes)

Display confirm dialog, presenting the user with the invalid attributes that were found.

Parameters:invalidAttributes (list) – List of invalid attributes
Returns:Continue state
Return type:bool
anchorTransform.utils.divider(parent)

Create divider ui widget.

Parameters:parent (QWidget) –
Return type:QFrame
anchorTransform.utils.getIconPath(name)

Get an icon path based on file name. All paths in the XBMLANGPATH variable processed to see if the provided icon can be found.

Parameters:name (str) –
Returns:Icon path
Return type:str/None
anchorTransform.utils.getInTangent(animCurve, time)

Query the in tangent type of the key frame closest but higher than the parsed time.

Parameters:
  • animCurve (str) – Animation curve to query
  • time (int) –
Returns:

In tangent type

Return type:

str

anchorTransform.utils.getInvalidAttributes(transform)

Loop over the transform attributes of the transform and see if the attributes are locked or connected to anything other than a animation curve. If this is the case the attribute is invalid.

Parameters:transform (str) – Path to transform
Returns:List of invalid attributes.
Return type:list
anchorTransform.utils.getMatrix(transform, time=None, matrixType='worldMatrix')

Get the matrix of the desired matrix type from the transform in a specific moment in time. If the transform doesn’t exist an empty matrix will be returned. If not time is specified, the current time will be used.

Parameters:
  • transform (str) – Path to transform
  • time (float/int) – Time value
  • matrixType (str) – Matrix type to query
Returns:

Matrix

Return type:

OpenMaya.MMatrix

anchorTransform.utils.getMayaTimeline()

Get the object name of Maya’s timeline.

Returns:Object name of Maya’s timeline
Return type:str
anchorTransform.utils.getOutTangent(animCurve, time)

Query the out tangent type of the key frame closest but lower than the parsed time.

Parameters:
  • animCurve (str) – Animation curve to query
  • time (int) –
Returns:

Out tangent type

Return type:

str

anchorTransform.utils.mayaWindow()

Get Maya’s main window.

Return type:QMainWindow