Meta Data

Metaadditivefk

class ZooMetaAdditiveFk(*args, **kwargs)

Bases: MetaBase

Class that builds and controls the meta network node setup for the Additive Fk setup

Found in zoo.libs.maya.cmds.rig.additivefk

connectAttributes(joints, addFkJntList, blendList, controls, controlGrps, jntExprs, grpExprs, pointC, firstC)

Connects the maya nodes to the meta node

controlGroup()

Returns the control Group

Returns:

Return type:

zapi.DagNode

controlsHidden()

Return true if controls are hidden

createAdditiveFk(jointList, rigName='additive', controlSpacing=1, lockHideJoints=True, transferSkinning=True, mod=None, markingMenu=True)

Builds the setup and connects all nodes to this meta node

Parameters:
  • jointList (list(str)) – list of joints

  • rigName (str) – The name of the rig prefix

  • controlSpacing (int) – The amount of joints between controls for the distributed FK

  • transferSkinning (bool) – Transfer the skin weights from the original joints onto the blendJoints?

deleteSetup(transferSkinning=True, deleteOrigJnts=False, bake=False, message=True)

Deletes the Additive FK setup leaving the original joints only Also transfers any skinning on the blend joints back onto the original joints

getAddFkJoints()

Returns the joints as zapi nodes

Returns:

list of zapi joint nodes

Return type:

list(zapi.DGNode)

getAllNodes(includeOrigJnts=False)

Returns all nodes in the setup

Parameters:

includeOrigJnts (bool) – Include the original joints? Usually its best to leave these in the scene

Returns:

list of all zapi nodes in the setup

Return type:

list(zapi.DGNode)

getBlendJoints()

Returns the joints as zapi nodes

Returns:

list of zapi joint nodes

Return type:

list[zapi.DGNode]

getControlSpacing()
getControls()

Returns the joints as zapi nodes

Returns:

list of zapi joint nodes

Return type:

list[zapi.DGNode]

getCtrlGrps()

Returns the joints as zapi nodes

Returns:

list of zapi joint nodes

Return type:

list(zapi.DGNode)

getDgNodes()

Returns the two expressions and point constraint as zapi nodes

getJoints()

Returns regular joints as zapi nodes

Returns:

list of zapi joint nodes

Return type:

list(zapi.DGNode)

getStartEndJoint()

Returns the start joint and end joint as a string

Return startJoint:

The start joint name

Rtype startJoint:

zapi.DGNode

Return endJoint:

The end joint name

Rtype endJoint:

zapi.DGNode

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

renameRig(name)

Renames the prefix of the entire rig, all nodes.

Simply replaces the first prefix element in the name, so isn’t super smart.

Parameters:

name (str) – The name prefix of the rig

selectBlendJoints()

Selects the joints

setControlsVisible(vis)

Set controls visible

Parameters:

vis (bool) – True if show, False if hide

setScale(scl)

Set scale

Parameters:

scl (float or zapi.Plug) – set the control scale to this value

Returns:

Return type:

setupMarkingMenus()

Set up marking menus

Returns:

Return type:

toggleControls()

Toggle visibility of controls

Returns:

Return type:

Metaduplicateoncurve

