paya.runtime.data.Matrix#
- class Matrix(*args, **kwargs)#
Inheritance
- createLocator(size=1.0, name=None)#
Creates a locator and drives its SRT channels using this matrix.
- decompose(rotateOrder='xyz')#
Decomposes this matrix.
- decomposeAndApply(*slaves, translate=None, rotate=None, scale=None, shear=None, compensatePivots=False, compensateJointOrient=True, compensateRotateAxis=False, compensateJointScale=True, worldSpace=False, maintainOffset=False)#
Decomposes and applies this matrix to one or more transform slaves.
- Parameters
translate/t (bool) – apply translation
rotate/r (bool) – apply rotation
scale/s (bool) – apply scale
shear/sh (bool) – apply shear
compensateJointScale/cjs (bool) – account for segmentScaleCompensate on joints; defaults to
True
compensateJointOrient/cjo (bool) – account for jointOrient on joints; defaults to
True
compensateRotateAxis/cra (bool) – account for
rotateAxis
; defaults toFalse
compensatePivots/cp (bool) – compensate for pivots (non-joint transforms only); defaults to
False
worldSpace/ws (bool) – premultiply this matrix with the inverse of the transform’s parent matrix to negate the parent stack; defaults to
False
maintainOffset/mo (bool) – this is here for parity with
paya.runtime.plugs.Matrix.decomposeAndApply()
; whenTrue
, the transform won’t be modified at all; defaults toFalse
- Returns
self
- Return type
- applyViaOpm(*slaves, worldSpace=False, persistentCompensation=False, preserveInheritsTransform=False, maintainOffset=False)#
Poses one or more transforms by modifying their
offsetParentMatrix
attribute, with SRT channels compensated.- Parameters
worldSpace/ws (bool) – drive the transform in world-space; defaults to
False
persistentCompensation/pc (bool) – unused; here for parity with
paya.runtime.plugs.Matrix.applyViaOpm()
preserveInheritsTransform/pit – when worldSpace is requested, don’t edit the
inheritsTransform
attribute on the slave; instead, localise against the current parent; defaults toFalse
maintainOffset/mo (bool) – this is here for parity with
paya.runtime.plugs.Matrix.applyViaOpm()
; if set toTrue
, no action will be taken, andself
will be returned; defaults toFalse
- Returns
self
- Return type
- drive(*slaves, worldSpace=False, maintainOffset=False, useOffsetParentMatrix=<undefined>, preserveInheritsTransform=False)#
Poses one or more slaves using this matrix. (For the dynamic, true attachment, see
paya.runtime.plugs.Matrix.attach
.)- Parameters
worldSpace/ws (bool) – drive the slaves in world-space; defaults to
False
preserveInheritsTransform/pit – when worldSpace is requested, don’t edit the
inheritsTransform
attribute on the slave; instead, localise against its current parent; defaults toFalse
maintainOffset/mo (bool) – this is here for parity with
paya.runtime.plugs.Matrix.attach()
; if set toTrue
, no action will be taken, andself
will be returned; defaults toFalse
useOffsetParentMatrix/uop (bool) – connect into
offsetParentMatrix
instead of decomposing into SRT channels; defaults to namesake configuration flag; it that’s omitted too, defaults toTrue
if Maya >= 2022, otherwiseFalse
- Returns
self
- Return type
- __add__(other)#
Implements addition (
+
).Overloads
pymel.core.datatypes.Matrix.__add__()
to add support for 16D plugs.
- __radd__(other)#
Implements reflected addition (
+
).Overloads
pymel.core.datatypes.Matrix.__add__()
to add support for 16D plugs.
- __mul__(other)#
Implements multiplication (
*
).Overloads
pymel.core.datatypes.Matrix.__mul__()
to add support for 16D plugs.
- __rmul__(other)#
Implements reflected multiplication (
*
).Overloads
pymel.core.datatypes.Matrix.__rmul__()
to add support for 3D and 16D plugs as well as simple types.
- __rxor__(other)#
Uses the exclusive-or operator (
^
) to implement point-matrix multiplication for 3D values and plugs.
- pick(translate=None, rotate=None, scale=None, shear=None, default=None)#
Filters this matrix, similar to Maya’s pickMatrix. If ‘default’ is used, and it’s a plug, the output will also be a plug.
Flags are defined by omission, Maya-style.
- Shorthand
pk
- Parameters
- Returns
The filtered matrix.
- Return type
- classmethod asOffset()#
Implemented for parity with
paya.runtime.plugs.Matrix.asOffset()
. Returns an identity matrix.
- getAxis(axis, normalize=False)#
Extracts the specified axis from this matrix as a vector or point value. Used to implement the following properties: x, y, z and translate/t. The property versions will always return non-normalized values.
- setAxis(axis, vals)#
Sets the values for the specified axis row. Used to implement the following properties: x, y, z and translate/t.
- getX(normalize=False)#
Equivalent to
getAxis('x')
. Getter for the x property.
- setX(vals)#
Equivalent to
setAxis('x')
. Setter for the x property.
- getY(normalize=False)#
Equivalent to
getAxis('y')
. Getter for the y property.
- setY(vals)#
Equivalent to
setAxis('y')
. Setter for the y property.
- getZ(normalize=False)#
Equivalent to
getAxis('z')
. Getter for the z property.
- setZ(vals)#
Equivalent to
setAxis('z')
. Setter for the z property.
- getTranslate(normalize=False)#
Equivalent to
getAxis('translate')
. Getter for the translate/t property.
- setTranslate(vals)#
Equivalent to
setAxis('translate')
. Setter for the translate/t property.