autorigs.utils package¶
Subpackages¶
- autorigs.utils.rigtoolutils package
- Submodules
- autorigs.utils.rigtoolutils.boneiktwisttool module
- autorigs.utils.rigtoolutils.boneiktwistuserinput module
- autorigs.utils.rigtoolutils.fkcontrols module
- autorigs.utils.rigtoolutils.fkikinterfacecontrol module
- autorigs.utils.rigtoolutils.ikbonestretch module
- autorigs.utils.rigtoolutils.iktwistcontrols module
- autorigs.utils.rigtoolutils.iktwistnaming module
- autorigs.utils.rigtoolutils.iktwistnetworkeditor module
- autorigs.utils.rigtoolutils.iktwisttool module
- autorigs.utils.rigtoolutils.iktwistuserinput module
- autorigs.utils.rigtoolutils.randomnulls module
- autorigs.utils.rigtoolutils.rigutils module
- Module contents
Submodules¶
autorigs.utils.autoRigsBuilderCtrlUtils module¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
axisDifference
(axis)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockAndHide
(node)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockForRCtrl
(node, raxis='xyz')¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockForTCtrl
(node, taxis='xyz')¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockForTRCtrl
(node, taxis='xyz', raxis='xyz')¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockNoPick
(node)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockPS
(node)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockTransform
(node, transform, axis='xyz')¶ Locks the specified axis of the transform
-
autorigs.utils.autoRigsBuilderCtrlUtils.
lockTransformAxis
(node, transform, axis='xyz')¶ Locks the non-specified axis of the transform
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoBoxCtrl
(node, size=0.05)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoCircleCtrl
(node, size=0.15)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoCircleYZCtrl
(node, size=0.15)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoInvisibleCtrl
(node)¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoRCtrl
(nullnode, axis='xyz')¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoTCtrl
(nullnode, axis='xyz')¶
-
autorigs.utils.autoRigsBuilderCtrlUtils.
makeIntoTRCtrl
(nullnode, taxis='xyz', raxis='xyz')¶
autorigs.utils.autoRigsBuilderInterfaceUtils module¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
create01Slider
(key, grp)¶ Creates a 0 to 1 float slider with strict min and max. id: the name/id of the parm, label: the label of the parm, grp: (BuilderGroup) the builder group to create the parm
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
createDisplayTemplate
(namelabel, displaykey, prefix, menulabel)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
createTransformTemplate
(namelabel, prefix, controlname, transform, components=3, defaults=(0, 0, 0))¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
createTransformTemplates
(namelabel, prefix, interface_control_keys, foldertemplate, controls)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
getLabel
(namelabel, controltype)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
getLabelTransform
(namelabel, prefix, controltype, transform)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
getName
(namelabel, prefix, controltype)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
getNamePrefix
(namelabel, index)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
getNameTransform
(namelabel, prefix, controltype, transform)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkDisplay
(assetnode, parm_id, nodesgroup, indexes)¶ Link the display of the controlgroup to autorig display enum parameter. This function will not override existing linking of display to other parameters. assetnode: the autorigs node parm_id: the name of the paramater used in expression nodesgroup: the nodesgroup to link the display to indexes: (Tuples) the indexes of the enum to map the display
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkDisplayTemplate
(controls, controlkeys, assetnode, displayname, displayformat)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkDisplayTemplateFKIK
(controls, controlkeys, assetnode, displayname, displayfkikname, displayformat)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkSwitchTemplate
(controls, controlkeys, assetnode, displayname, displayformat)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkTransformTemplate
(namelabel, assetnode, controls, prefix, controlname, interfacename, transform)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkTransformTemplateObj
(assetnode, control, interface_name, transform)¶ Link the transform parm template interface to the control. assetnode: (hou.Node) the autorigs node, control: (hou.Node) the control with the parameter to be linked, interface_name: (str) the interface/parameter name, transform: (str) the transform to link
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkTransformTemplates
(namelabel, assetnode, controls, prefix, interface_control_keys)¶
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
linkTransformTemplatesObj
(assetnode, interfacename_controls)¶ Link the given transform (t, r, s) parm templates assetnode: (hou.ObjNode) the assetnode with the autorigs interface interfacename_controls: (List) (parmname, rigcontrol, transforms)
-
autorigs.utils.autoRigsBuilderInterfaceUtils.
relativePathChParmTo
(node, relnode, parm)¶
autorigs.utils.autoRigsBuilderNameUtils module¶
-
autorigs.utils.autoRigsBuilderNameUtils.
getInterfaceName
(cls, prefix, key)¶
-
autorigs.utils.autoRigsBuilderNameUtils.
getMatchFKIKFcnName
(cls, prefix)¶
-
autorigs.utils.autoRigsBuilderNameUtils.
getMatchIKFKFcnName
(cls, prefix)¶
autorigs.utils.autoRigsBuilderUtils module¶
This module stores functionality to build bones from nulls for autorigs TODO: This module needs to be refactored. Most of it is copied from ../rigtoolutils/rigutils.py and ../rigtoolutils/iktwisttool.py
-
autorigs.utils.autoRigsBuilderUtils.
addObjControlsToGroup
(controls, group)¶
-
autorigs.utils.autoRigsBuilderUtils.
appendNodeGroups
(src, dest)¶ src: (NodesDataGroup) src data group dest: (NodesDataGroup) dest data group
-
autorigs.utils.autoRigsBuilderUtils.
buildBoneBetweenNulls
(null0, null1, netparent, boneparent, name)¶ Given two nulls, creates a bone between the origins of the two nulls and adds boneparent as the parent of the newly created bone
-
autorigs.utils.autoRigsBuilderUtils.
calculatePlaneNormal
(obj0, obj1, obj2)¶
-
autorigs.utils.autoRigsBuilderUtils.
copyNodeGroup
(src, dest, group_key, src_idx=0, dest_idx=0)¶ Copy the specific node gorup from src builder to dest builder src: (AutoRigsBaseBuilder) src builder dest: (AutoRigsBaseBuilder) dest builder group_key: the key of the group as defined in AutoRigsBaseBuilder
-
autorigs.utils.autoRigsBuilderUtils.
createIKSolverWithBones
(netparent, startbone, endbone, solvername, endcontrol, chopnet=None, chopnetname='KIN_chop')¶ Given a start bone and end bone, creates an chop network with ik solver in it Optional parameters to give an already existing chopnetwork to place solver in
-
autorigs.utils.autoRigsBuilderUtils.
createIKTwistSolverWithBones
(netparent, startbone, endbone, solvername, endcontrol, twistcontrol, chopnet=None, chopnetname='Kin_chop')¶
-
autorigs.utils.autoRigsBuilderUtils.
createNewBoneNonOriented
(obj0, obj1, parent, netparent, name)¶ Given two objs, creates a bone between them in netparent with prefix name such that the position is at obj0 and the end of bone is at obj1. This function also parents the newbone to parent
-
autorigs.utils.autoRigsBuilderUtils.
createNewBoneNonOrientedFromPosition
(pos0, obj1, netparent, name)¶
-
autorigs.utils.autoRigsBuilderUtils.
createNewBoneOriented
(obj0, obj1, normal, boneparent, netparent, name)¶ Given two objs, places a bone in between them such that the bone is positioned at obj0 world and the end of the bone is at obj1 world. The bone is oriented such that its x-axis is aligned with the normal.
- input:
- boneparent - parent of the bone netparent - where to create the bone in the network
this can be used in conjunction with calculatePlaneNormal to get the normal of the plane that three nulls to create a bone orientation plane
-
autorigs.utils.autoRigsBuilderUtils.
createNewBoneOrientedHelper
(obj0, obj1, normal, parent, netparent, name)¶ Given two objs, creates a bone between them in netparent with prefix name such that the position is at obj0 and the end of bone is at obj1. This function also parents the newbone to parent
-
autorigs.utils.autoRigsBuilderUtils.
createNullAtEndOfBone
(bone, name)¶ Creates a null at the end of the bone
-
autorigs.utils.autoRigsBuilderUtils.
createNullAtNode
(node, name)¶ Creates a null at the input node
-
autorigs.utils.autoRigsBuilderUtils.
initSettingsInBonesGroup
(bonegroup)¶
-
autorigs.utils.autoRigsBuilderUtils.
isObjectNode
(node)¶
-
autorigs.utils.autoRigsBuilderUtils.
setAllRestAngles
(node, value)¶
-
autorigs.utils.autoRigsBuilderUtils.
setAllRotateParms
(node, value)¶
autorigs.utils.autoRigsColors module¶
autorigs.utils.buildGuideHelper module¶
-
autorigs.utils.buildGuideHelper.
addAngleParameter
(guide, r_parm, r_range, offset=0, negative=True)¶ Adds an angle parameter to the given guide, and drive the expression for r_parm. The expression is “offset (+ or -) angle” guide: the guide node to add the parameter, r_parm: the rotate parm_name to be driven by the angle, r_range: the hard range for the angle (min, max), offset: offset for the expression, negative: + or -
-
autorigs.utils.buildGuideHelper.
addPoseScope
(node, parm, input_sop=None)¶ Adds posescope to the geo node and point it to parm. node: the node to create the pose scope, parm: the parm name to map the pose scope to, input_sop: a specific input within the node to connect the nodes to
-
autorigs.utils.buildGuideHelper.
copyAllParms
(src, dst)¶ Copies all the values of the parameters from the src node to the dst node.
-
autorigs.utils.buildGuideHelper.
createAndMirrorNode
(node, copyname, display=False, parent=None)¶ Copy and mirror the given node
-
autorigs.utils.buildGuideHelper.
createArrowPicker
(node)¶ Creates an arrow picker sop. node: (objNode) the sop node to create the arrow
-
autorigs.utils.buildGuideHelper.
createGuideLines
(parent, name, src, dests, color=(0, 0, 0), resample=False, segment_multiplier=100)¶ Creates a line point from src to each of the destination nodes. parent: the parent node to create the geometry, name: name of the node, src: the src node, dests: the list of nodes for which to create lines, color: the color of the lines, default is black, resample: whether to resample and make the line dashes, segment_multiplier: the multiplier for segmentation of resampling
-
autorigs.utils.buildGuideHelper.
createNull
(parent_node, name, parent=None, keeppos=False, size=0.05, fxn=None)¶ Create a basic null node(control)
-
autorigs.utils.buildGuideHelper.
createSimpleParentCHOP
(node, parent, maskvalue=None, blendvalue=1, keeppos=False, blendparm=None)¶ Creates a simple parent blend constraint. node: the node to be parented, parent: the parent node, maskvalue: the mask value to apply on the blend, keeppos: whether to keep position
-
autorigs.utils.buildGuideHelper.
deleteGuides
(nodesdata)¶
-
autorigs.utils.buildGuideHelper.
displayGuides
(nodesdata, display)¶
-
autorigs.utils.buildGuideHelper.
lockGuide
(guide, lock)¶
-
autorigs.utils.buildGuideHelper.
lockGuideData
(guidedata, lock)¶
-
autorigs.utils.buildGuideHelper.
lockGuides
(nodesdata, lock)¶
-
autorigs.utils.buildGuideHelper.
makeNonRenderable
(geo_node)¶ Make the geo node not renderable
-
autorigs.utils.buildGuideHelper.
makeReferenceCopy
(node, copyname, display=False, parent=None)¶
-
autorigs.utils.buildGuideHelper.
makeTransformParamReferences
(node, newnode)¶ Set mirrored transform references for the newnode
-
autorigs.utils.buildGuideHelper.
mirrorNode
(src, dest, display=False)¶ Mirror the src node on to the dest node src: source node dest: mirrored node display: whether to display the mirrored node
-
autorigs.utils.buildGuideHelper.
mirrorNodes
(src_list, dest_list)¶ Mirror all the src nodes in a list
-
autorigs.utils.buildGuideHelper.
setPosition
(node, xyztuple)¶
-
autorigs.utils.buildGuideHelper.
setRotation
(node, xyztuple)¶
-
autorigs.utils.buildGuideHelper.
setTRSPNodeParms
(src, dst)¶
-
autorigs.utils.buildGuideHelper.
toJSON
(nodesdata)¶
-
autorigs.utils.buildGuideHelper.
updateMirror
(nodesdata, value)¶
-
autorigs.utils.buildGuideHelper.
updateSide
(nodesdata, mirrornodesdata, value)¶
autorigs.utils.fkcontrols module¶
TODO This is copied from ../rigtoolutils/fkcontrols.py and modified to remove the stretch
-
autorigs.utils.fkcontrols.
createFKControls
(nameslist, startbone, endbone, inchain=False)¶ Creates FK controls for each bone from start bone to end bone with the name prefix + ‘fkcontrol’
required type: nameslist should be in reverse order of the bone chain inchain specifies whether the fk controls should be part of the bone chain or off to the side
autorigs.utils.guideOptionsHelper module¶
-
autorigs.utils.guideOptionsHelper.
createToggleButtonsWidget
(label, buttonlabels, default_checked_idx, onbuttonclicked=None)¶
autorigs.utils.guideParamsHelper module¶
-
autorigs.utils.guideParamsHelper.
createParamWidget
(paramobj, paramwidget_dst=None, label=True)¶
-
autorigs.utils.guideParamsHelper.
createScrollLayout
(widget)¶ Creates a borderless scroll layout for the given widget
-
autorigs.utils.guideParamsHelper.
fromJSON
(json, widgets)¶
-
autorigs.utils.guideParamsHelper.
getEditableGuideObj
(label, nodes, params)¶
-
autorigs.utils.guideParamsHelper.
hasUnsavedChanges
(widgets)¶
-
autorigs.utils.guideParamsHelper.
markSaved
(widgets)¶
-
autorigs.utils.guideParamsHelper.
setParamWidget
(widget, value)¶
-
autorigs.utils.guideParamsHelper.
toJSON
(widgets)¶
-
autorigs.utils.guideParamsHelper.
unlinkParmWidgetDict
(paramdict)¶
-
autorigs.utils.guideParamsHelper.
unlinkParmWidgetList
(paramwidgets)¶
autorigs.utils.iktwistcontrols module¶
TODO This is copied from ../rigtoolutils/iktwistcontrols.py and modified to have postdict
-
autorigs.utils.iktwistcontrols.
createControlsWithBones
(hastwist, startbone, endbone, parent, prefix, postdict)¶ Given hastwist = False (ik control) or hastwist = True (ik twist control) adds the controls to the given bone chain. Assumes that endbone is in the same chain as the start_bone. The parent is the parent of the whole structure. The prefix is the prefix name. postfix is a dictionary of values for the names
- Required values for postdict are:
- end - endaffector for the bones endhook - endcontrol for the end affector chopnet - chopnet that stores all the inversekin chops. Not necessary if one is provided iksolver - inversekin solver
- if hastwist is true:
- twist = twistaffector for the bones twisthook - twistcontrol for the twist affector
-
autorigs.utils.iktwistcontrols.
createIKControl
(startbone, endbone, parent, netparent, prefix, postdict, chopnet)¶ Creates a new chopnet and assigns the IK controls to all bones between start bone and end bone Assumes that startbone is parent and endbone is a child of the parent
-
autorigs.utils.iktwistcontrols.
createIKWithTwistControl
(startbone, endbone, parent, netparent, prefix, postdict, chopnet, rigscale)¶ Similar to createIKControl but also adds a twist affector
-
autorigs.utils.iktwistcontrols.
createName
(prefix, postdict, key)¶
autorigs.utils.rigutils module¶
TODO This is copied from rigutils.py
-
autorigs.utils.rigutils.
buildBoneBetweenNulls
(null0, null1, netparent, boneparent, name)¶ Given two nulls, creates a bone between the origins of the two nulls and adds boneparent as the parent of the newly created bone
-
autorigs.utils.rigutils.
createNullAtEndOfBone
(netparent, bone, name)¶ Creates a null at the end of the bone
-
autorigs.utils.rigutils.
createNullAtNode
(netparent, node, name)¶ Creates a null at the input node
-
autorigs.utils.rigutils.
createNullHookForNode
(netparent, node, name)¶ Creates a null parent for the node
-
autorigs.utils.rigutils.
getAverageBoneChainLength
(startbone, endbone)¶
-
autorigs.utils.rigutils.
getFKControl
(bone)¶
-
autorigs.utils.rigutils.
getRandomColor
()¶
-
autorigs.utils.rigutils.
getTotalBoneChainLength
(startbone, endbone)¶ Returns (totalbonelength, numberofbones) from start bone to end bone inclusive
-
autorigs.utils.rigutils.
isChildConnectedToParent
(child, parent)¶ Returns whether child is connected to parent Returns true if child is parent
-
autorigs.utils.rigutils.
lockAllPivotParms
(node, value=True)¶
-
autorigs.utils.rigutils.
lockAllRotateParms
(node, value=True)¶
-
autorigs.utils.rigutils.
lockAllScaleParms
(node, value=True)¶
-
autorigs.utils.rigutils.
lockAllTranslateParms
(node, value=True)¶
-
autorigs.utils.rigutils.
numNodesFromChildToParent
(child, parent)¶ Returns number of nodes from child to parent or until it reaches the end of the chain if child is not connected to parent
-
autorigs.utils.rigutils.
setAllRestAngles
(node, value)¶
-
autorigs.utils.rigutils.
setAllRotateParms
(node, value)¶
-
autorigs.utils.rigutils.
setAllTranslateParms
(node, value)¶
-
autorigs.utils.rigutils.
setDisplayColor
(node, color)¶
-
autorigs.utils.rigutils.
setWireframeColorExpression
(colorobj, refobj, refparm)¶ Sets the dcolorr/g/b of colorobj to be referenced to refobj/refparmrgb