class MetaDuplicateOnCurve(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the duplicate on curve functionality

Found in zoo.libs.maya.cmds.rig.splines

Axis = ['+X', '-X', '+Y', '-Y', '+Z', '-Z']
bake()

Bakes the objects, leaving them in the current position while deleting the rig

build(sourceObjects, curve, rename=True)

Build based on source objects and curve

Parameters:
  • sourceObjects (list[str] or list[zapi.DagNode] or list[zapi.DgNode] or str or zapi.DagNode) – Source objects to duplicate along the curve

  • curve (str or zapi.DagNode or zapi.DgNode) – The curve to duplicate along

  • rename (bool) – Rename metanode to use curve

Returns:

Return type:

buildSelected()

Build based on the curve that is selected in maya

Returns:

Return type:

connectAttributes(**attrs)

Connects the maya nodes to the meta node

deleteRig(keepMeta=False, mod=None)

Delete the rig

Returns:

Return type:

classmethod generateUniqueName(name='')

Get selected curve name

Returns:

Return type:

getMetaAttributes()

Get the Meta attributes to populate the ui

Returns:

Return type:

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

objectIndex(obj)

Gets the index of object

Parameters:

obj

Returns:

Return type:

origObjVisiblity()

Returns the visibility of the first source object

Return visible:

True is visible, False if hidden

Rtype visible:

bool

rebuild(selectLast=True)

Rebuild curve based

Parameters:

selectLast (bool) – Selects the last object after rebuild

Returns:

Returns last selected object if it is related to the metanode

Return type:

setEndPosition(pos, updateCurve=True)

Set end position

Parameters:

pos (float or zapi.Plug) –

Returns:

Return type:

setEndRotation(rot, updateCurve=True)

Set end rotation

Parameters:

rot (list[float] or zapi.Plug) –

Returns:

Return type:

setEndScale(scl, updateCurve=True)

Set end scale

Parameters:

scl (list[float] or zapi.Plug) –

Returns:

Return type:

setFollowAxis(axis, updateCurve=True)

Set follow Axis

Parameters:

axis

Returns:

str or zapi.Plug

Return type:

setFollowRotation(rot, updateCurve=True)

Follow Rotation

Parameters:

rot (bool or zapi.Plug) –

Returns:

Return type:

setFractionMode(f, updateCurve=True)

Set fraction mode

Parameters:

f (bool or zapi.Plug) –

Returns:

Return type:

setGroupAllGeo(g, updateCurve=True)

Group All Geo (when generating)

Parameters:

g (bool or zapi.Plug) –

Returns:

Return type:

setInstanced(ins, rebuild=True)

Set instanced or duplicate. Will rebuild

Parameters:

ins (bool or zapi.Plug) –

Returns:

Return type:

setInverseFollow(f, updateCurve=True)

Inverse Follow

Parameters:

f (bool or zapi.Plug) –

Returns:

Return type:

setInverseUp(up, updateCurve=True)

Inverse Up

Parameters:

up (bool or zapi.Plug) –

Returns:

Return type:

setMetaAttributes(**metaAttrs)

Sets the setup’s attributes usually from the UI

setMultiple(m, rebuild=True)

Set number of objects on curve. Will rebuild

Parameters:

m (int or zapi.Plug) –

Returns:

Return type:

setOriginalObjectVis(visibility)

Show or hide the visibility of the original object

Parameters:

visibility (bool) – True is show hide is False

setStartPosition(pos, updateCurve=True)

Set start position

Parameters:

pos (float or zapi.Plug) –

Returns:

Return type:

setStartRotation(rot, updateCurve=True)

Set start rotation

Parameters:

rot (list[float] or or zapi.Plug) –

Returns:

Return type:

setStartScale(scl, updateCurve=True)

Set Start scale

Parameters:

scl (list[float] or zapi.Plug) –

Returns:

Return type:

setUpAxis(axis, updateCurve=True)

Set Up Axis

Parameters:

axis

Returns:

str or zapi.Plug

Return type:

setWeight(w, updateCurve=True)

Set weighting of objects on curve

Parameters:

w (float or zapi.Plug) –

Returns:

Return type:

setWeightPosition(posActive, updateCurve=True)

Weight Position active

Parameters:

posActive (bool or zapi.Plug) –

Returns:

Return type:

setWeightRotation(rotActive, updateCurve=True)

Weight Rotation

Parameters:

rotActive (bool or zapi.Plug) –

Returns:

Return type:

setWeightScale(ws, updateCurve=True)

Weight Scale Active

Parameters:

ws (bool or zapi.Plug) –

Returns:

Return type:

classmethod upFollowAxis(upAxis, followAxis)

Helper function for extracting upAxis, upAxisInvert, followAxis, followAxisInvert from the UI combobox’s

Takes the AXIS_LIST and returns the expected variables

updateCurve(mod=None)

Update curve

Parameters:

mod (om2.MDGModifier) –

Returns:

Return type:

updateFromRig()

Update attributes

Returns:

Return type:

Metaflowpath

class ZooAlongAPath(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the Animate Along Path (motion path rig) functionality

Controls deleting, rebuilding the rig, querying and setting attributes.

Attributes:

firstJoint: The first joint in the chain lastJoint: The last joint in the chain motionPath: The motionPath node that was created ikHandle: The ikHandle created using motion paths ikEffector: The ikEffector created using motion paths ikCurve: The ikCurve created using motion paths lattice: The lattice created using motion paths base: The base created using motion paths

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

connectAttributes(firstJoint, lastJoint, path, ikHandle, ikEffector, ikCurve, lattice, base, motionPath)

Connects the maya nodes to the meta node

Parameters:
  • firstJoint (zapi.DGNode) – The first joint as a zapi node

  • lastJoint (zapi.DGNode) – The last joint as a zapi node

  • path (zapi.DGNode) – The motion path node as a zapi node

  • ikHandle (zapi.DGNode) – The ikHandle as a zapi node

  • ikEffector (zapi.DGNode) – The ikEffector as a zapi node

  • ikCurve (zapi.DGNode) – The ikCurve as a zapi node

  • lattice (zapi.DGNode) – The lattice as a zapi node

  • base (zapi.DGNode) – The base as a zapi node

connectAttributesStr(firstJoint, lastJoint, path, ikHandle, ikEffector, ikCurve, lattice, base, motionPath)

Connects the maya string names to the meta node

Parameters:
  • firstJoint (str) – The first joint as a string

  • lastJoint (str) – The last joint as a string

  • motionPath (str) – The curve that the motion path follows as a string

  • ikHandle (str) – The ikHandle as a string

  • ikEffector (str) – The ikEffector as a string

  • ikCurve (str) – The ikCurve as a string

  • lattice (str) – The lattice as a string

  • base (str) – The base as a string

getAttrConnection(classAttr)

Returns the connected node of the attribute as a zapi dag node

Returns:

zapi motionPath node

Return type:

zapi.DGNode

getAttrConnectionStr(classAttr)

Returns the connected node of the attribute as a long name

Returns:

the connection to the attribute as a string

Return type:

str

getFirstJointStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getLastJointStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getPathStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getMotionPathStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getikHandleStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getikEffectorStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getikCurveStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getLatticeStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getBaseStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getLatticeDivision()
getUpAxis()
getFrontAxis()
getSliderValue()

Returns the value of the path attribute on the controller object

setLattice(value)

Sets the lattice attribute on the controller object

setUpAxis(value)

Sets the upAxis comboBox value

setFrontAxis(value)
keyPath()

Keys the path attribute on the control object at the current time

setMotionPath(value)

Sets the path attribute on the controller object

bindJointDefaults(firstJoint, lastJoint)

Bind the defaults positions/rotations for the joints

resetJoint(firstjointName, lastjointName)

Puts backs the joints to their original positions before the rig :param firstjointName: First Joint Name in chain :type firstjointName: str :param lastjointName: Last Joint Name in chain :type lastjointName: str

joints(firstJoint, lastJoint)

Gets all the joints in between start and end :return: :rtype: list[zapi.DagNode]

selectCurveObj(add=True, replace=False)

Selects the control object

Parameters:
  • add (bool) – Add to the selection

  • replace (bool) – Deselect other objects and replace with this selection

inverseDirection(value=False)
switchCurves(newCurve)

Changes the curve path input for the rig

Parameters:

newCurve (str) – The name of the new curve

buildRig(firstJoint, lastJoint, curve, dirValue, upAxis_value, lattice_value)

Building the Rig using inputs from the UI Returns 5 values - ikHandle, ikEffector, ikCurve, lattice, base

Parameters:
  • firstJoint (str) – first joint

  • lastJoint (str) – last joint

  • curve (str) – path curve name

  • dirValue (str) – Direction of joint chain

  • upAxis_value (str) – UpAxis value of joint chain

  • lattice_value (int) – Lattice value for motion path

Returns:

Return type:

deleteAttr()
reverseCurvesMetaNodes(metaNodes, message=True)

Reverses curves for all given meta nodes, handles doubles, ie each curve is only reversed once.

Parameters:
  • metaNodes (list(obj)) – Any motion path meta nodes

  • message (bool) – Report the message to the user?

selectCurveObjs(metaNodes)

Selects the control objects of all rigs

Parameters:

metaNodes (list(obj)) – Any motion path meta nodes

checkLoadObject(objecttype)
Parameters:

objecttype (Str) – The object type you want the select object to be

Returns:

selected obj

Return type:

str

checkInputs(firstJoint, lastJoint, curve, lattice_value)
Parameters:
  • firstJoint (str) – First joint in chain

  • lastJoint (str) – Last joint in chain

  • curve (str) – path that the joint chain is following

  • lattice_value (int) – UI lattice value

Returns:

Return type:

bool

checkingLatticeValue(value)
Parameters:

value (int) – Checking input Lattice Value

Returns:

Return type:

bool

areJointsRelated(firstJoint, lastJoint)
Parameters:
  • firstJoint (str) – First joint in chain

  • lastJoint (str) – last joint in chain

Returns:

Return type:

bool

switchSelectedCurves()

Switches curves on all selected motion path rigs, select the motion path objs first and then the new curve last.

switchCurves(newCurve, metaNodes)

Switches curves of motion path rigs

Parameters:
  • newCurve (str) – the curve to switch to

  • metaNodes (list(obj)) – the meta node list of rigs to switch

selectedMetaNodes()

Returns meta nodes of type ZooMotionPathRig.__name__

buildRigSetup(firstJoint, lastJoint, curve, dirValue, upAxis_value, lattice_value)

Testing Inputs before building flow path rig :param firstJoint: first joint name in UI :type firstJoint: str :param lastJoint: last joint name in UI :type lastJoint: str :param curve: curve name in UI :type curve: str :param dirValue: which way the chain is facing in UI :type dirValue: str :param upAxis_value: Joint chain upAxis value in UI :type upAxis_value: str :param lattice_value: Lattice in UI value :type lattice_value: int :return: :rtype:

Metafocuspuller

” from zoo.libs.maya.cmds.meta import metafocuspuller metafocuspuller.cleanupBrokenMetaNodes() # removes broken setups

class ZooFocusPuller(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the Focus Puller functionality

Controls deleting, rebuilding the rig, querying and setting attributes.

Attributes:

camera: The Camera cameraShapeNode: The Camera shape node focusCtrlGrp: The focus control group that was created focusCtrl: The Focus control created using focus puller planeCtrlGrp: The focus control group that was created planeCtrl: The plane control created using focus puller parentConstraint: The parent constraint created using focus puller pointConstraint: The point constraint created using focus puller multiDivNode: The multiDiv node created using focus puller

isValid()

Tests if the current meta node is valid and not broken.

Return valid:

True if the meta node is valid, False if it is broken

Rtype valid:

bool

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

allControls()

All controls in the rig

Returns:

Return type:

list[zapi.DagNode]

setupMarkingMenus()
connectAttributes(camera_name, focus_ctrl_grp, focus_ctrl, plane_ctrl_grp, plane_ctrl, parent_constraint, point_constraint, multiDiv_node, master_grp, grid_plane)

Connects the maya nodes to the meta node

Parameters:
  • camera_name (zapi.DGNode) – The camera as a zapi node

  • focus_ctrl_grp (zapi.DGNode) – The focus control group as a zapi node

  • focus_ctrl (zapi.DGNode) – The focus control as a zapi node

  • plane_ctrl_grp (zapi.DGNode) – The plane control group as a zapi node

  • plane_ctrl (zapi.DGNode) – The focus control as a zapi node

  • parent_constraint (zapi.DGNode) – The parent constraint as a zapi node

  • point_constraint (zapi.DGNode) – The point constraint as a zapi node

  • multiDiv_node (zapi.DGNode) – The multiDiv node as a zapi node

connectAttributesStr(camera_name, focus_ctrl_grp, focus_ctrl, plane_ctrl_grp, plane_ctrl, parent_constraint, point_constraint, multiDiv_node, master_grp, grid_plane)

Connects the maya string names to the meta node

Parameters:
  • camera_name (str) – The Camera as a string

  • focus_ctrl_grp (str) – The focus control group as a string

  • focus_ctrl (str) – The focus control as a string

  • plane_ctrl_grp (str) – The plane control group as a string

  • plane_ctrl (str) – The focus control as a string

  • parent_constraint (str) – The parent constraint as a string

  • point_constraint (str) – The point constraint as a string

  • multiDiv_node (str) – The multiDiv node as a string

renderer()
getAttrConnection(class_attr)

Returns the connected node of the attribute as a zapi dag node

Returns:

zapi motionPath node

Return type:

zapi.DGNode

getAttrConnectionStr(class_attr)

Returns the connected node of the attribute as a long name

Returns:

the connection to the attribute as a string

Return type:

str

getCameraZapi()

Returns the connected node of the attribute as a long name

Returns:

the connection to the attribute as a string

Return type:

str

getCameraShapeNode()
getCameraStr()

Returns the camera string

getCameraShapeStr()
getFocusCtrlStr()

Returns the Focus Control string

getPlaneCtrlStr()

Returns the Plane Control string

getMultiDivStr()

Returns the Plane Control string

getFStopValue()

Returns the camera shape F Stop value

getCtrlVisibility()
getPlaneVisibility()
getRegionScale()
getDOF()
getFocusDistance()
getFocusScale()
getGridVis()
setFocusRegionScale(value)

Sets the fStop attribute on the camera shape object

setCtrlScale(value)

Sets the fStop attribute on the camera shape object

setFStop(value)

Sets the fStop attribute on the camera shape object

ctrlVisibility(value=True)

Sets the visibility attribute on the controls object

planeVisibility(value=True)

Sets the visibility attribute on the controls object

gridVisibility(value=True)
depthOfField(value=True)

Sets the DOF attribute on the controls object

selectFocusCtrl(add=False, replace=True)

Selects the control object

Parameters:
  • add (bool) – Add to the selection

  • replace (bool) – Deselect other objects and replace with this selection

selectCamera(add=False, replace=True)

Selects the Camera shape

Parameters:
  • add (bool) – Add to the selection

  • replace (bool) – Deselect other objects and replace with this selection

buildRig(camera_name)

Builds the focus puller rig using a camera name.

Parameters:

camera_name (str) – The camera name

Returns:

Return type:

safeDelete(attr)

Deletes a zapi node if it is connected to an attribute, passes if None

Parameters:

attr

safeDeleteAttr(nodeStr, attr)
deleteAddedAttr()
deleteAttr()

Deleting the attributes connecting to the meta node except for the camera

attr = 'cameraShape'
selectedMetaNodes()

Returns all meta nodes related to the selection

Parameters:

zapiNodes (list(object)) – Maya nodes as zapi objects

getMetaFromZapi(zapiNode)

Returns all meta nodes related to a single zapiNode of any renderer type

Parameters:

zapiNodes (list(object)) – Maya nodes as zapi objects

getMetasFromName(camera_name)

Returns the meta nodes related to the camera string name

Parameters:
  • camera_name (str) – Maya camera string name

  • zapiNodes (list(object)) – Maya nodes as zapi objects

getMetaClass(zapiNodes)

Returns all meta nodes related to zapiNodes of any renderer type

Parameters:

zapiNodes (list(object)) – Maya nodes as zapi objects

metaRenderer(meta)

Returns the renderer as a string from a meta node

Parameters:

meta (ZooFocusPuller) – A focus puller meta node

Return renderer:

The renderer type of the meta node eg “Arnold”

Rtype renderer:

str

allMetaScene()

Returns all meta nodes in the scene of all renderer types.

Return metaNodes:

All metaNodes in the scene, all renderer types

Rtype metaNodes:

list(ZooFocusPuller)

cleanupBrokenMetaNodes(message=True)

Deletes any invalid or broken meta nodes in the scene. Cleanup function

Parameters:

message (bool) – Report a message to the user?

Return deletedMeta:

All meta nodes that were deleted

Rtype deletedMeta:

list(ZooFocusPuller)

checkLoadedCamera()

Returns the first selected camera or if not selected then the focus camera.

Returns:

camera name

Return type:

zoo.libs.maya.zapi.base.DagNode

checkingInputs(camera_name, message=True)

Does the object exist in the scene

Parameters:

camera_name (Str) – Camera Name

Return exists:

True if it exists, False if not

Rtype exists:

bool

checkObjType(name, object_type='camera')
deleteInvalidMeta(metaNode, message=True)

Checks and deletes a broken meta setup. Returns True if deleted

Parameters:

metaNode (ZooFocusPuller) – A focus puller network node

Return deleted:

True if the setup was broken and deleted

Rtype deleted:

bool

buildRigSetup(camera_name)

Builds the setup for Maya (no renderer)

Parameters:

camera_name (Str) – Camera Name

selectCamera(camera_name)
depthOfField(camera, value)
setFocusRegionScale(camera, value)
setFStop(camera, value)
setFocusDistance(camera, value)
getDOF(camera)
getFocusDistance(camera)
getFStopValue(camera)
getRegionScale(camera)

Metafocuspuller_arnold

class ZooFocusPullerArnold(*args, **kwargs)

Bases: ZooFocusPuller

renderer()
proxyAttribute()
buildRig(camera_name)

Builds the focus puller rig using a camera name.

Overridden method.

Parameters:

camera_name (str) – The camera name

Returns:

Return type:

getFocusDistance()
getAperture()
getAspect()
getBladeCount()
getBladeAngle()
getRotation()
getDOF()
setFocusDistance(value)
setAperture(value)
setAspect(value)
setBladeCount(value)
setBladeAngle(value)
setBladeRotation(value)
depthOfField(value=True)

Sets the DOF attribute on the controls object

deleteAddedAttr()

Deleting the attributes connecting to the meta node except for the camera

depthOfField(camera, value)
focusDistance(camera, value)
aperture(camera, value)
aspect(camera, value)
bladeCount(camera, value)
bladeAngle(camera, value)
bladeRotate(camera, value)
getDOF(camera)
getFocusDistance(camera)
getAperture(camera)
getAspect(camera)
getBladeCount(camera)
getBladeAngle(camera)
getRotation(camera)
buildRigSetup(camera_name)

Builds the rig setup for Arnold

Parameters:

camera_name (Str) – Camera Name

Metafocuspuller_redshift

class ZooFocusPullerRedshift(*args, **kwargs)

Bases: ZooFocusPuller

renderer()
proxyAttribute()
buildRig(camera_name)

Builds the focus puller rig using a camera name.

Overridden method.

Parameters:

camera_name (str) – The camera name

Returns:

Return type:

getBokehStr()
getBokehZapi()
getCOCRadius()
getPower()
getAspect()
getBladeCount()
getBladeAngle()
getDOF()
setFocusDistance(value)
setCOCRadius(value)
setPower(value)
setAspect(value)
setBladeCount(value)
setBladeAngle(value)
depthOfField(value=True)

Sets the DOF attribute on the controls object

deleteAddedAttr()

Deleting the attributes connecting to the meta node except for the camera

buildRigSetup(camera_name)

Builds the rig setup for Redshift

Parameters:

camera_name (Str) – Camera Name

Metafocuspuller_renderman

class ZooFocusPullerRenderman(*args, **kwargs)

Bases: ZooFocusPuller

renderer()
proxyAttribute()
buildRig(camera_name)

Builds the focus puller rig using a camera name.

Overridden method.

Parameters:

camera_name (str) – The camera name

Returns:

Return type:

getAspect()
getBladeCount()
getBladeAngle()
getRoundness()
getDensity()
setAspect(value)
setBladeCount(value)
setBladeAngle(value)
setRoundness(value)
setDensity(value)
deleteAddedAttr()

Deleting the attributes connecting to the meta node except for the camera

aspect(camera, value)
roundness(camera, value)
density(camera, value)
bladeCount(camera, value)
bladeAngle(camera, value)
getAspect(camera)
getRoundness(camera)
getDensity(camera)
getBladeCount(camera)
getBladeAngle(camera)
buildRigSetup(camera_name)

Builds the rig setup for Renderman

Parameters:

camera_name (Str) – Camera Name

Metajointscurve

class ZooJointsCurve(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the joint on curve functionality

Found in zoo.libs.maya.cmds.rig.splines

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

connectAttributes(jointNodeList, curveNode)

Connects the maya nodes to the meta node

Parameters:
  • jointNodeList (list(zapi.DGNode)) – list of zapi joint nodes

  • curveNode (zapi.DGNode) – curve as a zapi node

setMetaAttributes(jointCount, jointName, spacingWeight, spacingStart, spacingEnd, secondaryAxisOrient, fractionMode, numberPadding, suffix, reverse)

Sets the setup’s attributes usually from the UI

getMetaAttributes()
setMetaJointName(jointName)
getMetaJointName()
getJoints()

Returns the joints as zapi dag node list

Returns:

list of zapi joint nodes

Return type:

list(zapi.DGNode)

getJointsStr()

Returns the joints as string names

Returns:

list of joint long names

Return type:

list(str)

getCurve()

Returns the curve as a zapi dag node

Returns:

zapi curve nodes

Return type:

zapi.DGNode

getCurveStr()

Returns the curve as a long name

Returns:

curve node names

Return type:

str

deleteJoints()

Deletes all the joints associated with the meta node

deleteSplineJoints(nodes, message=False)

Deletes all joints and the meta node setup related to the selection

Parameters:
  • nodes (list(zapi.DGNode)) – any zapi nodes, will be joints or curves related to joint setup

  • message (bool) – report the message to the user

Return success:

True if joints were deleted

Rtype success:

bool

Metamotionpathrig

” Build Motion Path Rigs Meta ########################################

Build motion path rigs with various setups and change options.

Zoo meta nodes use Maya’s “network” nodes to track and control multiple objects in node setups.

Build a single motion path rig with a meta node:

from zoo.libs.maya.cmds.meta import metamotionpathrig
metaNode = metamotionpathrig.ZooMotionPathRig()
metaNode.build(transform, curve, group=group, controlObj=controlObj, followAxis=followAxis, upAxis=upAxis,
                worldUpVector=worldUpVector, parentConstrain=parentConstrain, message=message)

Or build multiple rigs from selection:

from zoo.libs.maya.cmds.meta import metamotionpathrig
metaNodes = buildMotionPathRigsSelection(curve="", group=True, followAxis="z", upAxis="y", worldUpVector=(0, 1, 0),
                             parentConstrain=False, message=True)

Meta nodes can be retrieved from the scene

metaNodes = metamotionpathrig.sceneMetaNodes()

Or retrieved via the related selection of any object in the rig setup

metaNodes = metamotionpathrig.selectedMetaNodes()

Rigs can be modified via the meta:

for meta in metaNodes:
    meta.setUpAxis("y")

Changes requiring hierarchy modifications the rigs are automatically completely rebuilt.

for meta in metaNodes:
    meta.setGrouped(True)

Rigs can be deleted with

meta.deleteRig()

Author: Andrew Silke

class ZooMotionPathRig(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the Animate Along Path (motion path rig) functionality

Controls deleting, rebuilding the rig, querying and setting attributes.

Found in zoo.libs.maya.cmds.objutils.constraints

Attributes:

motionPath: The motionPath node that was created curve: The curve the motion path follows obj: The original object usually also the control object, but not always followGrp: The group that has the motion path on it. Created if group or parentConstrain. parentConstrainGrp: The group parent constrained to the follow group. Created if group and parentConstrain. controlObj: The controlObj that receives the attributes. May have a new long name because of parenting. constraint: The parent constraint name. Created if parentConstrain.

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

connectAttributes(motionPath, curve, obj, followGrp, parentConstrainGrp, controlObj, parentConstraint)

Connects the maya nodes to the meta node

Parameters:
  • motionPath (zapi.DGNode) – The motion path node as a zapi node

  • curve (zapi.DGNode) – The curve that the motion path follows as a zapi node

  • obj (zapi.DGNode) – The main object, usually also the control object as a zapi node

  • followGrp (zapi.DGNode) – the optional follow group as a zapi node, can be None

  • parentConstrainGrp (zapi.DGNode) – the optional parent constraint group as a zapi node, can be None

  • controlObj (zapi.DGNode) – the control object, driver object as a zapi node, can be None

  • parentConstraint (zapi.DGNode) – the optional parent constraint a zapi node, can be None

connectAttributesStr(motionPath, curve, obj, followGrp, parentConstrainGrp, controlObj, parentConstraint)

Connects the maya string names to the meta node

Parameters:
  • motionPath (str) – The motion path node as a string

  • curve (str) – The curve that the motion path follows as a string

  • obj (str) – The main object, usually also the control object as a string

  • followGrp (str) – the optional follow group as a string, can be “”

  • parentConstrainGrp (str) – the optional parent constraint group as a string, can be “”

  • controlObj (str) – the control object, driver object as a string, can be “”

  • parentConstraint (str) – the optional parent constraint a string, can be “”

setMetaAttributes()

Sets the setup’s attributes usually from the UI

getMetaAttributes()

Returns a dictionary of object fullpath string names

isValid()

Checks if connected to a motion path, if not then the meta is dead

upVectorControl()

Returns whether the up vector control exists

upVCtrlScale()

Gets the scale of the up vector control if it exists, returns None if doesn’t exist

setUpVCtrlScale(scale)

Sets the absolute scale of the up vector control

Parameters:

scale (float) – The absolute scale of the control

setUpVCtrlRelScale(scaleMultiplier, reset=False)

Scale the up vector control relatively, ie 1.1 will make the control 10% bigger.

Parameters:
  • scaleMultiplier (float) – A multiplication value of the scale, 1.1 will make the control 10% bigger.

  • reset (bool) – If True will rest the scale to the size it was created.

setUpVectorControl(build)

Sets the state of the upVectorControl, will build or delete the control

rotationFollow()

Returns whether the motion path controls rotation True or not False

Return rotationFollow:

True if rotation is connected False if not

Rtype rotationFollow:

bool

setRotationFollow(follow)

If follow then connects the objects rotation if not disconnects it.

Parameters:

follow (bool) – If True connects the rotate of the motion path and the main object

worldUpType()

Gets the world up type of the motion path as an int:

Scene Up: 0 Object Up: 1 Object Rotation Up: 2 Vector: 3 Normal: 4

Return worldUpType:

Int representing the world up type, see description for value names.

Rtype worldUpType:

int

setWorldUpType(worldUpType)

Sets the world up type of the motion path as an int:

Scene Up: 0 Object Up: 1 Object Rotation Up: 2 Vector: 3 Normal: 4

Parameters:

worldUpType (int) – Int representing the world up type, see description for value names.

worldUpObject()

Returns the world up object connected to the attr “worldUpMatrix” on the motion path

Or returns “” if not connected.

Return worldUpObject:

the world up object connected to the attr “worldUpMatrix” on the motion path

Rtype worldUpObject:

str

setWorldUpObject(worldUpObject)
worldUpVector()
setWorldUpVector(upVector)

Sets the world up vector

Parameters:

upVector (list(float)) – The up vector for the motion path

upAxis()

Returns the up axis as a string “X”, “Y”, “Z”, “-X”, “-Y”, “-Z”

Return upAxis:

The up axis as a string, “X”, “Y”, “Z”, “-X”, “-Y”, “-Z”

Rtype upAxis:

str

setUpAxis(upAxis)

Sets the up axis of the motion path from lowercase “-x”, “z”, “-y” etc

Parameters:

upAxis (str) – “-x”, “z”, “-y” etc

followAxis()

Returns the follow (front) axis as a string “X”, “Y”, “Z”, “-X”, “-Y”, “-Z”

Return upAxis:

The follow (front) axis as a string, “X”, “Y”, “Z”, “-X”, “-Y”, “-Z”

Rtype upAxis:

str

setFollowAxis(followAxis)

Sets the up axis of the motion path from lowercase “-x”, “z”, “-y” etc

Parameters:

upAxis (int) – “-x”, “z”, “-y” etc

grouped()

Returns True if the rig has been grouped in the UI

Return grouped:

Returns True if the rig has a group

Rtype grouped:

bool

setGrouped(group=True)

Potentially rebuilds the rig by deleting and rebuilding it if differences in the group option

If the value matches the current setting do nothing.

Parameters:

group (bool) – potentially rebuilds the rig by deleting and rebuilding it if True

follow()

Returns whether the rig has the follow option checked.

Return follow:

Is the rig following the path with rotation values?

Rtype follow:

bool

setFollow(follow, message=False)

Set the follow bool on the motion path. Checks if the rotation of the target obj has keys or connections

Also needs to remove or add the twist attributes on teh control object:

MOPATH_FRONTTWIST_ATTR = “frontTwist” MOPATH_UPTWIST_ATTR = “upTwist” MOPATH_SIDETWIST_ATTR = “sideTwist”

Parameters:
  • follow (bool) – True if the rotation follow option will be on, False if only translation

  • message (bool) – Report the message to the user?

parentConstrained()

Returns True if the rig is parent constrained

Return parentConstrained:

Returns True if the rig is parent constrained

Rtype parentConstrained:

bool

setParentConstrained(parentConstrain)

Potentially rebuilds the rig by deleting and rebuilding it if differences in the parentConstrain option

If the value matches the current setting do nothing.

Parameters:

parentConstrain (bool) – potentially rebuilds the rig by deleting and rebuilding it if differences

isControlObjReferenced()

Checks whether the control object is refernced or not. Useful for UI greying out the ability to grp.

Return referenced:

True if the control object is referenced

Rtype referenced:

bool

keyPath()

Keys the path attribute on the control object at the current time

getPath()

Returns the value of the path attribute on the controller object

setPath(value)

Sets the path attribute on the controller object

reverseCurve()

Reverses the curve of the motion path

motionPathObj()

Returns the object driven by the motion path node from the motion path via the zCoordinate attr

Return motionPathObj:

the object driven by the motion path node

Rtype motionPathObj:

str

getMotionPath()

Returns the motionPath as a zapi dag node

Returns:

zapi motionPath node

Return type:

zapi.DGNode

getMotionPathStr()

Returns the motionPath as a long name

Returns:

motionPath node names

Return type:

str

getControlObj()

Returns the controlObj as a zapi dag node

Returns:

zapi motionPath node

Return type:

zapi.DGNode

getControlObjStr()

Returns the controlObj as a long name

Returns:

controlObj node names

Return type:

str

getCurve()

Returns the curve as a zapi dag node

Returns:

zapi curve node

Return type:

zapi.DGNode

getCurveStr()

Returns the curve as a long name

Returns:

curve node names

Return type:

str

selectControlObj(add=True, replace=False)

Selects the control object

Parameters:
  • add (bool) – Add to the selection

  • replace (bool) – Deselect other objects and replace with this selection

buildUpVectorControl(controlScale=2.0)

Builds the upVector control and connects to the meta node

build(obj, curve, group=True, controlObj='', followAxis='z', upAxis='y', worldUpVector=(0, 1, 0), worldUpObject='', worldUpType=3, parentConstrain=False, follow=True, message=True)

Builds the rig for the meta node

Parameters:
  • obj (str) – The object to attach to a motion path

  • curve (str) – The curve that will be the motion path

  • controlObj (str) – Optional object that the attribute will be assigned to, might be a control, if empty will be obj

  • followAxis (str) – The axis to follow, default is “z”, can be “x”, “y”, “z”, “-x”, “-y”, “-z”

  • upAxis – The up vector axis

  • worldUpVector (tuple(float)) – The up vector x, y, z as a list or tuple (0, 1, 0)

  • worldUpObject (str) – The object for the object up rotation or object up (aim).

  • worldUpType (int) – 0 “scene”, 1 “object”, 2 “objectrotation”, 3 “vector”, or 4 “normal”

  • parentConstrain (bool) – parent constriain the obj, or obj’s group, to a follow group which has the motion path

  • follow (bool) – Will rotation follow the path, if off only translation is controlled.

  • message (bool) – Report any messages to the user?

buildUI(obj, curve, group=True, controlObj='', followAxis='z', upAxis='y', worldUpVector=(0, 1, 0), worldUpObject='', worldUpType=3, parentConstrain=False, follow=True, message=True)

See self.build for docs This version connects up the meta attributes to the meta node and returns the control object.

switchCurves(newCurve)

Changes the curve path input for the rig

Parameters:

newCurve (str) – The name of the new curve

deleteUpVectorControl()
deleteEmptyMeta()

Deletes the meta node if it is not attached to a motionPath node

Return deleted:

True if the rig was deleted

Rtype deleted:

bool

deleteControlAttrs(keepPathAttr=False)

Deletes the attributes on the control object:

MOPATH_PATH_ATTR = “path” MOPATH_FRONTTWIST_ATTR = “frontTwist” MOPATH_UPTWIST_ATTR = “upTwist” MOPATH_SIDETWIST_ATTR = “sideTwist”

createControlAttrs()

Creates and connects the control attributes on the rig, for setting follow to be true.

MOPATH_FRONTTWIST_ATTR = “frontTwist” MOPATH_UPTWIST_ATTR = “upTwist” MOPATH_SIDETWIST_ATTR = “sideTwist”

safeDelete(node)

Deletes a zapi node and passes if None

deleteRig(keepMeta=False, keepPathAttrs=False, message=True)

Deletes the rig, can be multiple types of rig

rebuildRig(parentConstrain=None, group=None, follow=None, message=True)

Rebuilds the rig by deleting and building with the new settings.

Handles individual updates of parentConstrain and group

Parameters:
  • parentConstrain (bool) – Is the rig parent constrained?

  • group (bool) – Is the control object grouped?

  • message (bool) – Report a message to the user

switchCurves(newCurve, metaNodes)

Switches curves of motion path rigs

Parameters:
  • newCurve (str) – the curve to switch to

  • metaNodes (list(obj)) – the meta node list of rigs to switch

switchCurvesSelection()

Switches curves on all selected motion path rigs, select the motion path objs first and then the new curve last.

reverseCurvesMetaNodes(metaNodes, message=True)

Reverses curves for all given meta nodes, handles doubles, ie each curve is only reversed once.

Parameters:
  • metaNodes (list(obj)) – Any motion path meta nodes

  • message (bool) – Report the message to the user?

deselectRigs()

Deselect for UI

selectControlObjs(metaNodes)

Selects the control objects of all rigs

Parameters:

metaNodes (list(obj)) – Any motion path meta nodes

buildMotionPathRigsSelection(curve='', group=True, followAxis='z', upAxis='y', worldUpVector=(0, 1, 0), worldUpObject='', worldUpType=3, parentConstrain=False, autoCleanMeta=True, follow=True, upVectorControl=False, upVScale=2.0, message=True)

Creates a motion path rigs from the current selection with ZooMotionPathRig meta nodes. Makes motion paths a lot easier to create and animate by copying the driving attributes onto the object itself.

Supports multiple object selection, the curve path object should be selected last if it not given directly.

Parameters:
  • curve (str) – The curve that will be the motion path

  • group (bool) – Group the object so that the motion path is on the group, not on the selected objects

  • followAxis (str) – The axis to follow, default is “z”, can be “x”, “y”, “z”, “-x”, “-y”, “-z”

  • upAxis – The up vector axis

  • worldUpVector (tuple(float)) – The up vector x, y, z as a list or tuple (0, 1, 0)

  • parentConstrain (bool) – parent constrain the obj, or obj’s group, to a follow group which has the motion path

  • autoCleanMeta (bool) – If True delete any unused meta nodes and unused motion path nodes

  • follow (bool) – Will rotation follow the path, if off only translation is controlled.

  • message (bool) – Report a message to the user?

Return metaList:

The motionPath node that was created list of zoo metaNodes

Rtype metaList:

list(objects)

autoCleanEmptyMotionPathMeta(cleanMotionPaths=True)

Cleans/deletes out any empty meta nodes and optionally deletes disconnected motion paths

deleteMotionPathRigs(nodes, message=False)

Deletes all motionPath rigs and the meta node setup related to the selection

Parameters:
  • nodes (list(zapi.DGNode)) – any zapi nodes, can be any node related to joint setup

  • message (bool) – report the message to the user

Return success:

True if joints were deleted

Rtype success:

bool

sceneMetaNodes()

Returns all ZooMotionPathRig meta nodes

selectedMetaNodes()

Returns meta nodes of type ZooMotionPathRig.__name__

referenceSelectionCheck()

Checks if a control object under the selected metas, but not the last (curve) is a referenced obj

Return referenced:

True if a referenced object was found

Rtype referenced:

bool

Metasplinerig

class MetaSplineRig(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the duplicate on curve functionality

Found in zoo.libs.maya.cmds.rig.splines

additiveFkControlsHidden()

Return true if additive fk controls hidden, false otherwise

Returns:

Return type:

additiveFkDag()

Additive FK dag node

Returns:

Return type:

zapi.DagNode

additiveFkMetaExists()

Returns true if additive fk meta node exists

Returns:

Return type:

additiveFkMetaNode()

Additive FK Meta node

Returns:

Returns the meta node of the additive zoo meta

Return type:

metaadditivefk.ZooMetaAdditiveFk

allControls()

All controls in the rig

Returns:

Return type:

list[zapi.DagNode]

allMessageNodes(includeDefault=False)

Gets all the rig nodes

Returns:

Return type:

list[zapi.DagNode or zapi.DGNode]

bake(keepMeta=False, mod=None, showSpline=False)

Bakes the objects, leaving them in the current position while deleting the rig

Parameters:
  • keepMeta

  • mod

  • showSpline (bool) – Set to true if rebuilding, keeps the original curve hidden if exists

bindJointDefaults(mod=None)

Bind the defaults positions/rotations for the joints

build(bindDefaultJoints=True, buildType=1, mod=None)

Build based on source objects and curve

Parameters:
  • bindDefaultJoints

  • buildType

  • mod (om2.MDGModifier) –

Returns:

Return type:

buildAdditiveFkRig(mod=None, controlSpacing=1, rigName='')

Build additive Fk Rig

Parameters:
  • mod

  • controlSpacing (int) – Build the controls on every nth joint

Return additiveFkMeta:

The addFk meta node

Rtype additiveFkMeta:

zapi.DagNode

checkNeedsRebuild(metaAttrs)
clearMessageAttrs(attr, mod=None)

todo: can probably be moved to plug or base class todo: mod needs to work

Returns:

Return type:

cogControlNode()

Cog Control Value

Returns:

Return type:

zapi.DagNode

connectAttributes(**attrs)

Connects the maya nodes to the meta node

connectNodeToMessageAttr(node, attr, mod=None)
connectNodesToMessageAttr(nodes, attr, mod=None)

Connect nodes

Parameters:
  • nodes

  • attr

  • mod

Returns:

Return type:

controlTypes()

Control types available as strings

Return controlTypeList:

A list of control types that exist on the rig Eg [‘spine’, ‘revFk’]

Rtype controlTypeList:

list[str]

controlsHidden()

Controls hidden. Just checks the first one for now

Returns:

Are the controls hidden in the scene

Return type:

bool

currentControls(includeCog=True)

Get the current controls in the current mode.

Returns:

All the controls as zapi objects in the current mode.

Return type:

list[zapi.DagNode]

currentHierarchyModeStr()

Returns a string of the current mode

Return currentMode:

Either ‘spine’, ‘fk’, ‘float’, or ‘revFk’

Rtype currentMode:

str

deleteAdditiveFkRig()

Delete additive fk rig

Returns:

Return type:

deleteMeshMarkingMenus(mod)
deleteRig(keepMeta=False, deleteAll=False, mod=None, message=True, showSpline=False)

Delete the rig

Parameters:
  • mod (om2.MDGModifier) –

  • deleteAll (bool) – Includes the mesh and joints

  • showSpline (bool) – Set to true if rebuilding, note only controls vis of the original curve

Returns:

Return type:

detachAdditiveFk(mod=None)

Detach the additive Fk rig so the meta can be deleted or baked

Parameters:

mod

Returns:

Return type:

duplicateRig()

Duplicate rig

Returns:

Returns the new duplicated meta

Return type:

MetaSplineRig

endJointNode()

End Joint node

Returns:

Return type:

zapi.DagNode

enumNum(enumStr)

Gets the number from the enum str eg “fk=1” ==> int(1)

Parameters:

enumStr

Returns:

Return type:

flatten(l)

Flattens a list

[[1,2,3], [1,2,3]] –> [1, 2 ,3, 1, 2, 3]

Parameters:

l

Returns:

Return type:

generateUniqueName(name='')

Generates a unique rig name, if its already unique it will return name

Returns:

Return type:

str

hierarchySwitchRigValue()

Combo int value for the GUI assuming there is four items in the combo box

‘spine’ = 0 ‘fk’ = 1 ‘float’ = 2 ‘revFk = 3

Return comboModeInt:

The GUI Switch To Combo int value of the current hierarchy mode

Rtype comboModeInt:

int

id = 'MetaSplineRig'
isPublished()

Is published

Returns:

Return type:

bool

joints()

Gets all the joints in between start and end

Returns:

Return type:

list[zapi.DagNode]

jointsSplineNode()

Joints Spline Node

Returns:

Return type:

zapi.DagNode

meshHasMarkingMenus()

Returns true if has saved meshes

Returns:

Return type:

metaAttributeValues()

Get the Meta attributes to populate the ui

Returns:

Return type:

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

classmethod metaNodeRigNames()

Gets the rig names in the scene based on available metanodes

Returns:

Return type:

objectIndex(obj)

Gets the index of object

Parameters:

obj

Returns:

Return type:

origObjVisiblity()

Returns the visibility of the first source object

Return visible:

True is visible, False if hidden

Rtype visible:

bool

rebuild(selectLast=True, bake=False, message=True, mod=None)

Rebuild curve based

Parameters:
  • mod (om2.MDagModifier) –

  • selectLast (bool) – Selects the last object after rebuild

Returns:

Returns last selected object if it is related to the metanode

Return type:

resetJoints(mod=None)

Resets joints to bound matrix positions

Returns:

Return type:

rigGroupNode()

The main rig group

Returns:

Return type:

zapi.DagNode

rigNameStr()

Get rig name

Returns:

Return type:

str

savedMeshes()
selectJoints()

Selects the skin joints, if the addFk joints exist then select those as a priority

selectMeta()

Select Meta

Returns:

Return type:

setAdditiveFk(additiveFkMeta, mod=None)

Sets the additive FK meta node

Parameters:

additiveFkMeta (metaadditivefk.ZooMetaAdditiveFk) – Connects the new additive fk meta node to this one

Returns:

Return type:

setAdditiveFkScale(scl)

Set the scale of the additive fk

Parameters:

scl (float or zapi.Plug) – set the control scale to this value

Returns:

Return type:

setBuildFK(b, rebuildRig=True)

Set the rig to build the FK controls

Parameters:

b (bool or zapi.Plug) –

Returns:

Return type:

setBuildFloat(b, rebuildRig=True)

Set the rig to build floating controls

Parameters:

b (bool or zapi.Plug) –

Returns:

Return type:

setBuildReverseFKControls(b, rebuildRig=True)

Set the rig to build teh reverse fk controls

Parameters:

b (bool or zapi.Plug) –

Returns:

Return type:

setBuildSpine(b, rebuildRig=True)

Set the rig to build the spine

Parameters:

b (bool or zapi.Plug) –

Returns:

Return type:

setControlCount(c, rebuild=True)

Set number of controls

Parameters:

c (int or zapi.Plug) – New control count

Returns:

Return type:

setCurrentControlVis(vis, includeCog=False)

Set the current control visibility

Parameters:
  • vis – True if visible, false otherwise

  • includeCog

Returns:

Return type:

setEndJoint(endJoint, rebuild=True, mod=None)

Set the end joint

Parameters:

endJoint (str or zapi.Plug) –

Returns:

Return type:

setHierarchySwitch(hierSwitch, updateRig=True)

Set the hierarchy

Parameters:

hType (str or zapi.Plug) – Needs to be string

Returns:

Return type:

setMeshMarkingMenuActive(active, mod=None)

Set marking menus for

Parameters:

active

Returns:

Return type:

setMetaAttributes(mod=None, **metaAttrs)

Sets the setup’s attributes usually from the UI. Will not update rig automatically

setOrientRoot(orient, updateRig=True)

Set the orient root setting

Parameters:

orient (str or zapi.Plug) –

Returns:

Return type:

setOriginalObjectVis(visibility)

Show or hide the visibility of the original object

Parameters:

visibility (bool) – True is show hide is False

setPublished(pub)

Sets published (hides marking menu items for users)

Parameters:

pub

Returns:

Return type:

setRigName(name, mod=None, force=True)

Set the rig name

Parameters:

name (str or zapi.Plug) –

Returns:

Return type:

setScale(scl)

Set scale

Parameters:

scl (float or zapi.Plug) – set the control scale to this value

Returns:

Return type:

setStartJoint(startJoint, rebuild=True, mod=None)

Set the start joint

Parameters:

startJoint (str or zapi.Plug) –

Returns:

Return type:

setupMarkingMenus(includeMesh=True)

Set up marking menus

Parameters:

includeMesh (bool) – Add marking menu to the skinned meshes too?

skinClusters(addFkMeta)

Returns the skin clusters if any are skinned to the joints

Parameters:

addFkMeta

Returns:

Return type:

skinnedMeshes(addFkMeta)

Returns the skinned meshes if any are skinned to the joints

Parameters:

addFkMeta

Returns:

Return type:

startJointNode()

Start Joint node

Returns:

Return type:

zapi.DagNode

switchControls(ctrls)

Switch to control type and match

Parameters:

ctrls

Returns:

Return type:

toggleControls()

Toggle Controls

Returns:

Return type:

toggleControlsAdditiveFk()

Toggle controls additive FK

Returns:

Return type:

updateAttributes()

Update attributes from rig

updateRig(metaAttrs=None, mod=None)

Update rig

Parameters:

mod (om2.MDGModifier) –

Returns:

Return type:

Metatubecurve

class ZooTubeCurve(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for the tube on curve functionality

Found in zoo.libs.maya.cmds.rig.splines

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

connectAttributes(strokeTransform, strokeShape, meshTransform, meshShape, brushNode, group, curve)

Connects the maya nodes to the meta node

Parameters:
  • strokeTransform (zapi.DGNode) –

  • strokeShape

  • meshTransform

  • meshShape

  • brushNode

  • group

Returns:

Return type:

bake()

Bake

Returns:

Return type:

deleteTube()

Clean up

Returns:

Return type:

setMetaAttributes(radius=None, axisDiv=None, density=None, minClip=None, maxClip=None, polyLimit=None)

Sets the setup’s attributes usually from the UI

tubeAttributes()

Get the attributes of the tube

Returns:

Return type:

Metaviewportlight

from zoo.libs.maya.cmds.meta import metaviewportlight metaNode = metaviewportlight.ZooViewportLight() metaNode.createLightCamera(camera=”persp”)

class ZooViewportLight(*args, **kwargs)

Bases: MetaBase

Class that controls the meta network node setup for zoo viewport lights

Controls deleting, rebuilding the setups, querying and setting attributes.

Attributes:

lightList: A list of all the lights in the setup specularLight: The specular only light in the setup lightControl: The control of the viewport light masterGroup: The master group of the light, only if constrained to camera lightConstraint: The light constraint of the setup, only if constrained to a camera camera: The linked camera, only if constrain to a camera

metaAttributes()

Creates the dictionary as attributes if they don’t already exist

connectNodesToMessageAttr(nodes, attr)

Connect nodes

Parameters:
  • nodes (list(zapi.DGNode)) – a list of zapi nodes

  • attr (str) – Attribute name of the meta node to connect, should be a kMFnMessageAttribute array

connectAttrString(nodeStr, attrName)
Parameters:
  • nodeStr (str) – Node or object string name

  • attrName (str) – The name of the attribute to connect, should be a kMFnMessageAttribute type.

connectAttrStringList(nodeStrList, attrName)

Connects a string list to a meta node attribute message array node

Parameters:
  • nodeStrList (list(str)) – List of string maya node/object names

  • attrName (str) – The name of the attribute to connect, should be a kMFnMessageAttribute array.

clearMessageAttrs(attr)

Clears the message node attribute list of an array attribute

Parameters:

attr (str) – Attribute name of the meta node to connect, should be a kMFnMessageAttribute array

isValid()

Checks if the light setup is valid and has a main light group and either a HDRI or directional light group

Return validity:

if the light setup is a legitimate working setup

Rtype validity:

bool

getAttrConnection(class_attr)

Returns the connected node of the attribute as a zapi dag node

Returns:

zapi motionPath node

Return type:

zapi.DGNode

getAttrConnectionStr(class_attr)

Returns the connected node of the attribute as a long name

Returns:

the connection to the attribute as a string

Return type:

str

getDirectionalTransformsStr()
getDirectionalShapesStrs()
getHdrTransform()
getHdriShape()
getCameraStr()
getSpecularTransformStr()
getDirectionalCtrlStr()
getDirectionalGrpStr()
getMasterGrpStr()
getCameraCnstntStr()
getCamMatchGrpStr()
getSetupParentCnstntStr()
getPivotGrpStr()
getControlsGrpStr()
getMasterCtrlStr()
getDirectionalIntMultStr()
getspecularIntMultStr()
dirIntensity()

Sets the intensity of the lights

hdrIntensity(standardSurface=True)

Sets the intensity of the lights

specIntensity()

Sets the intensity of the lights

softAngle()

Sets the light spread of the directional light setup

shadowColor()
dMapRes()
directionalCount()
multiplierState()
setDirIntensity(intensity)

Sets the intensity of the lights

Parameters:

intensity (float) – The intensity of the directional light setup

setHdrIntensity(intensity, standardSurface=True)

Sets the intensity of the lights

Parameters:

intensity (float) – The intensity of the HDR light setup

setSpecIntensity(intensity)

Sets the intensity of the lights

Parameters:

intensity (float) – The intensity of the directional light setup

setSoftAngle(softAngle)

Sets the light spread of the directional light setup

Parameters:

softAngle (float) – the spread in degrees

setShadowColor(shadowColor)
setDMapRes(dMapRes)
orientConstrained()
setDirectionalCountAuto(newLightCount)

Upgrades a directional setup’s light count, must have an existing light number

setDirectionalCount(newLightCount, lightCount=7, depthMap=1024, directionalIntensity=1.0, specularIntensity=0.0, surfaceStandardMatch=True, softAngle=3.0, shadowColor=(0.0, 0.0, 0.0))
setMultiplierState(intensity, surfaceStandardMatch=True)
switchCamera(newCamera)

Reconstrains the setup to a new camera and reconnects the focal length too

Parameters:

newCamera (str) – The new camera to switch the whole setup to.

switchCameraLegacy(newCamera)

Old code for the previous setup that switches cameras

rotCamFollow(follow=True)

Links and unlinks the rotation camera follow on the viewport rig setup.

Parameters:

follow (bool) – Follow rotation or unfollow/unlink?

selectMasterControl()
selectDirectionalControl()
selectHdriControl()
connectAllNodes()
connectDirectionalLights()
createDirectionalLight(masterGrp, directionalCtrl, softAngle, lightCount, shadowColor, directionalIntensity, specularIntensity, depthMap, surfaceStandardMatch, connect=False)
createLightCamera(camera, directional=True, hdri=True, selectLight=True, directionalIntensity=1.0, specularIntensity=0.0, shadowColor=(0.4, 0.4, 0.4), lightCount=1, softAngle=5.0, depthMap=1024, hdriIntensity=0.2, hdriRotate=0.0, surfaceStandardMatch=True, message=True)

Creates the light and contraints it to a camera as the main viewport light.

Parameters:

camera (str) – Camera name as string

safeDelete(attr)

Deletes a zapi node if it is connected to an attribute, passes if None

Parameters:

attr

safeDeleteArray(attr)
deleteLight(deleteMeta=True, message=True)

Deletes the light setup.

Parameters:

deleteMeta (bool) – Delete the meta? False if rebuilding

deleteDirectionalLight()
attr = 'focalAdjusterGrp'
sceneMetaNodes()

Returns all ZooMotionPathRig meta nodes, will delete any metaNodes that are not deemed valid

Parameters:

validMeta (list(ZooViewportLight)) – A list of viewport light meta nodes

metaNodesFromCamera(camera)

Returns meta nodes related to a camera

Parameters:

camera (str) – A camera transform name

cameraVLightMetaNodes()

Finds a camera viewport light in the scene and returns the meta node list

Return metaNodes:

A list of meta node python objects

Rtype metaNodes:

ZooViewportLight

createViewportLight(camera, selectLight=True, directionalIntensity=0.55, specularIntensity=0.0, shadowColor=(0.0, 0.0, 0.0), hdriIntensity=0.14, lightCount=7, softAngle=2.0, surfaceStandardMatch=True, depthMap=1024, setViewportModes=True, message=True)

Creates a viewport light setup.

Parameters:
  • camera (str) – Camera name

  • selectLight (bool) – Select the light after building?

  • directionalIntensity (float) – Set the intensity of the directional light

  • specularIntensity (float) – Set the intensity of the specular light, usually zero.

  • shadowColor (list(float)) – Set the shadow color of the directional light, usually black.

  • hdriIntensity (float) – Set the HDRI intensity

  • lightCount (int) – the amount of directional lights in the soft shadow setup.

  • softAngle (float) – The angle of the soft shadow

  • surfaceStandardMatch (bool) – Match to standardSurface True or lambert/blinn False

  • depthMap (int) – The size of the depth map in pixels ie 1024

  • setViewportModes (bool) – turn on all the viewport modes, lights, AO, textures and shadows.

  • message (bool) – Report messages to the user?

Return metaNode:

A viewport light meta node

Rtype metaNode:

ZooViewportLight

createViewportLightAuto(selectLight=True, directionalIntensity=0.55, specularIntensity=0.0, shadowColor=(0.0, 0.0, 0.0), hdriIntensity=0.14, lightCount=7, softAngle=2.0, surfaceStandardMatch=True, depthMap=1024, setViewportModes=True, message=True)

Creates a viewport light setup and auto assigns to the active camera.

Parameters:
  • selectLight (bool) – Select the light after building?

  • directionalIntensity (float) – Set the intensity of the directional light

  • specularIntensity (float) – Set the intensity of the specular light, usually zero.

  • shadowColor (list(float)) – Set the shadow color of the directional light, usually black.

  • hdriIntensity (float) – Set the HDRI intensity

  • lightCount (int) – the amount of directional lights in the soft shadow setup.

  • softAngle (float) – The angle of the soft shadow

  • surfaceStandardMatch (bool) – Match to standardSurface True or lambert/blinn False

  • depthMap (int) – The size of the depth map in pixels ie 1024

  • setViewportModes (bool) – turn on all the viewport modes, lights, AO, textures and shadows.

  • message (bool) – Report messages to the user?

Return metaNode:

A viewport light meta node

Rtype metaNode:

ZooViewportLight

deleteViewportLights(turnOffLightViewportMode=True)

Deletes all camera viewport lights in the scene

Parameters:

turnOffLightViewportMode (bool) – Turns off the viewport light mode after deleting.

switchCamViewportLights(metaNodes, camera)

Switch a list of light setups to a new camera.

Parameters:
  • metaNodes (list(ZooViewportLight)) – A list of viewport light meta nodes

  • camera (str) – The camera name string

switchCamViewportLightsAuto()

Switch all light setups to the active camera