paya.runtime.nodes.Transform#
- class Transform(*args, **kwargs)#
 Inheritance
TransformDagNodeDagNodeEntityEntityContainerBaseContainerBaseDependNodeDependNodePyNodeProxyUnicode- classmethod create(dagPath=None, name=None, parent=None, displayLocalAxis=False, rotateOrder='xyz', worldMatrix=None)#
 Creates transform nodes.
- Parameters
 dagPath/dp (None, str) – an explicit DAG path; if provided, the minimum number of nodes required to match this DAG path will be generated;
displayLocalAxis,rotateOrderandworldMatrixwill only be applied to the last (innermost) group; defaults to Nonename/n (str) – the node name; defaults to
Noneparent/p (None, str,
Transform) – an optional parent for the transform; if this is combined withdagPath, then this node’s DAG path will be prepended; defaults to NonedisplayLocalAxis/dla (bool) – display the transform’s local axes; defaults to False
rotateOrder/ro (int, str or None) – the transform’s rotate order; defaults to ‘xyz’
worldMatrix/wm (None, list, tuple or
Matrix) – an optional world matrix for the transform, applied to the SRT channels; defaults to None
- Returns
 The transform.
- Return type
 
- toShape()#
 
- toTransform()#
 
- releaseSRT()#
 Unlocks and disconnects every SRT channel, recursively.
- Returns
 self
- closestAxisToVector(refVector, includeNegative=True)#
 
- closestOf(elems)#
 Returns the closest amongst ‘elems’ to this transform.
- Parameters
 elems – a list of Python objects that, when instantiated into PyNodes, implement
getWorldPosition()- Returns
 The closest amongst ‘elems’.
- getWorldPosition(plug=False, useLocatorShape=True)#
 Returns the world translation of this transform. Pivots are ignored.
- Shorthand
 gwp- Parameters
 plug/p (bool) – return an attribute instead of a value; if ‘useLocatorShape’ is True then, where available, the locator shape’s ‘worldPosition’ attribute will be returned; otherwise, a ‘worldPosition’ attribute will be retrieved, or initialised, on the transform itself, with its input configured as self.t ^ self.pm[0]; defaults to False
useLocatorShape/uls (bool) – True
- Returns
 The position attribute or value.
- Return type
 
- getWorldMatrix(plug=False, asOffset=False)#
 The advantage of calling
getWorldMatrix(plug=True, asOffset=True)instead ofgetWorldMatrix(plug=True).asOffset()is that, in the former case, the output will be cached for subsequent retrievals.- Parameters
 - Returns
 The world matrix of this transform, as a value or plug.
- Return type
 
- getRotateAxisMatrix(plug=False)#
 Returns the rotate axis as a rotation matrix.
- Parameters
 plug/p (bool) – return an attribute instead of a value; this will be cooked only once, and afterwards retrieved via a ‘rotateAxisMatrix’ attribute on the node; defaults to False
- Returns
 The rotate axis matrix.
- Return type
 
- makeIdentity(**kwargs)#
 Convenience wrapper for
pymel.internal.pmcmds.makeIdentity().- Parameters
 **kwargs – passed along to
pymel.internal.pmcmds.makeIdentity().- Returns
 self- Return type
 
- createOffsetGroups(*descriptors)#
 Creates transformationally-matched offset (‘zero’) groups.
- conformShapeNames(includeIntermediateShapes=False, shapeList=None)#
 Conforms the names of this transform’s shape children to the Maya convention.
- getCtShapes()#
 - Returns
 Non-intermediate curve and locator shapes under this transform.
- Return type
 [
NurbsCurveorLocator]
- rotateCtShapes(rotation)#
 Rotates control shapes in local space. Locator shapes won’t be rotated, but their
localPositionwill. Note that rotation is expected in degrees.- Parameters
 rotation (list, tuple,
Array) – an iterable of three rotation values, in degrees- Returns
 self
- scaleCtShapes(scale)#
 Scales control shapes in local space.
- Parameters
 scale (list, tuple,
Array) – an iterable of three scale values- Returns
 self
- setCtShapesFromLib(libKey, lineWidth=None, size=1.0)#
 Sets control shapes to the named library entry.
- cycleCtShapes(backward=False)#
 Steps through the library alphabetically and applies a different shape on each invocation. Useful for trying out different shapes quickly.
- clearCtShapes()#
 Removes all non-intermediate curve or locator shapes under this transform.
- Returns
 self- Return type
 
- colorCtShapes(*colorIndex, clearOverrides=True)#
 - Color shorthands
 'white': 16, 'blue': 6, 'left': 6, 'right': 13, 'red': 13, 'center': 14, 'green': 14, 'yellow': 17, 'pink': 20
- Parameters
 *colorIndex (int or None) – if a color index is provided, it is used to set the override color on all control shapes; if
Noneis passed, override colors are reset; if the argument is omitted, the first- encountered override color index is returnedclearOverrides/co (bool) – used only if colorIndex was set to
None; setoverrideEnabledto False as well; defaults to True
- Returns
 If colorIndex was provided,
selfis returned; otherwise, a color index.- Return type
 Transformor int
- addCtShapesToLib(entryName, normalize=True)#
 Captures this control’s shapes into a new library entry for reuse via
setCtShapes().
- getCtShapesLineWidth()#
 - Returns
 The first encountered line width which is above 0.0 (i.e. not the Maya default of -1.0), or None
- Return type
 float, None
- setCtShapesLineWidth(lineWidth)#
 Sets the line width on NURBS control shapes.
- createAnimSpace(labels, targets, slave=None, translate=None, rotate=None, scale=None, defaultValue=0)#
 - Parameters
 slave/slv (
str,Transform) – the transform to constrain; if omitted, defaults to the first available offset grouptargets (
str,Matrix,Transform) – the target transforms or matricestranslate/t (bool) – drive translate channels; defaults to
Truerotate/r (bool) – drive rotate channels; defaults to
Truescale/s (bool) – drive scale channels; defaults to
TruedefaultValue/dv (
int,str) – the default value for the enum attribute; defaults to0
- Returns
 The system’s network node.
- Return type