Back to 'Basics On How To Create Your Own Node'
IoTransform allows you to modify and manipulate Maya transform objects in much the same way as PyMel objects.
Arise returns an IoTransform object, or a subclass of it, in the rig_creation() method when the user access a ctrl or a joint.
The IoTransform __repr__ method has been reimplemented to return the long name of the Maya transform.
Which allows you to use it with the Maya's cmds library which usually expects a string name of the Maya object as its first argument.
For example: cmds.xform(self.my_joint.pointer, q=True, matrix=True)
and you can use it as an object with the many methods listed below.
To create an IoTransform object yourself:
- name {str} -- Transform node name. Could be the name of an existing transform, based on the value of 'existing'
- existing {bool} -- True means the transform exists already, False creates an empty transform (default: {False})
IoTransform properties/variables:
uuid -- {str} Return the object UUID which is a str of number and letters giving the node a unique ID
IoTransform methods:
- attr {str} -- name of attribute to lock
unlock_attr(attr)
- attr {str} -- name of attribute to unlock
- attr (str): name of an attribute on this transform
- attr (str): name of a hidden attribute on this transform
- attr {str} -- name of attribute
- attr {str} -- name of the attribute
- value {any type the attribute supports} -- the value to set the attribute to
Returns: list -- of string names of attributes on this transform
- attr_name {str} -- name of new attribute
- char_min_length {int} -- the spacer min characters length (default: {6})
- if_needed {bool} -- True skips creating spacer if the last attribute is already a spacer False creates
it anyway (default: {True})
- attr {str} -- name of an attribute on this transform
- driver_attr {str} -- long name of driver attribute path. 'driver_node.driver_attr'
If there is nothing to disconnect does nothing.
- attrs {str or list} -- str name of an attribute or a list of str of attributes on this node
- incoming {bool} -- True to disconnect incoming connections, False for out-going connections
- parent_to {str or None} -- name of a transform to parent under or None to parent to world
- parent_to {None str} -- name of a transform to parent under, or None to parent to world
- generation {int} -- the parent to return, 1=parent, 2=grandparent, and so on (default: {1})
- name {str} -- how to name the new group node
- maintain_local_values {bool} -- If set to True, the new group will be positioned at the grandparent's position.
If False will position at this transform position transferring any local transformation values this transform might have. (default: {True})
Turn visibility on or off.
- state {bool} -- True will show, False will hide (default: {False})
Set the translation values from list of 3 floats (XYZ). In world or object space.
- translation {list} -- of 3 floats representing XYZ values
- space {str} -- set the position in 'world' or 'object' space (default: {"world"})
- space {str} -- get the position in 'world' or 'object' space (default: {"world"})
Relatively change translation values.
- values {list} -- of 3 floats representing XYZ values
- space {str} -- add to position in 'world' or 'object' space (default: {"object"})
- rotation {list} -- of 3 floats representing XYZ
- space {str} -- set the rotation in 'world' or 'object' space (default: {"world"})
- space {str} -- get the rotation in 'world' or 'object' space (default: {"world"})
- values {list} -- of 3 floats representing XYZ
- space {str} -- add to rotation in 'world' or 'object' space (default: {"object"})
- scale {list} -- of 3 floats representing XYZ
- space {str} -- set the scale in 'world' or object' space (default: {"world"})
- space {str} -- get the scale in 'world' or 'object' space (default: {"world"})
Connect this node scaleY and scaleZ to scaleX then lock and hide them, so it can only be scaled uniformly.
- color {list or str} -- can take list of 3 floats RGB or str color name: values: 'red', 'blue', 'purple', 'green', 'yellow'
- x (bool, optional): lock translateX. Defaults to True
- y (bool, optional): lock translateY. Defaults to True
- z (bool, optional): lock translateZ. Defaults to True
Arguments:
- x (bool, optional): lock rotateX. Defaults to True
- y (bool, optional): lock rotateY. Defaults to True
- z (bool, optional): lock rotateZ. Defaults to True
- x (bool, optional): lock scaleX. Defaults to True
- y (bool, optional): lock scaleY. Defaults to True
- z (bool, optional): lock scaleZ. Defaults to True
- x (bool, optional): hide translateX. Defaults to True
- y (bool, optional): hide translateY. Defaults to True
- z (bool, optional): hide translateZ. Defaults to True
- x (bool, optional): hide rotateX. Defaults to True
- y (bool, optional): hide rotateY. Defaults to True
- z (bool, optional): hide rotateZ. Defaults to True
- x (bool, optional): hide scaleX. Defaults to True
- y (bool, optional): hide scaleY. Defaults to True
- z (bool, optional): hide scaleZ. Defaults to True
- attr (str): name of an attribute on this transform
- x (bool, optional): lock and hide translateX. Defaults to True
- y (bool, optional): lock and hide translateY. Defaults to True
- z (bool, optional): lock and hide translateZ. Defaults to True
- x (bool, optional): lock and hide rotateX. Defaults to True
- y (bool, optional): lock and hide rotateY. Defaults to True
- z (bool, optional): lock and hide rotateZ. Defaults to True
- x (bool, optional): lock and hide scaleX. Defaults to True
- y (bool, optional): lock and hide scaleY. Defaults to True
- z (bool, optional): lock and hide scaleZ. Defaults to True
- vis {bool} -- True to also lock and hide visibility attr (default: {True})
- state (bool, optional): True to template False to return to normal. Defaults to True
- state (bool, optional): True to reference False to return to normal. Defaults to True
- space {str} -- 'object' or 'world'. Get the matrix in object space or world space (default: {"world"})
- matrix {list} -- list of 16 floats representing the matrix
- space {str} -- 'object' or 'world'. Set the matrix in object space or world space (default: {"world"})
- transform_name {str} -- long name of a transform node to match it's transformations
- transform_name {str} -- long name of a transform node to match it's position
Arguments
- transform_name {str} -- long name of a transform node to match it's rotation
- transform_name {str} -- long name of a transform node to match it's scale
- driver {str or IoTransform} -- the driver node in this direct connection
- translate {bool} -- True to connect translate attributes (default: {True})
- rotate {bool} -- True to connect rotate attributes (default: {True})
- scale {bool} -- True to connect scale attributes (default: {True})
- attr {str} -- name of an attribute to return its full path
Can take same arguments as cmds.aimConstraint().
- transforms {list} -- of str names of driver transforms driving this constraint
- transforms {list} -- of str long names of transforms drivers of constraint
- transforms {list} -- of str names of transforms to driver the constraint
- transforms {list} -- of str names of transforms to driver the constraint
- transforms {list} -- of str names of transforms to driver the constraint
- dis_from {list or str} -- list of XYZ global position or a name of a Maya Dag node.
Rename this node.
- new_name (str): new name for this node
- state {bool} -- True to turn on False for off (default: {True})
- skip_intermediate {bool} -- True to skip any shape set as intermediate (default: {False})
- rotation_order {str} -- rotation options: 'xyz', 'yzx', 'zxy', 'xzy', 'yxz', 'zyx'
Hide this node or selection or all objects based on flags. Takes same arguments cmds.hide() takes.
_____________________________________________
Get Arise at: https://www.ariserigging.com