autorig package¶
Submodules¶
autorig.isbodypart module¶
-
autorig.isbodypart.
isAnimationRigPart
(node)¶
-
autorig.isbodypart.
isAutoRigPart
(node)¶
-
autorig.isbodypart.
isAutoRigPlacer
(node)¶
-
autorig.isbodypart.
isDeformRigPart
(node)¶
autorig.mocapbodypart module¶
-
class
autorig.mocapbodypart.
MocapBodyPart
(parttype, mocappart=None, otherpart=None)¶ Create an object that stores data for a Mocap body part asset.
A MocapBodyPart stores links to Houdini assets, parameters, and series of position and control mappings.
-
addLength
(length)¶ Add a length to the list of bone lengths.
-
addMapPoint
(point)¶ Add a single map point to the list.
-
animControls
()¶ Returns a list of animation rig control object names.
-
autoControls
()¶ Returns a list of auto rig control object names.
-
channels
()¶ Get the list of corresponding animation channels.
-
extraPositions
()¶ Returns a nodes extra position locations.
-
initializeRootMap
(point)¶ Take a point string and insert it to be the first map point and add the ‘root’ map location to the list.
-
insertMapLocation
(toadd, index)¶ Insert a location into the list of Map Locations at a specific position.
-
insertMapPoint
(index, point)¶ Insert a single map point into the list at a specific location.
-
lengths
()¶ Returns the list of bone lengths.
-
mapLocations
()¶ Return a list of the map locations.
-
mapPoints
()¶ Return the list of Map Points.
-
mocapPart
()¶ Return an object representing the physical mocap rig node.
-
modifyMapPoint
(index, point)¶ Change a Map Point in place.
-
name
()¶ Return the name of the body part.
-
otherPart
()¶ Return an object representing the corresponding animation rig node.
-
parmNames
()¶ Returns a list of parameter names.
-
parms
()¶ Returns the list of parameters.
-
resetMapLocations
()¶ Set the Map Locations back to the default values for this type of mocap object.
-
setMapPoints
(points)¶ Set the Map Points to a list of specified locations.
-
setParmNames
(parms)¶ Set the list of parm names.
-
setPretransforms
()¶ Set the pretransforms of the mocap body part to the positions of the controls from the corresponding auto rig part.
-
skipFirstMap
()¶ Returns wether a node should skip the first map point.
-
twistExtra
()¶ Returns an objects extra twist information.
-
twistTarget
()¶ Returns a parts custom twist target.
-
type
()¶ Return the type of the object as a string.
-
useEnd
()¶ Returns whether a part uses End.
-
useTwist
()¶ Returns whether a part uses a custom twist.
-
autorig.mocapgui module¶
-
class
autorig.mocapgui.
EmitPushButton
(text, lineedit)¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
emitSignal
()¶
-
getLineEdit
()¶
-
-
class
autorig.mocapgui.
MocapGui
(mocapobjects)¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
center
()¶
-
doAccept
()¶
-
loadFile
(filename=None)¶
-
pickBone
(button)¶
-
saveFile
()¶
-
setSuccess
(success)¶
-
wasSuccess
()¶
-
-
autorig.mocapgui.
createMapGui
(skeleton, mocapobjects)¶
-
autorig.mocapgui.
createThreadedGui
(skeleton, mocapobjects)¶
-
autorig.mocapgui.
waitForGuiStartNotification
()¶
autorig.mocappartmapping module¶
autorig.mocaprigutils module¶
-
exception
autorig.mocaprigutils.
MessageError
¶ Bases:
exceptions.Exception
-
autorig.mocaprigutils.
calculateScaleOffset
(skeleton)¶ Calculate the scale to offset the translates of the root null. The scale is based on the height of the COG minus the low bound of the objects bounding box.
-
autorig.mocaprigutils.
checkForCOGBone
(skeleton, mocapobjects)¶ Check to determine if a COG bone needs to be created.
-
autorig.mocaprigutils.
chopsToKeys
(node)¶ Convert channels with chop() expressions to raw keyframes.
-
autorig.mocaprigutils.
configureMocapRigs
(mocappart, skeleton)¶ Setup all the parameters and modify any skeleton parts to correctly initialize the mocap object and skeleton.
-
autorig.mocaprigutils.
createCOG
(skeleton, root, legs)¶ Create a bone that will act as the COG.
-
autorig.mocaprigutils.
createDialog
(rigasset, mocapobjects, acceptfunctionname)¶ Create a Mocap Dialog node.
A Mocap Dialog node is a temporary ass that is used in the mapping process.
-
autorig.mocaprigutils.
createEndTarget
(mocapobject, bone, name)¶ Create a target null that is attached to a bone that can be used to fetch transforms from.
-
autorig.mocaprigutils.
createMocap
(*args, **kwargs)¶ Create a Mocap rig from an animation rig and an animated skeleton.
-
autorig.mocaprigutils.
createMocapNodes
(mocaprig, animationrigparts)¶ Create mocap body part assets in the mocap rig network.
-
autorig.mocaprigutils.
createMocapRig
(sourcerig, skeleton)¶ Create a motion capture rig from an animation rig and an animated skeleton.
-
autorig.mocaprigutils.
createRootNull
(skeleton)¶ Create a root null that is used for transforming for an imported mocap skeleton.
Find the current root null by searching the rigs children for any nodes with 0 inputs(start of hierarchy). If more than one is found, try and look for the name ‘root’. If not found, display a message that we are skipping this step.
-
autorig.mocaprigutils.
createTwist
(bone, name, moveToEnd=False)¶ Create a twist effector for an IK solver.
-
autorig.mocaprigutils.
doAutoRigSet
()¶ Setup an Auto Rigs control positions to the location of bones of a skeleton.
-
autorig.mocaprigutils.
doCheck
(bone, bones)¶ Check a bone to see if there are any bones attached to its input.
If there are bones attached to its input and they are not in the list of bones, set these bones lengths to be the equivalent of the lengths of the bone and any copy bones.
-
autorig.mocaprigutils.
doMocapModify
()¶ Do the modification of the skeleton and setting of the Mocap objects parameters when creating a rig from an animation rig.
-
autorig.mocaprigutils.
doRefit
(node, tolerance)¶ Refit all the channels on a node by the given tolerance.
-
autorig.mocaprigutils.
duplicateBones
(mappoints, skeleton)¶ Create copy bones when multiple map points are mapped to the same bone.
-
autorig.mocaprigutils.
getDistance
(source, target)¶ Calculate the distance between two objects.
-
autorig.mocaprigutils.
modifyMocapSkeleton
(skeleton, mocapobjects)¶ Modify the skeleton so that we can map to it.
-
autorig.mocaprigutils.
modifyScaleOffset
(skeleton)¶ Set the scale offset parameter on the mocap rig.
-
autorig.mocaprigutils.
modifySkeletonNetwork
(skeleton)¶ Transform a skeleton subnetwork into a digital asset.
-
autorig.mocaprigutils.
readOpscript
(*args, **kwargs)¶ Apply animation from a file.
-
autorig.mocaprigutils.
reformatMessageErrors
(function)¶ This function decorator catches MessageError exceptions and displays a message in the UI when they occur.
-
autorig.mocaprigutils.
setAutoRigPositions
(autorignode, skeleton)¶ Create Mocap Bodypart objects for use when setting the position of the Auto Rig controls to the locations of a skeleton.
-
autorig.mocaprigutils.
setChopChannels
(mocapparts)¶ Set parameters on the animation rig to be chop expressions that get their values from the correct chop and channels.
-
autorig.mocaprigutils.
setControlScale
(mocapparts, skeleton)¶ Set the control scale to be the scale of the root.
-
autorig.mocaprigutils.
setMocapParms
(mocapobjects)¶ Set the parameters on the mocap rig parts.
-
autorig.mocaprigutils.
setupScaleOffset
(skeleton)¶ Setup the parameters of the skeleton to use the scale offset.
-
autorig.mocaprigutils.
skeletonSelect
(*args, **kwargs)¶ Selection function to select a skeleton subnet.
-
autorig.mocaprigutils.
writeOpscript
(*args, **kwargs)¶ Write out a file with the opscript necessary to recreate the keys.
autorig.rigtoolutils module¶
-
autorig.rigtoolutils.
checkForMove
(rignode)¶ Check to see if the body part should be moved on creation.
-
autorig.rigtoolutils.
createAutoRig
(scriptargs)¶ Creates an Auto Rig asset from a selection of Auto Rig body parts.
-
autorig.rigtoolutils.
genericAutorigTool
(scriptargs, nodetypename, prompts=('hook object', ))¶ Create an Auto Rig body part.
If invoked from a Scene Viewer, prompt to connect the part to any hook point of another existing body part.
-
autorig.rigtoolutils.
getCharacterPlacer
(rignode, hook)¶ Traverse the connection hierarchy looking for a Character Placer to connect to.
-
autorig.rigtoolutils.
getHook
(node)¶ Traverse a nodes outputs looking for a valid hook object.
-
autorig.rigtoolutils.
hasName
(name, node)¶ Indicate whether a nodes name contains a specific string
-
autorig.rigtoolutils.
moveNodes
(rignode, initialposition, newposition)¶ Reposition controls of a node to a new position.
-
autorig.rigtoolutils.
reconnectPart
(scriptargs)¶ Reconnect and reposition a body part to the skeleton.
-
autorig.rigtoolutils.
selectionPrompt
(elementtype)¶ Create a selection prompt for connecting body parts.
-
autorig.rigtoolutils.
updateLayer
(rignode, hook)¶ Set the layer of a new autorig part.
Check the layer parameter value of the body part that is being connected to and make sure the new part has its layer set to a value that is at least 1 greater than the hook target.
autorig.utils module¶
-
exception
autorig.utils.
MessageError
¶ Bases:
exceptions.Exception
-
autorig.utils.
alertIfMissingName
(node, required_name)¶
-
autorig.utils.
checkFileForDefinition
(file_path, definition_name)¶ Check an otl file for a definition that matches the supplied name.
-
autorig.utils.
checkSymOverride
(auto_rig_part)¶ Check a body part for the symmetry_override parameter. If the parameter is found, check to see if it is on. If it is on, return True. If it is not, continue up the hierarchy looking for a body part that has it enabled. If not found, return False.
-
autorig.utils.
compareNodes
(part_1, part_2, count=0)¶ Sort rig nodes by body part type. If the parts are the same type, try sorting by positions.
-
autorig.utils.
copyHooks
(animation_rig_part, auto_rig_node, replace_hooks=False)¶ Copy the hook object paths from the auto rig to the new animation rig node. If “True” is passed to “replace”, swap “left” and “right” in the path if found.
-
autorig.utils.
copyHoudiniRig
(auto_rig, file_path, delete_original)¶ Copy the asset definition from the Houdini libraries to the otl file that contains the Animation and Deform rigs, deleting the original rig node if specified.
-
autorig.utils.
createAnimationPart
(auto_rig_part, animation_rig)¶ Create and setup an Animation bodypart based on an Auto Rig part.
-
autorig.utils.
createAnimationProxySection
(auto_rig, animation_rig)¶ Create an extra Proxy section in an Animation rig that contains a dictionary with all the proxy control parameter values.
-
autorig.utils.
createAnimationProxySource
(animation_rig)¶ Creates a network that reads in the proxy geometry file for the animation rig.
-
autorig.utils.
createAnimationRig
(*args, **kwargs)¶ Create an Animation Rig asset based on an Auto Rig.
-
autorig.utils.
createAutoRig
(*args, **kwargs)¶ Create Auto Rig asset based on a list of body parts.
-
autorig.utils.
createAutoRigDialog
(children, rig_definition)¶ Create the dialog script for a custom Auto Rig.
-
autorig.utils.
createAutoRigFromAnimationRig
(animation_rig)¶ Create an Auto Rig from an Animation Rig.
-
autorig.utils.
createAutoRigSourceGeo
(auto_rig)¶ Create source geometry for an Auto Rig.
The source geometry network consists of an Object Merge and a File SOP combined together with a switch to toggle the source.
If “proxy_display_geometry” == 2 (Proxy Groups), the source geo is not displayed.
-
autorig.utils.
createDeformPart
(deform_rig, animation_part, auto_rig)¶ Create and setup a Deform body part.
-
autorig.utils.
createDeformRig
(*args, **kwargs)¶
-
autorig.utils.
createDeformSkin
(deform_rig, auto_rig)¶ Creates the deform skin network.
-
autorig.utils.
createDialog
(rig_parts, dialog_script, parm_type, folder_name, token, extra)¶ Create a section of Dialog Script code for a certain set of parameter types.
-
autorig.utils.
createGeoContainer
(root_node, node_name)¶ Create an empty Geometry object.
-
autorig.utils.
createProxyExport
(auto_rig)¶ Create the Proxy Geometry Export network.
The proxy geometry is object merged from each body part. A delete node is added and is used to delete overlapping primitives. The group field of the delete is set by “writeProxy()” in the rig’s python module. The resulting proxy geometry is then written to disk using a ROP Output Driver.
-
autorig.utils.
doSearch
(capture_node, deform_node, use_bone_deform)¶ For a deform asset, get the proper sop representation that should be used for the deform path.
-
autorig.utils.
executeProxyWrite
(auto_rig)¶ Execute the render button on the ROP output to write out the proxy.
-
autorig.utils.
finishAsset
(auto_rig, rig_definition)¶ Cleanup actions for an asset.
-
autorig.utils.
getDeformNodes
(use_bone_deform, capture_node, deform_rig_parts)¶ Iterate through a list of body parts looking for deform type nodes to add to the capture.
-
autorig.utils.
getDialog
(rig_parts, parm_type, folder_name='', token='', extra='', group=False)¶ Create a group of specific type of dialog parameters for a list of nodes.
-
autorig.utils.
getIconType
(rig_parts)¶ Check the body parts to determine which rig icon is suitable.
-
autorig.utils.
isHDA
(node)¶ Determine if a node is an HDA by checking for a nodeType definition.
-
autorig.utils.
isType
(type_list, node)¶ Determine if a node is a specific type by checking string(s) against the type name of a node. If type_list is a tuple, check against each type in the tuple.
-
autorig.utils.
linkAutoRigParms
(children, auto_rig)¶ Links parameters on Auto Rig body parts to the auto rig asset.
-
autorig.utils.
matchRig
(auto_rig)¶ Matches the positions of auto rig armature and proxy controls with those of the specified animation rig. The opposite of modifyRig.
-
autorig.utils.
modifyDialogScript
(dialog_script, parm_type, part_name, folder_name='', token='', extra='')¶ Modify a template parameter dialog with the tokens we choose.
-
autorig.utils.
modifyRig
(auto_rig)¶ Modify the positions of an Animation Rig to those of an Auto Rig.
-
autorig.utils.
parseDialog
(dialog_script, dialogs_dictionary)¶ Uses a supplied dictionary to add in entries to the dialog script.
A source dictionary is layed out as follows:
target: dialog code e.g. “ADD ANIMATION”: “a sting containing dialog code”
For each key in the dictionary, the value is added in at the target location and the full dialog is returned. If the target cannot be found, it is skipped.
-
autorig.utils.
performModification
(autorig_part, animation_part, symmetry=False)¶ Do the modification to match the Animation part with the Auto Rig part.
All parameters will be reverted to default before modification, create temporary variables to hold parameter values that should be kept. These include custom control spaces, control colors, and sides.
-
autorig.utils.
positionProxy
(animation_part)¶ Calculates the transforms required to properly align proxy geometry with the animation rig part.
-
autorig.utils.
prepForAsset
(auto_rig)¶ Evaluate the source node to setup names and paths for asset creation.
-
autorig.utils.
reformatMessageErrors
(function)¶ This function decorator catches MessageError exceptions and displays a message in the UI when they occur.
-
autorig.utils.
setAnimationDefaults
(animation_part)¶ For any parameter that is in the “Animation” folder on the bodypart, revert it to defaults if it is autoscoped.
-
autorig.utils.
setProxyToEmbedded
(*args, **kwargs)¶ Set an Animation rig to look to itself for proxy.
-
autorig.utils.
setupAnimationTool
(animation_rig)¶ Modify the default tool for Animation Rig nodes so they can be placed interactively.
-
autorig.utils.
sortByLayer
(part_1, part_2)¶ Sort a list of nodes based upon a nodes “layer” parameter.
-
autorig.utils.
splitTypes
(rig_parts, dialog_script, parm_type, token, extra)¶ Separate pieces into similar group folders.
-
autorig.utils.
updateDeformRigCapturePose
(auto_rig, auto_rig_parts, animation_rig)¶ Update the deform rig capture pills
-
autorig.utils.
wrapFolder
(dialog_script, tab_name, folder_name, folder_dialog)¶ Wrap a dialog script string with a folder parameter string.
-
autorig.utils.
writeManualProxy
(*args, **kwargs)¶ Execute a writing out of the proxy geometry.
Execute a hou.Parm.pressButton() on the “Render” button of the proxy output rop.
If the file path is empty or no proxy is diplayed, display a message and quit.
-
autorig.utils.
writeProxyToEmbedded
(auto_rig, animation_rig)¶ Creates proxy embedded into the Animation rig.
If the proxy display is set to “None”, change it to “Bounding Geometry” and write out the proxy; changing it back afterwards.