asNode

Contents

asNode#

_images/as_Node.jpg

asNode Features

:Advanced Node Based Scripting:

The asNode module appears to be a custom Python module designed to support main auto rig scripts in VFX, particularly in Autodesk Maya, given your background in automation for VFX and Python tool development. Here are a few potential uses or features of the asNode module, based on the context and purpose mentioned in the file:

  1. Rigging Automation: The asNode module might be designed to streamline the rigging process in 3D models, possibly by automating repetitive tasks or by providing a framework for rig setup.

  2. Node Management: It could offer functionalities for managing and manipulating nodes within Autodesk Maya, which is a crucial aspect of rigging and animation.

  3. Scripting Support: The module likely provides support for scripting in Maya, enabling more efficient and programmable control over rigging elements.

  4. Custom Rigging Tools: It may include functions or classes that help in creating custom rigging tools, tailored to specific needs in animation and character setup.

  5. Integration with Maya’s API: The module probably integrates closely with Maya’s API, offering a more streamlined and Pythonic way to interact with Maya’s complex system.

  6. Enhanced Workflow Efficiency: By automating certain aspects of rigging, asNode could significantly enhance workflow efficiency, reducing manual labor and increasing productivity.

  7. User-Friendly Interface: It might include a user-friendly interface or functions that simplify complex Maya operations, making it more accessible to artists who might not be deeply familiar with programming.

asNode._MBoundingBox(self)#

[shArgs : ]

Purpose:

:: Returns the Instance of Maya API node : MBoundingBox.

Returns:

<MBoundingBox> #Instance of Maya API node MBoundingBox.

asNode._MDagPath(self, mObj=None, **shArgs)#

[shArgs : mo=mObj]

Purpose:

:: Returns the instance of Maya API node MDagPath.

Parameters:

mObj – <MObject, optional> #MObject to get the MDagPath for. If None, gets the MDagPath of the current node.

Returns:

<MDagPath> #Instance of Maya API node MDagPath.

asNode._MFnDagNode(self, mObj=None, toShapeNode=False, **shArgs)#

[shArgs : mo=mObj, ts=toShapeNode]

Purpose:

:: Returns the instance of Maya API node MFnDagNode.

Parameters:
  • mObj – <MObject, optional> #MObject to get the MFnDagNode for. If None, gets the MFnDagNode of the current node.

  • toShapeNode – <bool, optional> #If True, gets the shape node. Default is False.

Returns:

<MFnDagNode> #Instance of Maya API node MFnDagNode.

asNode._MFnDependencyNode(self, mObj=None, **shArgs)#

[shArgs : mo=mObj]

Purpose:

:: Returns the instance of Maya API node MFnDependencyNode.

Parameters:

mObj – <MObject, optional> #MObject to get the MFnDependencyNode for. If None, gets the MFnDependencyNode of the current node.

Returns:

<MFnDependencyNode> #Instance of Maya API node MFnDependencyNode.

asNode._MFnMesh(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MFnMesh.

Returns:

<MFnMesh> #Instance of Maya API node MFnMesh.

asNode._MFnNurbsCurve(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MFnNurbsCurve.

Returns:

<MFnNurbsCurve> #Instance of Maya API node MFnNurbsCurve.

asNode._MFnNurbsSurface(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MFnNurbsCurve.

Returns:

<MFnNurbsCurve> #Instance of Maya API node MFnNurbsCurve.

asNode._MFnTransform(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MFnTransform.

Returns:

<MFnTransform> #Instance of Maya API node MFnTransform.

asNode._MItMeshEdge(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MItMeshEdge.

Returns:

<MItMeshEdge> #Instance of Maya API node MItMeshEdge.

asNode._MItMeshPolygon(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MItMeshPolygon.

Returns:

<MItMeshPolygon> #Instance of Maya API node MItMeshPolygon.

asNode._MItMeshVertex(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MItMeshVertex.

Returns:

<MItMeshVertex> #Instance of Maya API node MItMeshVertex.

asNode._MObject(self)#

[shArgs : ]

Purpose:

:: Returns the instance of Maya API node MObject.

Returns:

<MObject> #Instance of Maya API node MObject.

asNode.__init__(self, obj, attrSup=0, **shortArgs)#

Search Method (Eclipse)#

^(?!.*eRig).*.nearestObj.*$ #_ Use case sensitive and regular expression options

To Support main auto rig scripts via asNode

Module Name :#

asNode_v1.5

About :#

Author: (Subbaiah) Subbu Addanki Character Supervisor (Rigging) & Programmer

Visit :#

http://www.pythonscripting.com http://subbuadd.blogspot.com

Contact :#

Mail Id: subbu.add@gmail.com

Compiled Only For:#

** Python Scripting Users. Compiled version only. **

asNode._about_asNode(self)#

[shArgs : ]

Purpose:

:: Placeholder for providing information about the asNode instance.

Returns:

None #No return value.

asNode._appendTo(self, listVar, **shArgs)#

[shArgs : lv=listVar]

Purpose:

:: Appends the asNode to any Python list variable.

Parameters:

listVar – <list> #The list variable to append the asNode to.

Returns:

None #No return value.

asNode._asget(self, attr, **shArgs)#

[shArgs : a=attr]

Purpose:

:: Placeholder for a method to get attribute value from the asNode.

Parameters:

attr – <str> #Attribute name to get the value from.

Returns:

None #No return value.

asNode._asset(self, attr, attrVal=0, **shArgs)#

[shArgs : a=attr, av=attrVal]

Purpose:

:: Placeholder for a method to set an attribute value on the asNode.

Parameters:
  • attr – <str> #Attribute name to set the value for.

  • attrVal – <float, optional> #Value to set for the attribute, default is 0.

Returns:

None #No return value.

asNode._compileAsNode(self, userFolder='asNode', **shArgs)#

[shArgs : uf=userFolder]

Purpose:

:: Placeholder for a method to compile the asNode.

Parameters:

userFolder – <str, optional> #Folder to compile the asNode in, default is ‘asNode’.

Returns:

None #No return value.

asNode._computeTime(self, killTime=False, **shArgs)#

[shArgs : kt=killTime]

Purpose:

:: Returns the computation time for a process related to the asNode.

Parameters:

killTime – <bool, optional> #If True, stops the time computation. Default is False.

Returns:

<list> #A list containing the computation time in hours, minutes, and seconds, and a formatted string.

[[progressHour, progressMinute, progressSecond], ‘%dHr %dMin %dSec’ % (progressHour, progressMinute, progressSecond)]
For Ex, Returns:
[[0, 10, 25], ‘0Hr 10Min 25Sec’]

asNode._confirmAction(self, action, raiseErr=False, **shArgs)#

[shArgs : a=action, re=raiseErr]

Purpose:

:: Placeholder for a method to confirm an action related to the asNode.

Parameters:
  • action – <str> #Action to confirm.

  • raiseErr – <bool, optional> #If True, raises an error on confirmation failure.

Returns:

None #No return value.

asNode._error(self, errorMsg, **shArgs)#

[shArgs : em=errorMsg]

Purpose:

:: Sends a given error message through a confirmDialog window in Autodesk Maya. After closing the window, a RuntimeError will be raised. This function is used for error handling and user notifications.

Parameters:

errorMsg – <str> #The error message to be displayed in the confirmDialog window.

Returns:

<None> #No return value, but triggers a RuntimeError after displaying the message.

asNode._extractNumStr(self, nameStr, fromEnd=True, skipCount=0, **shArgs)#

[shArgs : ns=nameStr, fe=fromEnd, sc=skipCount]

Purpose:

:: Extracts a number from a string, typically used for processing node names in Maya that include numerical suffixes. This function is particularly useful in renaming or iterating through a series of similarly named nodes.

Parameters:
  • nameStr – <str> #The string from which the number is to be extracted.

  • fromEnd – <bool> #Determines whether to extract the number from the end of the string.

  • skipCount – <int> #The number of characters to skip before starting the extraction.

Returns:

<list> #Returns a list containing the extracted number and the remaining part of the string.

return [num, numStr]
#_ the extracted number from end of the object name

Usage:

obj.vtx[105] # Returns 105 obj.e[206] # Returns 206

asNode._fullName(self, **shArgs)#

[shArgs]

Purpose:

It is useful whenever world space calculations are made. :: Retrieves the full path name of the asNode, from the root to the node itself.

  • This function is essential for accurate node identification in complex Maya scenes

  • where multiple nodes might have similar or identical short names.

Returns:

<str> #The complete path name from the root to the asNode. MFnDagNode.fullPathName() #_ Complete path name from root to asNode

asNode._getAttr(self, attr, *args, **kwargs)#

[shArgs : a=attr]

Purpose:

:: Retrieves the value of a specified attribute from an asNode. This function is used for dynamic attribute access within scripts and automations.

Parameters:

attr – <str> #The name of the attribute to be retrieved from the asNode.

Returns:

<various> #Returns the value of the specified attribute, with the type dependent on the attribute’s data type.

asNode._getCtrl(self, ctrlName='as_Node_Ctrl', grpLevel=2, initRot=[0, 0, 0], ctrlType=1, grpSufxList=None, **shortArgs)#

[shArgs : cn=ctrlName, gl=grpLevel, ir=initRot, ct=ctrlType, gsl=grpSufxList]

Purpose:

:: Creates a control node (typically for rigging purposes) with specified parameters like name, group level, initial rotation, and control type. This function streamlines the control creation process in rigging workflows.

Parameters:
  • ctrlName – <str> #Name for the control to be created.

  • grpLevel – <int> #Number of top groups on the control.

  • initRot – <list> #Initial rotation values for the control’s shape.

  • ctrlType – <int> #Type of control shape to create (e.g., 1 for single circle, 2 for dual circle).

  • grpSufxList – <list, optional> #Optional list of suffixes for the control’s groups.

Returns:

<list> #Returns a list containing the created control and its top group as asNodes.

Usage:#

ctrl =eCtrl.circleCtrl(ctrlName)[0] ctrlGrp =eCtrl.circleCtrl(ctrlName)[-1] ctrl, ctrlGrp =eCtrl.circleCtrl(ctrlName)

Returns:#

if grpLevel:

return [ctrl, ctrlGrp(topGrp)] #_ asNodes

else:

return [ctrl, ctrl] #_ asNodes

asNode._getFilePath(self, fileName=None, **shArgs)#

[shArgs : fn=fileName]

Purpose:

:: Retrieves the file path for a specified file within the Maya environment. This function is useful for accessing and managing file paths dynamically during scripting.

Parameters:

fileName – <str, optional> #The name of the file for which the path is to be retrieved. If not provided, a default or current file path may be used.

Returns:

<str> #The full file path of the specified file.

asNode._getLoc(self, snapTo=None, snapRot=None, locName='as_Node_Loc', **shortArgs)#

[shArgs : sn=snapTo, sr=snapRot, ln=locName]

Purpose:

:: Creates a locator in Autodesk Maya, optionally snapping it to a target object or position. This function is often used in rigging and scene setup for creating reference points or markers.

Parameters:
  • snapTo – <str, optional> #Target object or position to snap the locator to.

  • snapRot – <str, optional> #Target object or position to snap the locator’s rotation to.

  • locName – <str> #Name for the newly created locator.

Returns:

<asNode> #The newly created locator as an asNode.

asNode._isNum(self, obj, **shArgs)#

[shArgs : o=obj]

Purpose:

:: Determines whether the specified object is a number. This function is useful for validating data types in scripts that require numerical input.

Parameters:

obj – <various> #The object to be checked for being a number.

Returns:

<bool> #Returns True if the object is a number, otherwise False.

asNode._isPosList(self, posList, **shArgs)#

[shArgs : pl=posList]

Purpose:

:: Checks if the given list represents a position in 3D space, containing three numerical coordinates. This function is key in scripts dealing with spatial calculations or transformations.

Parameters:

posList – <list> #A list of three numbers representing a position in 3D space.

Returns:

<bool> #Returns True if the list represents a valid 3D position, otherwise False. if posList is like [1, 3, 10.5] | [0.1, 10, 9.5] | [0, 0, 0] | (0, 10, 5): return True else: return False

asNode._isTrans(self)#

[shArgs]

Purpose:

:: Determines if the current asNode is a transform node in Maya.

  • This function is crucial for scripts that need to differentiate between transform nodes and other types of nodes.

Returns:

<bool> #Returns True if the asNode is a transform node, otherwise False.

asNode._mayaVer(self)#

[shArgs]

Purpose:

:: Retrieves the current version of Autodesk Maya in which the script is running.

  • This function is essential for ensuring compatibility and for scripts that might behave differently across Maya versions.

Returns:

<str> #The version number of the currently running Autodesk Maya.

asNode._mean(self, aList, **shArgs)#

[shArgs : al=aList]

Purpose:

:: Calculates the mean (average) of a list of numbers.

  • This function is commonly used in operations involving data analysis or when averaging values is required in a script.

Parameters:

aList – <list> #A list of numbers for which the mean is to be calculated.

Returns:

<float> #The mean of the numbers in the provided list.

asNode._message(self, messageTxt, **shArgs)#

[shArgs : mt=messageTxt]

Purpose:

:: Displays a given message through a confirmDialog window in Autodesk Maya. This function is useful for providing information, alerts, or confirmations to the user.

Parameters:

messageTxt – <str> #The message text to be displayed in the confirmDialog window.

Returns:

<None> #No return value, displays a message in a dialog window.

asNode._nextVar(self, givenName, fromEnd=True, skipCount=0, versionUpAll=False, **shArgs)#

[shArgs : gn=givenName, fe=fromEnd, sc=skipCount, vua=versionUpAll]

Purpose:

:: Generates the next variable name in a sequence, often used for creating a series of similarly named nodes or variables in Maya scripts.

Parameters:
  • givenName – <str> #The base name from which the next variable name will be generated.

  • fromEnd – <bool> #Determines whether the sequence increment is applied at the end of the givenName.

  • skipCount – <int> #The number of characters to skip before applying the increment.

  • versionUpAll – <bool> #Indicates whether to increment all numeric parts in the givenName.

Returns:

<str> #The next variable name in the sequence based on the given parameters.

asNode._nodeType(self, transformCheck=False, **shArgs)#

[shArgs : tc=transformCheck]

Purpose:

:: Identifies the type of the asNode within the Maya scene. This function is crucial for scripts that need to handle different node types differently.

Parameters:

transformCheck – <bool, optional> #A flag to check if the node should be considered a transform node.

Returns:

<str> #The type of the asNode.

asNode._preVar(self, givenName, fromEnd=True, skipCount=0, versionUpAll=False, **shArgs)#

[shArgs : gn=givenName, fe=fromEnd, sc=skipCount, vua=versionUpAll]

Purpose:

:: Generates a predecessor variable name in a sequence, commonly used for iterating backwards through a series of similarly named nodes or variables in Maya scripts.

Parameters:
  • givenName – <str> #The base name from which the previous variable name will be generated.

  • fromEnd – <bool> #Determines whether the sequence decrement is applied at the end of the givenName.

  • skipCount – <int> #The number of characters to skip before applying the decrement.

  • versionUpAll – <bool> #Indicates whether to decrement all numeric parts in the givenName.

Returns:

<str> #The previous variable name in the sequence based on the given parameters.

asNode._refreshView(self, num=1, **shArgs)#

[shArgs : n=num]

Purpose:

:: Refreshes the current view of the Maya scene. This function is often used to update the viewport after making changes to the scene that are not automatically reflected in the view.

Parameters:

num – <int> #Number of times to refresh the view.

Returns:

<None> #No return value, refreshes the Maya scene view.

asNode._selected(self, getIter=False, listStr=False, **shArgs)#

[shArgs : gi=getIter, ls=listStr]

Purpose:

:: Returns a list of currently selected nodes (asNodes) in the Maya scene. This function is crucial for scripts that operate on user-selected nodes.

Parameters:
  • getIter – <bool, optional> #Determines whether to return an iterator instead of a list.

  • listStr – <bool, optional> #Determines whether to return the nodes as strings instead of asNodes.

Returns:

<list/None> #Returns a list of selected asNodes, or None if nothing is selected. Returns [list of asNodes] #_ if possible else normal strings Returns None #_ if nothing is selected ..

asNode._setAttr(self, attr, *args, **kwargs)#

[shArgs : a=attr]

Purpose:

:: Sets one or more attributes on an asNode in the Maya scene. This function is used for dynamically modifying node attributes within a script.

Parameters:

attr – <list/str> #A list or a single name of attributes to be set on the asNode.

Returns:

<None> #No return value, sets the specified attributes on the asNode.

asNode._setScale(self, valList=[1, 1, 1], worldSpace=False, **shArgs)#

[shArgs : vl=valList, ws=worldSpace]

Purpose:

:: Sets the scale of an asNode in the Maya scene.

  • This function is used for adjusting the size of nodes, often in rigging or scene layout processes.

Parameters:
  • valList – <list> #A list of three numbers representing the scale values in X, Y, and Z axes.

  • worldSpace – <bool> #Determines whether the scaling is applied in world space or local space.

Returns:

<None> #No return value, sets the scale of the asNode.

asNode._sortByDict(self, dictName, sortType='up', returnType='keys', sortListIndex=0, sliceDict=None, **shNames)#

[shArgs : n=dictName, st=sortType, rt=returnType, sli=sortListIndex, sd=sliceDict]

Purpose:

:: Sorts a dictionary and returns sorted elements based on specified criteria. This function is useful in Maya scripts where data organization and sorting are necessary.

Parameters:
  • dictName – <dict> #The dictionary to be sorted.

  • sortType – <str> #Specifies the sorting order, e.g., ‘up’ for ascending.

  • returnType – <str> #Determines the type of sorted data to return, e.g., ‘keys’ or ‘values’.

  • sortListIndex – <int> #Index in the sorted list to return.

  • sliceDict – <list, optional> #Criteria to slice the dictionary before sorting. sliceDict : None | [‘>’, val] | [‘<’, val] | [‘>=’, val] | [‘<=’, val] | [‘==’, val]

Returns:

<list/dict> #Returns a sorted list or dictionary based on the given parameters. asN.sortedByDict({‘j1’:10, ‘j2’:2, ‘j3’:-1.0, ‘j4’:50.0, ‘j5’:0, ‘j6’:10}, ‘up’)

asNode._startTime(self)#

[shArgs]

Purpose:

:: Initializes a timer or time tracking mechanism in Maya.

  • This function is essential for scripts that require time-based operations or performance measurement.

  • This function needs to be initiated to use ‘asN.computeTime()’

Returns:

<None> #No return value, initiates the timer for tracking.

asNode.addAttr(self, attr, addDivider=0, sdkAttr=False, *args, **kwargs)#

[shArgs : a=attr, ad=addDivider, sa=sdkAttr]

_images/addAttr.jpg

Purpose:

:: Adds a new attribute to an asNode in Maya. This function is frequently used in rigging and custom tool development for adding custom data or controls to nodes.

Parameters:
  • attr – <str> #The name of the attribute to be added.

  • addDivider – <int> #Specifies whether to add a divider in the attribute editor.

  • sdkAttr – <bool> #Indicates whether the attribute is for SDK (Set Driven Key) purposes.

Returns:

<None> #No return value, adds the specified attribute to the asNode.

Adds a new attribute to the asNode. It allows specifying the data type, default value, and whether the attribute is keyable. Used often to add custom data to nodes.

Examples:

Enum Attr:

>>> addAttr("parentTo", en="Wrist:Root:", at="enum", k=1)

Others:

>>> addAttr('persp', ln='test', at='double', k=1)
>>> addAttr('persp.test', query=1, hasMaxValue=True)
False
graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"fas:fa-code-branch Check kwargs"}} CheckKwargs --"If kwargs provided" --> AssignKwargs["/fas:fa-tasks Assign kwargs values"] AssignKwargs --> CheckAddDivider1{{"fas:fa-ruler-combined Check addDivider"}} CheckKwargs --"If no kwargs" --> DefaultKwargs["/fas:fa-cog Set default kwargs"] DefaultKwargs --> CheckAddDivider2{{"fas:fa-ruler-combined Check addDivider"}} CheckAddDivider1 --"If addDivider" --> AddDivider1["/fas:fa-plus-square Add Divider"] CheckAddDivider2 --"If addDivider" --> AddDivider2["/fas:fa-plus-square Add Divider"] AddDivider1 --> ProcessAttributes1["/fas:fa-stream Process Attributes"] AddDivider2 --> ProcessAttributes2["/fas:fa-stream Process Attributes"] CheckAddDivider1 --"No addDivider" --> ProcessAttributes1 CheckAddDivider2 --"No addDivider" --> ProcessAttributes2 ProcessAttributes1 --> CheckSDKAttr1{{"fas:fa-key Check sdkAttr"}} ProcessAttributes2 --> CheckSDKAttr2{{"fas:fa-key Check sdkAttr"}} CheckSDKAttr1 --"If sdkAttr" --> AddSDKAttr1["/fas:fa-plus-circle Add SDK Attr"] CheckSDKAttr2 --"If sdkAttr" --> AddSDKAttr2["/fas:fa-plus-circle Add SDK Attr"] AddSDKAttr1 --> CheckAddDividerEnd1{{"fas:fa-ruler-combined Check addDivider End"}} AddSDKAttr2 --> CheckAddDividerEnd2{{"fas:fa-ruler-combined Check addDivider End"}} CheckAddDividerEnd1 --"If addDivider == 2" --> AddDividerEnd1["/fas:fa-minus-square Add Divider End"] CheckAddDividerEnd2 --"If addDivider == 2" --> AddDividerEnd2["/fas:fa-minus-square Add Divider End"] AddDividerEnd1 --> End[("fas:fa-stop End")] AddDividerEnd2 --> End CheckSDKAttr1 --"No sdkAttr" --> CheckAddDividerEnd1 CheckSDKAttr2 --"No sdkAttr" --> CheckAddDividerEnd2 ProcessAttributes1 --> End ProcessAttributes2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style AssignKwargs fill:#ff9999,stroke:#000,stroke-width:2px style DefaultKwargs fill:#ff9999,stroke:#000,stroke-width:2px style CheckAddDivider1 fill:#ffcc00,stroke:#000,stroke-width:2px style CheckAddDivider2 fill:#ffcc00,stroke:#000,stroke-width:2px style AddDivider1 fill:#99ccff,stroke:#000,stroke-width:2px style AddDivider2 fill:#99ccff,stroke:#000,stroke-width:2px style ProcessAttributes1 fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessAttributes2 fill:#cc99ff,stroke:#000,stroke-width:2px style CheckSDKAttr1 fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSDKAttr2 fill:#ffcc00,stroke:#000,stroke-width:2px style AddSDKAttr1 fill:#99ff99,stroke:#000,stroke-width:2px style AddSDKAttr2 fill:#99ff99,stroke:#000,stroke-width:2px style CheckAddDividerEnd1 fill:#ffcc00,stroke:#000,stroke-width:2px style CheckAddDividerEnd2 fill:#ffcc00,stroke:#000,stroke-width:2px style AddDividerEnd1 fill:#99ccff,stroke:#000,stroke-width:2px style AddDividerEnd2 fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the addAttr function:

  1. The function starts by checking if keyword arguments (kwargs) are provided. If yes, it assigns the values from kwargs.

  2. If kwargs are not provided, default kwargs are set for the attribute.

  3. The function then checks for the addDivider parameter. If it’s specified, a divider is added in the attribute editor.

  4. Attributes are processed next, either using the specified kwargs or the default ones.

  5. After processing attributes, the function checks if the sdkAttr parameter is true. If so, an SDK attribute is added.

  6. Finally, the function checks if another divider should be added at the end, depending on the addDivider parameter.

asNode.addAttrDivider(self, dividerName=None, **shArgs)#

[shArgs : dn=dividerName]

Purpose:

:: Creates an attribute divider in the Maya attribute editor for the asNode. This function helps in organizing and grouping custom attributes for clarity and ease of use.

Parameters:

dividerName – <str> #The name for the divider in the attribute editor.

Returns:

<None> #No return value, creates a divider in the attribute editor.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CheckDividerName{{"/fas:fa-i-cursor Check Divider Name"}} CheckDividerName --"If no dividerName" --> CreateDefaultDivider["/fas:fa-plus-circle Create Default Divider"] CheckDividerName --"If dividerName is string" --> CheckAttributeExistsStr{{"/fas:fa-search-plus Check if Attr Exists (String)"}} CheckDividerName --"If dividerName is list" --> IterateList["/fas:fa-list-ol Iterate Divider Names List"] CreateDefaultDivider --> CheckMaxDividerNum{{"/fas:fa-sort-numeric-up Check Max Divider Number"}} CheckMaxDividerNum --"If not exceeded" --> CreateAttrDefault["/fas:fa-tag Create Attr (Default Name)"] CheckMaxDividerNum --"If exceeded" --> WarningMaxDivider["/fas:fa-exclamation-triangle Warning: Max Divider Exceeded"] CheckAttributeExistsStr --"If Attr does not exist" --> CreateAttrStr["/fas:fa-tag Create Attr (String Name)"] CheckAttributeExistsStr --"If Attr exists" --> WarningAttrExistsStr["/fas:fa-exclamation-triangle Warning: Attr Exists (String)"] IterateList --> CheckAttributeExistsList{{"/fas:fa-search-plus Check if Attr Exists (List)"}} CheckAttributeExistsList --"If Attr does not exist" --> CreateAttrList["/fas:fa-tag Create Attr (List Name)"] CheckAttributeExistsList --"If Attr exists" --> WarningAttrExistsList["/fas:fa-exclamation-triangle Warning: Attr Exists (List)"] CreateAttrDefault --> End[("fas:fa-stop End")] WarningMaxDivider --> End CreateAttrStr --> End WarningAttrExistsStr --> End CreateAttrList --> End WarningAttrExistsList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckDividerName fill:#cc99ff,stroke:#000,stroke-width:2px style CreateDefaultDivider fill:#99ff99,stroke:#000,stroke-width:2px style CheckMaxDividerNum fill:#ffcc00,stroke:#000,stroke-width:2px style CreateAttrDefault fill:#99ccff,stroke:#000,stroke-width:2px style WarningMaxDivider fill:#ff6666,stroke:#000,stroke-width:2px style CheckAttributeExistsStr fill:#cc99ff,stroke:#000,stroke-width:2px style CreateAttrStr fill:#99ccff,stroke:#000,stroke-width:2px style WarningAttrExistsStr fill:#ff6666,stroke:#000,stroke-width:2px style IterateList fill:#99ff99,stroke:#000,stroke-width:2px style CheckAttributeExistsList fill:#cc99ff,stroke:#000,stroke-width:2px style CreateAttrList fill:#99ccff,stroke:#000,stroke-width:2px style WarningAttrExistsList fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.addChild(self, chdNode, chdIndex=None, **shArgs)#

[shArgs : cn=chdNode, ci=chdIndex]

Purpose:

:: Adds a child node to an asNode in the Maya scene. This function is commonly used in rigging and scene organization.

Parameters:
  • chdNode – <asNode> #The child node to be added.

  • chdIndex – <int, optional> #Specifies the index at which the child node is to be added.

Returns:

<asNode/None> #Returns the added child node with the specified index, or None if no index is specified.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CreateChildNodeList["/fas:fa-list-ol Create Child Node List"] CreateChildNodeList --> IterateChildNodes{{"/fas:fa-repeat Iterate Child Nodes"}} IterateChildNodes --"For each chdNode" --> CheckParentMatch{{"/fas:fa-code-branch Check if Parent Matches"}} CheckParentMatch --"If Parent Matches" --> SetChildIndex["/fas:fa-sort-numeric-up Set Child Index"] CheckParentMatch --"If Parent Does Not Match" --> ParentChildNode["/fas:fa-sitemap Parent Child Node"] SetChildIndex --"If chdIndex Specified" --> ReturnSetIndexNode[("fas:fa-check-circle Return Set Index Node")] SetChildIndex --"If no chdIndex Specified" --> WarningParentMatch[("/fas:fa-exclamation-triangle Warning: Already a Child")] ParentChildNode --> CheckChildIndex{{"/fas:fa-sort-numeric-down Check Child Index"}} CheckChildIndex --"If chdIndex Specified" --> ReturnSetIndexNode CheckChildIndex --"If no chdIndex Specified" --> End[("fas:fa-stop End")] ReturnSetIndexNode --> End WarningParentMatch --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CreateChildNodeList fill:#99ff99,stroke:#000,stroke-width:2px style IterateChildNodes fill:#ffcc00,stroke:#000,stroke-width:2px style CheckParentMatch fill:#cc99ff,stroke:#000,stroke-width:2px style SetChildIndex fill:#99ccff,stroke:#000,stroke-width:2px style ParentChildNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckChildIndex fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnSetIndexNode fill:#00cc00,stroke:#000,stroke-width:2px style WarningParentMatch fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.addExtnEndJnt(self, jntName=None, atDist=1, **shArgs)#

[shArgs : jn=jntName, ad=atDist]

Purpose:

:: Adds an extension joint to the end of the asNode, which is typically a joint chain. This is useful in rigging for extending skeletal structures.

Parameters:
  • jntName – <str, optional> #The name for the new extension joint.

  • atDist – <float> #The distance at which the extension joint is to be created from the end joint.

Returns:

<asNode> #The newly created extension joint node.

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"fas:fa-code-branch Check kwargs"}} CheckKwargs --"If kwargs provided" --> AssignKwargs["/fas:fa-tasks Assign kwargs values"] AssignKwargs --> GetParentJoint["/fas:fa-code-branch Get Parent Joint"] CheckKwargs --"If no kwargs" --> GetParentJoint GetParentJoint --> CalculateExtnPos["/fas:fa-ruler Calculate Extension Position"] CalculateExtnPos --> CheckJntName{{"fas:fa-edit Check jntName"}} CheckJntName --"If jntName not provided" --> GenerateJntName["/fas:fa-pen-fancy Generate Joint Name"] CheckJntName --"If jntName provided" --> CreateJoint["/fas:fa-bone Create Joint"] GenerateJntName --> CreateJoint CreateJoint --> CheckIfJnt{{"fas:fa-question-circle Check if Joint"}} CheckIfJnt --"If is a joint" --> SetJointRadius["/fas:fa-expand-arrows-alt Set Joint Radius"] SetJointRadius --> ParentToJoint["/fas:fa-link Parent to Joint"] CheckIfJnt --"Not a joint" --> ParentToJoint ParentToJoint --> ReturnExJnt["/fas:fa-check-circle Return Extension Joint"] ReturnExJnt --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style AssignKwargs fill:#ff9999,stroke:#000,stroke-width:2px style GetParentJoint fill:#99ccff,stroke:#000,stroke-width:2px style CalculateExtnPos fill:#cc99ff,stroke:#000,stroke-width:2px style CheckJntName fill:#ffcc00,stroke:#000,stroke-width:2px style GenerateJntName fill:#99ff99,stroke:#000,stroke-width:2px style CreateJoint fill:#ff9999,stroke:#000,stroke-width:2px style CheckIfJnt fill:#ffcc00,stroke:#000,stroke-width:2px style SetJointRadius fill:#99ccff,stroke:#000,stroke-width:2px style ParentToJoint fill:#99ff99,stroke:#000,stroke-width:2px style ReturnExJnt fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the addExtnEndJnt function:

  1. The function begins by checking if keyword arguments (kwargs) are provided and assigns the values if present.

  2. It retrieves the parent joint of the current node.

  3. The function calculates the extension position based on the provided distance (atDist).

  4. If the joint name (jntName) is not provided, it generates a default joint name.

  5. A new joint is created at the calculated extension position.

  6. The function checks if the current node is a joint. If so, it sets the radius of the new joint to match the current joint.

  7. The new extension joint is parented to the current joint.

  8. Finally, the newly created extension joint is returned.

asNode.addPrefix(self, prfxName, reName=True, **shArgs)#

[shArgs : pn=prfxName, rn=reName]

Purpose:

:: Adds a prefix to the asNode’s name. If reName is True, it renames the asNode with the given prefix; otherwise, it returns the new name without renaming the node.

Parameters:
  • prfxName – <str> #The prefix to add to the asNode’s name.

  • reName – <bool> #Determines whether to rename the asNode or just return the new name. if reName: Renames the asNode with the given prfxName and returns the node else: Retuns name only ‘prfxName + asNode.shortName’

Returns:

<str> #The new name with the prefix added. u’prfxName + asNode.shortName()’

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CheckReName{{"/fas:fa-i-cursor Check reName"}} CheckReName --"If reName is True" --> RenameNode["/fas:fa-pen-alt Rename Node"] CheckReName --"If reName is False" --> ReturnNewNameOnly[("fas:fa-tags Return New Name Only")] RenameNode --> ReturnRenamedNode[("fas:fa-check-circle Return Renamed Node")] ReturnNewNameOnly --> End[("fas:fa-stop End")] ReturnRenamedNode --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckReName fill:#cc99ff,stroke:#000,stroke-width:2px style RenameNode fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNewNameOnly fill:#00cc00,stroke:#000,stroke-width:2px style ReturnRenamedNode fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.addSkinInfluence(self, infList, **shArgs)#

[shArgs : il=infList]

Purpose:

:: Adds a list of influence objects (joints or transform nodes) to the skinning setup of a mesh. This function is crucial in advanced skinning and rigging operations.

Parameters:

infList – <list> #A list of influence objects to be added to the skin cluster.

Returns:

<None> #No return value, updates the skin cluster with new influences.

_images/addSkinInfluence.jpg
asNode.addSuffix(self, sufxName, reName=True, **shArgs)#

[shArgs : sn=sufxName, rn=reName]

Purpose:

:: Adds a suffix to the asNode’s name. If reName is True, it renames the asNode with the given suffix; otherwise, it returns the new name without renaming the node.

Parameters:
  • sufxName – <str> #The suffix to add to the asNode’s name.

  • reName – <bool> #Determines whether to rename the asNode or just return the new name. if reName: Renames the asNode with the given sufxName and returns the node else: Retuns name only ‘asNode.shortName + sufxName’

Returns:

<str> #The new name with the suffix added. ‘asNode.shortName() + sufxName’

_images/addSuffix.jpg
Flow Chart Description:

This flowchart illustrates the addSuffix function:

  1. The process begins by checking if any keyword arguments (kwargs) are provided and setting the suffix name accordingly.

  2. It then checks if the reName option is True or False.

  3. If reName is True, the asNode is renamed with the given suffix and the renamed node is returned.

  4. If reName is False, it returns the new name with the suffix added, without renaming the node.

asNode.applyCtrlColor(self, colorNum=None, **shArgs)#

[shArgs : cn=colorNum]

Purpose:

:: Applies a specific color to a control, typically used in rigging to differentiate between left, right, and center controls. The function can apply a predefined color or a custom one based on the provided color number.

Parameters:

colorNum – <int, optional> #The numerical value representing the color to be applied.

colorNum:

if colorNum is given:
        colorNum =6             #_ is for Blue color
        colorNum =13            #_ is for Red color
        colorNum =17            #_ is for Yellow color
else:
        'L' Prefixed Ctrls                              : Blue Color
        'R' Prefixed Ctrls                              : Red Color
        Ctrls Other than ['L' and 'R']  : Yellow Color
Returns:

<None> #No return value, applies the specified color to the control.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> SetOverrideEnabled["/fas:fa-palette Set Override Enabled"] SetOverrideEnabled --> GetName["/fas:fa-tag Get Name"] GetName --> CheckColorNum{{"/fas:fa-paint-brush Check Color Number"}} CheckColorNum --"If colorNum is given" --> ApplyCustomColor["/fas:fa-eye-dropper Apply Custom Color"] CheckColorNum --"If colorNum is not given" --> CheckPrefix{{"/fas:fa-text-height Check Prefix"}} ApplyCustomColor --> SetShapeCustomColor["/fas:fa-paint-roller Set Shape Custom Color"] CheckPrefix --"If starts with 'L' or 'l' or ends with '_L'" --> ApplyBlueColor["/fas:fa-tint Apply Blue Color"] CheckPrefix --"If starts with 'R' or 'r' or ends with '_R'" --> ApplyRedColor["/fas:fa-tint-slash Apply Red Color"] CheckPrefix --"Otherwise" --> ApplyYellowColor["/fas:fa-sun Apply Yellow Color"] ApplyBlueColor --> SetShapeBlueColor["/fas:fa-paint-roller Set Shape Blue Color"] ApplyRedColor --> SetShapeRedColor["/fas:fa-paint-roller Set Shape Red Color"] ApplyYellowColor --> SetShapeYellowColor["/fas:fa-paint-roller Set Shape Yellow Color"] SetShapeCustomColor --> End[("fas:fa-stop End")] SetShapeBlueColor --> End SetShapeRedColor --> End SetShapeYellowColor --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style SetOverrideEnabled fill:#99ff99,stroke:#000,stroke-width:2px style GetName fill:#ffcc00,stroke:#000,stroke-width:2px style CheckColorNum fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyCustomColor fill:#99ccff,stroke:#000,stroke-width:2px style SetShapeCustomColor fill:#99ff99,stroke:#000,stroke-width:2px style CheckPrefix fill:#ffcc00,stroke:#000,stroke-width:2px style ApplyBlueColor fill:#99ccff,stroke:#000,stroke-width:2px style SetShapeBlueColor fill:#99ff99,stroke:#000,stroke-width:2px style ApplyRedColor fill:#ff9999,stroke:#000,stroke-width:2px style SetShapeRedColor fill:#99ff99,stroke:#000,stroke-width:2px style ApplyYellowColor fill:#ffcc00,stroke:#000,stroke-width:2px style SetShapeYellowColor fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.asLocator(self, name='asLocator', grpLevel=1, **shArgs)#

[shArgs : n=name, gl=grpLevel]

Purpose:

:: Creates a locator in Autodesk Maya, often used as a reference point in various operations like rigging, animation, or scene layout.

Parameters:
  • name – <str> #The name to be assigned to the newly created locator.

  • grpLevel – <int> #The number of group nodes to be created above the locator for organizational purposes.

Returns:

<asNode> #The newly created locator as an asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> LoadPlugin["/fas:fa-plug Load 'asLocator' Plugin"] ProcessShArgs --> LoadPlugin LoadPlugin --> CreateLocatorNode["/fas:fa-map-marker-alt Create Locator Node"] CreateLocatorNode --> RenameLocator["/fas:fa-i-cursor Rename Locator"] RenameLocator --> CreateGroupLevels{{"/fas:fa-layer-group Create Group Levels"}} CreateGroupLevels --"Based on grpLevel" --> ReturnLocatorAndGroup[("fas:fa-check-circle Return Locator and Group")] ReturnLocatorAndGroup --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style LoadPlugin fill:#99ccff,stroke:#000,stroke-width:2px style CreateLocatorNode fill:#99ff99,stroke:#000,stroke-width:2px style RenameLocator fill:#ffcc00,stroke:#000,stroke-width:2px style CreateGroupLevels fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnLocatorAndGroup fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.asObj(self)#

[shArgs]

Purpose:

:: Converts the current context or selection into an asNode, which is a common operation in Maya scripting to ensure that operations are being performed on the correct type of node.

Returns:

<asNode> #The context or selection converted into an asNode.

_images/asObj.jpg
Flow Chart Description:

This flowchart illustrates the asObj function:

  1. The function starts by checking if a context number is set for the current node.

  2. If a context number is set, it converts the context or selection into an asNode based on the specific context.

  3. The function checks if the resulting node is a shape node. If so, it returns the parent node of the shape.

  4. If the node is not a shape node, the asNode itself is returned.

  5. If no context number is set, the function performs a default conversion of the current context or selection into an asNode.

asNode.attr(self, attrList, addAttr=False, *args, **kwargs)#

[shArgs : al=attrList, aa=addAttr]

Description:

:: Retrieves or adds attributes to an asNode.
  • This function is used for dynamic attribute manipulation, either to fetch existing attributes or to add new ones.

  • To get the attr like : asNode + ‘.’ + attrName

Parameters:
  • attrList – <list/str> #A list or a single name of attributes to retrieve or add.

  • addAttr – <bool> #Determines whether to add the attributes in the attrList if they don’t already exist.

Returns:

<list/str> #A list of attributes or a single attribute, depending on the input.

Return Example:

-attributeList          #_ if len(attrList) > 1
-attributeList[0]       #_ if len(attrList) == 1
_images/attr.jpg
Flow Chart Description:

This flowchart illustrates the attr function:

  1. The process begins by creating a list of attributes from the provided input.

  2. For each attribute, the function checks if it exists in the asNode.

  3. If the attribute exists, it’s appended to the attribute list.

  4. If the attribute does not exist, the function checks whether to add the attribute (addAttr parameter).

  5. If addAttr is True, the new attribute is added and appended to the attribute list.

  6. If addAttr is False and the attribute does not exist, the function returns None.

  7. Once all attributes are processed, the function returns either a list of attributes or a single attribute based on the input.

asNode.attributeQuery(self, *args, **kwargs)#

[shArgs]

Purpose:

:: Queries various properties of an attribute on an asNode, such as its type, range, and existence. This function is crucial for scripts that need to validate or understand attribute characteristics before performing operations.

Returns:

<various> #Returns information about the attribute based on the query.

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"fas:fa-code-branch Check kwargs"}} CheckKwargs --"If kwargs provided" --> CheckArgs{{"fas:fa-search-plus Check args"}} CheckKwargs --"If no kwargs" --> CheckArgs CheckArgs --"If args provided" --> ProcessArgs["/fas:fa-cogs Process Args"] ProcessArgs --> CheckAttrExists{{"fas:fa-question-circle Check if Attribute Exists"}} CheckArgs --"If no args" --> CheckAttrExists CheckAttrExists --"Attribute exists" --> QueryAttribute["/fas:fa-search-plus Query Attribute"] CheckAttrExists --"Attribute does not exist" --> ReturnNone["/fas:fa-ban Return None"] QueryAttribute --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckAttrExists fill:#99ccff,stroke:#000,stroke-width:2px style QueryAttribute fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNone fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the attributeQuery function:

  1. The function begins by checking if any keyword arguments (kwargs) are provided.

  2. It then checks if arguments (args) are provided.

  3. If arguments are provided, the function processes these arguments to prepare for the attribute query.

  4. The function checks if the specified attribute exists on the node.

  5. If the attribute exists, it performs the query and returns the requested information.

  6. If the attribute does not exist, the function returns None.

  7. The process ends after the attribute query or returning None.

asNode.centerPivot(self, **shArgs)#

[shArgs]

Purpose:

:: Centers the pivot point of an asNode, which is a common requirement in modeling, rigging, and animation to ensure transformations are centered and balanced.

Returns:

<None> #No return value, centers the pivot of the asNode.

_images/centerPivot.jpg
Flow Chart Description:

This flowchart illustrates the centerPivot function:

  1. The process starts by checking if any keyword arguments (kwargs) are provided.

  2. Regardless of the presence of kwargs, the node is then selected for the pivot centering operation.

  3. The pivot of the selected node is centered using the Center Pivot command in Maya.

  4. The function does not return any value, and the process ends after centering the pivot.

asNode.child(self, indexNum=0, childImplied=True, **shArgs)#

[shArgs : in=indexNum, ci=childImplied]

Purpose:

:: Retrieves a specific child node of the asNode based on the provided index. This function is used in rigging and scene organization to access child nodes for further manipulation.

Parameters:
  • indexNum – <int> #The index number of the child node to retrieve.

  • childImplied – <bool> #Determines whether to imply the child node based on its relationship with the asNode.

Returns:

<asNode> #The child node at the specified index.

_images/child.jpg
Flow Chart Description:

This flowchart illustrates the child function:

  1. The process starts by checking if any keyword arguments (kwargs) are provided and setting index number and child implied flag.

  2. It checks if the child is implied. If yes, it retrieves the implied child and returns the asNode.

  3. If the child is not implied, it gets the number of children and checks if the index is within the valid range.

  4. If the index is valid, it retrieves the child node at that index and returns the asNode.

  5. If the index is out of range, the function returns None, and the process ends.

asNode.connectAttr(self, srcAttr, trgtObj, trgtAttr=None, **kwargs)#

[shArgs : sa=srcAttr, to=trgtObj, ta=trgtAttr]

Purpose:

:: Creates a connection between a source attribute and a target attribute on different nodes. This is a fundamental operation in Maya for establishing dynamic relationships between nodes.

Parameters:
  • srcAttr – <str> #The source attribute to be connected.

  • trgtObj – <asNode> #The target object where the attribute will be connected.

  • trgtAttr – <str, optional> #The target attribute to which the source attribute will be connected.

Returns:

<None> #No return value, creates a connection between the specified attributes.

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"/fas:fa-question Check kwargs"}} CheckKwargs --"If kwargs is provided" --> ProcessKwargs["/fas:fa-cogs Process kwargs"] CheckKwargs --"If kwargs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessKwargs --> SetNcTypes SetNcTypes --> PrepareSrcAttrList["/fas:fa-stream Prepare Source Attribute List"] PrepareSrcAttrList --> PrepareTrgtList["/fas:fa-project-diagram Prepare Target List"] PrepareTrgtList --> CheckSrcAttrLength{{"/fas:fa-ruler-combined Check Source Attr Length"}} CheckSrcAttrLength --"If single srcAttr" --> IterateTrgtList{{"/fas:fa-repeat Iterate Target List"}} CheckSrcAttrLength --"If multiple srcAttrs" --> IterateSrcAttrList{{"/fas:fa-repeat Iterate Source Attr List"}} IterateTrgtList --"For each trgtObj" --> ConnectSingleSrcToTrgt{{"/fas:fa-link Connect Single Source to Target"}} ConnectSingleSrcToTrgt --> CheckTrgtAttrType{{"/fas:fa-code-branch Check Target Attribute Type"}} CheckTrgtAttrType --"If double3 type" --> CheckSrcAttrTypeDouble3{{"/fas:fa-code-branch Check Source Attr Type (double3)"}} CheckTrgtAttrType --"Otherwise" --> ConnectAttrToTrgt["/fas:fa-link Connect Attr to Target"] CheckSrcAttrTypeDouble3 --"If Source is double3" --> ConnectAttrToTrgt CheckSrcAttrTypeDouble3 --"Otherwise" --> ConnectChildAttrToTrgt{{"/fas:fa-link Connect Child Attr to Target"}} ConnectChildAttrToTrgt --> CheckChildAttrExistence{{"/fas:fa-question-circle Check Child Attr Existence"}} CheckChildAttrExistence --"If Child Attr Exists" --> ConnectChildAttr["/fas:fa-link Connect Child Attr"] CheckChildAttrExistence --"Otherwise" --> WarningAttrNotConnected[("/fas:fa-exclamation-triangle Warning: Attr Not Connected")] ConnectChildAttr --> End[("fas:fa-stop End")] WarningAttrNotConnected --> End ConnectAttrToTrgt --> End IterateSrcAttrList --"For each srcAttr" --> ConnectMultipleSrcToTrgt{{"/fas:fa-link Connect Multiple Source to Target"}} ConnectMultipleSrcToTrgt --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessKwargs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style PrepareSrcAttrList fill:#99ff99,stroke:#000,stroke-width:2px style PrepareTrgtList fill:#99ff99,stroke:#000,stroke-width:2px style CheckSrcAttrLength fill:#ffcc00,stroke:#000,stroke-width:2px style IterateTrgtList fill:#cc99ff,stroke:#000,stroke-width:2px style ConnectSingleSrcToTrgt fill:#99ccff,stroke:#000,stroke-width:2px style CheckTrgtAttrType fill:#cc99ff,stroke:#000,stroke-width:2px style CheckSrcAttrTypeDouble3 fill:#cc99ff,stroke:#000,stroke-width:2px style ConnectAttrToTrgt fill:#99ccff,stroke:#000,stroke-width:2px style ConnectChildAttrToTrgt fill:#99ccff,stroke:#000,stroke-width:2px style CheckChildAttrExistence fill:#ffcc00,stroke:#000,stroke-width:2px style ConnectChildAttr fill:#99ccff,stroke:#000,stroke-width:2px style WarningAttrNotConnected fill:#ff6666,stroke:#000,stroke-width:2px style IterateSrcAttrList fill:#cc99ff,stroke:#000,stroke-width:2px style ConnectMultipleSrcToTrgt fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.connectedVertices(self, componentVertices=True, **shArgs)#

[shArgs : cv=componentVertices] :: Retrieves the vertices connected to the current vertex or component. This function is commonly used in modeling and rigging scripts to assess and modify geometry.

Parameters:

componentVertices – <bool> #Determines whether to return connected vertices for a component.

Returns:

<list> #A list of connected vertices.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> DetermineCompType{{"/fas:fa-shapes Determine Component Type"}} ProcessShArgs --> DetermineCompType DetermineCompType --"If isVtx()" --> SetupItMeshVtx["/fas:fa-dot-circle Setup ItMesh Vertex"] DetermineCompType --"If isEdge()" --> SetupItMeshEdge["/fas:fa-project-diagram Setup ItMesh Edge"] DetermineCompType --"If isFace()" --> SetupItMeshFace["/fas:fa-cube Setup ItMesh Face"] SetupItMeshVtx --> FindConnectedVtx["/fas:fa-link Find Connected Vertices (Vtx)"] SetupItMeshEdge --> FindConnectedEdge["/fas:fa-link Find Connected Edges"] SetupItMeshFace --> FindConnectedFace["/fas:fa-link Find Connected Faces"] FindConnectedVtx --> PrepareReturnVtx{{"/fas:fa-check-double Prepare Return (Vtx)"}} FindConnectedEdge --> PrepareReturnEdge{{"/fas:fa-check-double Prepare Return (Edge)"}} FindConnectedFace --> PrepareReturnFace{{"/fas:fa-check-double Prepare Return (Face)"}} PrepareReturnVtx --> ReturnVtx[("fas:fa-arrow-circle-right Return Connected Vertices (Vtx)")] PrepareReturnEdge --> ReturnEdge[("fas:fa-arrow-circle-right Return Connected Vertices (Edge)")] PrepareReturnFace --> ReturnFace[("fas:fa-arrow-circle-right Return Connected Vertices (Face)")] ReturnVtx --> End[("fas:fa-stop End")] ReturnEdge --> End ReturnFace --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style DetermineCompType fill:#99ccff,stroke:#000,stroke-width:2px style SetupItMeshVtx fill:#99ff99,stroke:#000,stroke-width:2px style SetupItMeshEdge fill:#99ff99,stroke:#000,stroke-width:2px style SetupItMeshFace fill:#99ff99,stroke:#000,stroke-width:2px style FindConnectedVtx fill:#ffcc00,stroke:#000,stroke-width:2px style FindConnectedEdge fill:#ffcc00,stroke:#000,stroke-width:2px style FindConnectedFace fill:#ffcc00,stroke:#000,stroke-width:2px style PrepareReturnVtx fill:#cc99ff,stroke:#000,stroke-width:2px style PrepareReturnEdge fill:#cc99ff,stroke:#000,stroke-width:2px style PrepareReturnFace fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnVtx fill:#00cc00,stroke:#000,stroke-width:2px style ReturnEdge fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFace fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.connectionInfo(self, attrName, **kwargs)#

[shArgs : an=attrName] :: Provides detailed information about connections related to a specific attribute on an asNode. This function is crucial for scripts that manage or analyze node connections in Maya.

Parameters:

attrName – <str> #The name of the attribute for which connection information is required.

Returns:

<various> #Detailed information about the connections of the specified attribute.

_images/connectionInfo.jpg
Flow Chart Description:

This flowchart illustrates the connectionInfo function:

  1. The process begins by checking if any keyword arguments (kwargs) are provided and setting the attribute name accordingly.

  2. It then attempts to retrieve detailed information about connections related to the specified attribute.

  3. If the information is successfully retrieved, it returns the connection details.

  4. If an exception occurs during retrieval, the function returns None, and the process ends.

asNode.connections(self, attrName=None, **kwargs)#

[shArgs : an=attrName]

Purpose:

:: Lists all the connections to or from an asNode or a specific attribute on the node. This function is integral to understanding and manipulating the dependency graph in Maya.

Parameters:

attrName – <str, optional> #The attribute name to list connections for. If omitted, connections for the entire node are listed.

Returns:

<list> #A list of all connected nodes or attributes. kwargs: connections:c, plug:p, src:s, dest:d [returns] ——————————————————- plug(p=1) : [‘curve1.translate’, ‘curve2.rotate’, etc] no args : [‘curve1’, ‘curve2’, etc] attrName : [related to attr only .. ]

_images/connections.jpg
Flow Chart Description:

This flowchart illustrates the connections function:

  1. The process starts by checking if a specific attribute name (attrName) is provided.

  2. If attrName is provided, the function lists all connections related to that specific attribute.

  3. If attrName is not provided, the function lists all connections related to the entire node.

  4. The function then processes these connections.

  5. Finally, it returns a list of all connected nodes or attributes, depending on the query parameters provided.

asNode.constrainTo(self, objList, conList='parent', **kwargs)#

[shArgs : ol=objList, cl=conList]

Purpose:

:: Applies various types of constraints to an asNode based on the target object list and the specified constraint types. This function is frequently used in rigging and animation for dynamic parenting and alignment of objects.

Parameters:
  • objList – <list> #List of target objects to which the asNode will be constrained.

  • conList

    <str/list> #Type of constraint(s) to apply, such as ‘parent’, ‘point’, ‘orient’, etc.

    conList: :

    conList : ‘parent’ or [‘point’] or [‘point’, ‘orient’, ‘scale’] etc **kwargs : weight(w=1), maintainOffset(mo=1), remove(rm=1), targetList(tl=1), weightAliasList(wal=1), name(n=’_PointCon’), e=1, q=1 if kwargs not given:

    kwargs ={‘mo’: 1, ‘w’:1}

Returns:

<list> #List of created constraint nodes:: if len(conList) > 1:

return conNodeList

else:

return conNodeList[0]

Usage::
Ex1: >>> conList =asN.constrainTo(‘object02’, ‘orient’) #_ If no kwargs, kwargs ={‘mo’=1, ‘w’:1}

# Result: [u’object02_OrientCon’]

Ex2: >>> conList =asN.constrainTo([‘object02’, ‘object03’], [‘orient’, ‘point’])

# Result: [u’object02_OrientCon’, u’object02_OrientCon’, u’object03_PointCon’, u’object03_PointCon’]

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> SetDefaultKwargs["/fas:fa-cog Set Default kwargs"] SetDefaultKwargs --> ConvertObjConToList{{"/fas:fa-list-ul Convert Obj & Con to List"}} ConvertObjConToList --> CheckConstraintCombination{{"/fas:fa-exclamation-triangle Check Constraint Combination"}} CheckConstraintCombination --"If Combination Invalid" --> RaiseErrorInvalidCombination[("/fas:fa-ban Raise Error: Invalid Combination")] CheckConstraintCombination --"If Combination Valid" --> ApplyConstraints{{"/fas:fa-link Apply Constraints"}} ApplyConstraints --"For each Constraint" --> CreateConstraintNode{{"/fas:fa-puzzle-piece Create Constraint Node"}} CreateConstraintNode --"For each Target Object" --> CheckSpecificConstraint{{"/fas:fa-code-branch Check Specific Constraint Type"}} CheckSpecificConstraint --> SetConstraintAttributes["/fas:fa-sliders-h Set Constraint Attributes"] SetConstraintAttributes --> AddConNodeToList["/fas:fa-plus-circle Add Constraint Node to List"] AddConNodeToList --> ReturnConNodeList[("fas:fa-arrow-circle-right Return Constraint Node List")] RaiseErrorInvalidCombination --> End[("fas:fa-stop End")] ReturnConNodeList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultKwargs fill:#99ff99,stroke:#000,stroke-width:2px style ConvertObjConToList fill:#ffcc00,stroke:#000,stroke-width:2px style CheckConstraintCombination fill:#ff6666,stroke:#000,stroke-width:2px style RaiseErrorInvalidCombination fill:#ff6666,stroke:#000,stroke-width:2px style ApplyConstraints fill:#cc99ff,stroke:#000,stroke-width:2px style CreateConstraintNode fill:#99ccff,stroke:#000,stroke-width:2px style CheckSpecificConstraint fill:#cc99ff,stroke:#000,stroke-width:2px style SetConstraintAttributes fill:#99ff99,stroke:#000,stroke-width:2px style AddConNodeToList fill:#00cc00,stroke:#000,stroke-width:2px style ReturnConNodeList fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.contains(self, objOrPos, **shArgs)#

[shArgs : oo=objOrPos]

Purpose:

:: Determines if the asNode contains a specified object or position within its boundaries. This function is useful in collision detection, spatial queries, and scene validation.

Parameters:

objOrPos – <asNode/position> #The object or position to check within the asNode’s boundaries.

Returns:

<bool> #Returns True if the asNode contains the specified object or position, otherwise False.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CheckObjOrPosType{{"/fas:fa-code-branch Check Type of objOrPos"}} CheckObjOrPosType --"If objOrPos is not a list and exists" --> GetPosAsNode["/fas:fa-map-marker-alt Get Position (asNode)"] CheckObjOrPosType --"If objOrPos is a list" --> UseListPos["/fas:fa-list-ol Use List Position"] CheckObjOrPosType --"Otherwise" --> ErrorInvalidObj["/fas:fa-exclamation-triangle Error: Invalid Object"] GetPosAsNode --> GetBoundingBox["/fas:fa-vector-square Get Bounding Box"] UseListPos --> GetBoundingBox ErrorInvalidObj --> End[("fas:fa-stop End")] GetBoundingBox --> CheckContainment{{"/fas:fa-search-plus Check Containment"}} CheckContainment --"If contains mPnt" --> ReturnTrue[("fas:fa-check Return True")] CheckContainment --"If does not contain mPnt" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckObjOrPosType fill:#cc99ff,stroke:#000,stroke-width:2px style GetPosAsNode fill:#99ff99,stroke:#000,stroke-width:2px style UseListPos fill:#99ff99,stroke:#000,stroke-width:2px style ErrorInvalidObj fill:#ff6666,stroke:#000,stroke-width:2px style GetBoundingBox fill:#ffcc00,stroke:#000,stroke-width:2px style CheckContainment fill:#99ccff,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.createNode_MD(self, valOrAttr01, valOrAttr02, mdnSign='*', mdnName='asNode_MDN', destAttr=None, **shArgs)#

[shArgs : va=valOrAttr01, vb=valOrAttr02, ms=mdnSign, mn=mdnName, da=destAttr]

Purpose:

:: Creates a Multiply-Divide node in Maya, commonly used for mathematical operations in rigging and animation pipelines.

Parameters:
  • valOrAttr01 – <str/number> #First value or attribute for the operation.

  • valOrAttr02 – <str/number> #Second value or attribute for the operation.

  • mdnSign – <str> #The mathematical operation sign, e.g., ‘*’, ‘/’, ‘**’. Available mdnSigns are: [‘*’, ‘/’, ‘**’]

  • mdnName – <str> #The name for the created Multiply-Divide node.

  • destAttr – <str, optional> #The destination attribute where the result will be connected.

Returns:

<list> #A list containing the Multiply-Divide node and the output attribute:: return [mdNode, outAttr] #_ outAttr = node + ‘.’ + attr

usage:

valOrAttr01 =selected()[0] + '.tx' | selected()[0] + '.t' | 25 | [0, 2, 10]
valOrAttr02 =selected()[1] + '.ty' | selected()[1] + '.r' | 10 | [0, 2, 10]
destAttr =selected()[1] + '.ty' | selected()[1] + '.r'
self.createNode_MD(valOrAttr01, valOrAttr02, '*', 'node_MDN', destAttr)
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CreateMDNode["/fas:fa-calculator Create MD Node"] ProcessShArgs --> CreateMDNode CreateMDNode --> SetMDNodeOperation["/fas:fa-cogs Set MD Node Operation"] SetMDNodeOperation --> ConnectInput1{{"/fas:fa-plug Connect Input 1"}} ConnectInput1 --"If valOrAttr01 is Num/List" --> SetInput1Value["/fas:fa-pencil-alt Set Input 1 Value"] ConnectInput1 --"If valOrAttr01 is Attr" --> ConnectInput1Attr["/fas:fa-link Connect Input 1 Attribute"] ConnectInput1Attr --"Check if Attr is double3" --> SetCompoundAttrTrue["/fas:fa-check Set CompoundAttr True"] ConnectInput1Attr --"If Attr is not double3" --> ConnectInput1XAttr["/fas:fa-link Connect Input 1X Attribute"] SetInput1Value --> ConnectInput2{{"/fas:fa-plug Connect Input 2"}} SetCompoundAttrTrue --> ConnectInput2 ConnectInput1XAttr --> ConnectInput2 ConnectInput2 --"If valOrAttr02 is Num/List" --> SetInput2Value["/fas:fa-pencil-alt Set Input 2 Value"] ConnectInput2 --"If valOrAttr02 is Attr" --> ConnectInput2Attr["/fas:fa-link Connect Input 2 Attribute"] ConnectInput2Attr --"Check if Attr is double3" --> SetCompoundAttrTrue2["/fas:fa-check Set CompoundAttr True"] ConnectInput2Attr --"If Attr is not double3" --> ConnectInput2XAttr["/fas:fa-link Connect Input 2X Attribute"] SetInput2Value --> DetermineOutputAttr{{"/fas:fa-sign-out-alt Determine Output Attr"}} SetCompoundAttrTrue2 --> DetermineOutputAttr ConnectInput2XAttr --> DetermineOutputAttr DetermineOutputAttr --"If CompoundAttr" --> SetOutputAttr["/fas:fa-pencil-alt Set Output Attr"] DetermineOutputAttr --"If not CompoundAttr" --> SetOutputXAttr["/fas:fa-pencil-alt Set OutputX Attr"] SetOutputAttr --> ConnectDestAttr{{"/fas:fa-plug Connect Destination Attr"}} SetOutputXAttr --> ConnectDestAttr ConnectDestAttr --"If destAttr given" --> ConnectOutputToDest["/fas:fa-link Connect Output to Dest"] ConnectDestAttr --"If no destAttr" --> ReturnMDNodeAttr[("fas:fa-arrow-circle-right Return MD Node and Attr")] ConnectOutputToDest --> ReturnMDNodeAttr ReturnMDNodeAttr --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CreateMDNode fill:#99ccff,stroke:#000,stroke-width:2px style SetMDNodeOperation fill:#99ff99,stroke:#000,stroke-width:2px style ConnectInput1 fill:#ffcc00,stroke:#000,stroke-width:2px style SetInput1Value fill:#99ccff,stroke:#000,stroke-width:2px style ConnectInput1Attr fill:#99ccff,stroke:#000,stroke-width:2px style SetCompoundAttrTrue fill:#99ff99,stroke:#000,stroke-width:2px style ConnectInput1XAttr fill:#99ccff,stroke:#000,stroke-width:2px style ConnectInput2 fill:#ffcc00,stroke:#000,stroke-width:2px style SetInput2Value fill:#99ccff,stroke:#000,stroke-width:2px style ConnectInput2Attr fill:#99ccff,stroke:#000,stroke-width:2px style SetCompoundAttrTrue2 fill:#99ff99,stroke:#000,stroke-width:2px style ConnectInput2XAttr fill:#99ccff,stroke:#000,stroke-width:2px style DetermineOutputAttr fill:#cc99ff,stroke:#000,stroke-width:2px style SetOutputAttr fill:#99ccff,stroke:#000,stroke-width:2px style SetOutputXAttr fill:#99ccff,stroke:#000,stroke-width:2px style ConnectDestAttr fill:#ffcc00,stroke:#000,stroke-width:2px style ConnectOutputToDest fill:#99ccff,stroke:#000,stroke-width:2px style ReturnMDNodeAttr fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.ctrlApplyColor(self, colorNum=None, **shArgs)#

[shArgs : cn=colorNum]

Purpose:

:: Applies a specific color to a control in Maya, typically used in rigging to differentiate between left, right, and center controls. Can apply a predefined color or a custom one based on the provided color number.

Parameters:

colorNum – <int, optional> #The numerical value representing the color to be applied.

Returns:

<None> #No return value, applies the specified color to the control.

Color Details:

if colorNum is given:
        colorNum =6             #_ is for Blue color
        colorNum =13            #_ is for Red color
        colorNum =17            #_ is for Yellow color
else:
        'L' Prefixed Ctrls                              : Blue Color
        'R' Prefixed Ctrls                              : Red Color
        Ctrls Other than ['L' and 'R']  : Yellow Color
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> SetOverrideEnabled["/fas:fa-palette Set Override Enabled"] SetOverrideEnabled --> GetName["/fas:fa-tag Get Name"] GetName --> CheckColorNum{{"/fas:fa-paint-brush Check Color Number"}} CheckColorNum --"If colorNum is given" --> ApplyCustomColor["/fas:fa-eye-dropper Apply Custom Color"] CheckColorNum --"If colorNum is not given" --> CheckPrefix{{"/fas:fa-text-height Check Prefix"}} ApplyCustomColor --> SetShapeCustomColor["/fas:fa-paint-roller Set Shape Custom Color"] CheckPrefix --"If starts with 'L' or 'l' or ends with '_L'" --> ApplyBlueColor["/fas:fa-tint Apply Blue Color"] CheckPrefix --"If starts with 'R' or 'r' or ends with '_R'" --> ApplyRedColor["/fas:fa-tint-slash Apply Red Color"] CheckPrefix --"Otherwise" --> ApplyYellowColor["/fas:fa-sun Apply Yellow Color"] ApplyBlueColor --> SetShapeBlueColor["/fas:fa-paint-roller Set Shape Blue Color"] ApplyRedColor --> SetShapeRedColor["/fas:fa-paint-roller Set Shape Red Color"] ApplyYellowColor --> SetShapeYellowColor["/fas:fa-paint-roller Set Shape Yellow Color"] SetShapeCustomColor --> End[("fas:fa-stop End")] SetShapeBlueColor --> End SetShapeRedColor --> End SetShapeYellowColor --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style SetOverrideEnabled fill:#99ff99,stroke:#000,stroke-width:2px style GetName fill:#ffcc00,stroke:#000,stroke-width:2px style CheckColorNum fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyCustomColor fill:#99ccff,stroke:#000,stroke-width:2px style SetShapeCustomColor fill:#99ff99,stroke:#000,stroke-width:2px style CheckPrefix fill:#ffcc00,stroke:#000,stroke-width:2px style ApplyBlueColor fill:#99ccff,stroke:#000,stroke-width:2px style SetShapeBlueColor fill:#99ff99,stroke:#000,stroke-width:2px style ApplyRedColor fill:#ff9999,stroke:#000,stroke-width:2px style SetShapeRedColor fill:#99ff99,stroke:#000,stroke-width:2px style ApplyYellowColor fill:#ffcc00,stroke:#000,stroke-width:2px style SetShapeYellowColor fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.ctrlCreateDir(self, trgtObj, **shArgs)#

[shArgs : to=trgtObj]

Purpose:

:: Creates directional control for an asNode, often used in rigging to provide directional inputs or constraints.

Parameters:

trgtObj – <asNode> #The target object for which the directional control will be created.

Returns:

<None> #No return value, creates directional control for the specified target.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CreateAsTrgtNode["/fas:fa-cube Create AsTrgt Node"] CreateAsTrgtNode --> CreateLocForTrgt["/fas:fa-map-marker-alt Create Locator for Trgt"] CreateLocForTrgt --> CreateAnnotateObj["/fas:fa-comment-alt Create Annotate Object"] CreateAnnotateObj --> RenameAnnotateObj["/fas:fa-i-cursor Rename Annotate Object"] RenameAnnotateObj --> SnapAnnotateToTrgt["/fas:fa-magnet Snap Annotate to Trgt"] SnapAnnotateToTrgt --> ParentAnnotateToTrgt["/fas:fa-sitemap Parent Annotate to Trgt"] ParentAnnotateToTrgt --> SnapLocToSelf["/fas:fa-magnet Snap Locator to Self"] SnapLocToSelf --> ParentLocToSelf["/fas:fa-sitemap Parent Locator to Self"] ParentLocToSelf --> ConstrainAnnotateAim["/fas:fa-arrows-alt-h Constrain Annotate (Aim)"] ConstrainAnnotateAim --> ConstrainAnnotatePoint["/fas:fa-expand-arrows-alt Constrain Annotate (Point)"] ConstrainAnnotatePoint --> SetAnnotateTemplate["/fas:fa-layer-group Set Annotate Template"] SetAnnotateTemplate --> ReturnAnnotateObj[("fas:fa-check-circle Return Annotate Object")] ReturnAnnotateObj --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CreateAsTrgtNode fill:#99ff99,stroke:#000,stroke-width:2px style CreateLocForTrgt fill:#99ff99,stroke:#000,stroke-width:2px style CreateAnnotateObj fill:#ffcc00,stroke:#000,stroke-width:2px style RenameAnnotateObj fill:#cc99ff,stroke:#000,stroke-width:2px style SnapAnnotateToTrgt fill:#99ccff,stroke:#000,stroke-width:2px style ParentAnnotateToTrgt fill:#99ff99,stroke:#000,stroke-width:2px style SnapLocToSelf fill:#99ccff,stroke:#000,stroke-width:2px style ParentLocToSelf fill:#99ff99,stroke:#000,stroke-width:2px style ConstrainAnnotateAim fill:#cc99ff,stroke:#000,stroke-width:2px style ConstrainAnnotatePoint fill:#cc99ff,stroke:#000,stroke-width:2px style SetAnnotateTemplate fill:#99ccff,stroke:#000,stroke-width:2px style ReturnAnnotateObj fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the ctrlCreateDir function:

  1. The process begins by checking if a target object (trgtObj) is provided.

  2. If trgtObj is provided, the function proceeds to create directional control for the target.

  3. A locator is created and an annotate object is added to it.

  4. The annotate object is then renamed, snapped, and parented to the target object.

  5. The locator is snapped and parented to ‘self’.

  6. Aim and point constraints are applied to the annotate object.

  7. The annotate object is set as a template.

  8. Finally, the annotate object is returned.

asNode.ctrlMirrorShape(self, srcStr='L_', repStr='R_', repCount=1, **shArgs)#

[shArgs : ss=srcStr, rs=repStr, rc=repCount]

Purpose:

:: Mirrors the shape of a control object in Maya, typically used in rigging to create symmetrical control shapes on the opposite side of a character or object.

Parameters:
  • srcStr – <str> #The source string or prefix to identify the control to be mirrored.

  • repStr – <str> #The replacement string or prefix for the mirrored control.

  • repCount – <int> #The number of times the replacement should occur in the control name.

Returns:

<None> #No return value, mirrors the control shape based on the specified parameters.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> IdentifyCtrl["/fas:fa-search-plus Identify Control"] IdentifyCtrl --> CreateMirrorCtrl["/fas:fa-copy Create Mirror Control"] CreateMirrorCtrl --> ListCtrlShapes{{"/fas:fa-list-ol List Control Shapes"}} ListCtrlShapes --"For each ctrlShape" --> GetShapeAttributes{{"/fas:fa-info-circle Get Shape Attributes"}} GetShapeAttributes --> MirrorShapePositions{{"/fas:fa-object-ungroup Mirror Shape Positions"}} MirrorShapePositions --"For each CV" --> CalculateMirrorPos["/fas:fa-ruler-combined Calculate Mirror Position"] CalculateMirrorPos --> ApplyMirrorPos["/fas:fa-paint-brush Apply Mirror Position"] ApplyMirrorPos --> CheckMirrorShapeExistence{{"/fas:fa-question-circle Check Mirror Shape Existence"}} CheckMirrorShapeExistence --"If Exists" --> ApplyTransformMirrorShape["/fas:fa-sync-alt Apply Transform to Mirror Shape"] CheckMirrorShapeExistence --"If Not Exists" --> ContinueLoop[("fas:fa-arrow-right Continue Loop")] ApplyTransformMirrorShape --> EndLoop[("fas:fa-check End Loop")] ContinueLoop --> ListCtrlShapes EndLoop --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style IdentifyCtrl fill:#99ff99,stroke:#000,stroke-width:2px style CreateMirrorCtrl fill:#99ff99,stroke:#000,stroke-width:2px style ListCtrlShapes fill:#ffcc00,stroke:#000,stroke-width:2px style GetShapeAttributes fill:#cc99ff,stroke:#000,stroke-width:2px style MirrorShapePositions fill:#99ccff,stroke:#000,stroke-width:2px style CalculateMirrorPos fill:#99ff99,stroke:#000,stroke-width:2px style ApplyMirrorPos fill:#99ccff,stroke:#000,stroke-width:2px style CheckMirrorShapeExistence fill:#ffcc00,stroke:#000,stroke-width:2px style ApplyTransformMirrorShape fill:#99ff99,stroke:#000,stroke-width:2px style ContinueLoop fill:#ffcc00,stroke:#000,stroke-width:2px style EndLoop fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the ctrlMirrorShape function:

  1. The process starts by checking if shArgs are provided and processing them if present.

  2. The control object is identified and the corresponding mirror control is determined.

  3. The function then lists the shapes of the control and mirror controls.

  4. For each control shape, it retrieves shape information like form, spans, degrees, and CV count.

  5. It mirrors the position of each CV (Control Vertex) of the control shape.

  6. The function calculates the mirrored position for each CV.

  7. The mirrored CV positions are applied to the corresponding mirror control shape.

  8. The function checks if the mirror control exists, and if so, it applies transformations.

  9. The loop continues for each control shape until all shapes are processed.

asNode.ctrlShiftShape(self, shiftType='trans', valList=[0, 0, 0], **shArgs)#

[shArgs : st=shiftType, vl=valList]

Purpose:

:: Shifts the shape of a control in Maya. This function is used in rigging to adjust control shapes without affecting their functionality.

Parameters:
  • shiftType – <str> #The type of shift to apply, such as ‘trans’, ‘rotate’, or ‘scale’. shiftType = ‘trans’ or ‘t’ | ‘rotate’ or ‘r’ | ‘scale’ or ‘s’

  • valList – <list> #A list of values to apply for the shift, corresponding to the shiftType.

Returns:

<None> #No return value, shifts the control shape as specified.

_images/ctrlShiftShape.jpg
Flow Chart Description:

This flowchart illustrates the ctrlShiftShape function:

  1. The process begins with checking if shArgs are provided and processing them.

  2. The function then sets the necessary node component types for operation.

  3. It checks if the object is of type ‘NurbsCurve’, and raises an error if not.

  4. The vertex list of the curve is obtained.

  5. The vertices of the curve are selected for manipulation.

  6. Based on the shiftType (‘trans’, ‘rotate’, or ‘scale’), the function shifts the vertices.

  7. The vertices are moved, rotated, or scaled according to the specified valList.

  8. Finally, the control is reselected, and the process ends.

asNode.cv(self, num=0, getNode=1, checkCount=8, **shArgs)#

[shArgs : n=num, gn=getNode, cc=checkCount]

Purpose:

:: Retrieves a curve vertex (CV) from a NURBS curve in Maya, commonly used in rigging and animation to manipulate curve shapes.

Parameters:
  • num – <int> #The index number of the CV to retrieve.

  • getNode – <bool> #Determines whether to return the CV as a node.

  • checkCount – <bool> #Checks whether the specified CV index is within the valid range.

Returns:

<asNode> #The specified curve vertex as an asNode.

_images/cv.jpg
Flow Chart Description:

This flowchart illustrates the cv function:

  1. The process begins with checking if shArgs are provided and processing them.

  2. The function then sets the necessary node component types for operation.

  3. It retrieves the name of the object associated with the asNode.

  4. The CV list of the NURBS curve is obtained.

  5. The function checks if the specified CV index is within the valid range.

  6. If the object is a NURBS curve, it determines whether to return the CV as a node or as a string based on the getNode parameter.

  7. If getNode is True, the specified CV is returned as an asNode; otherwise, it’s returned as a string.

  8. If the object is not a NURBS curve or if the index is invalid, the function returns None.

  9. The process ends after returning the CV as specified.

asNode.delete(self, **kwargs)#

[shArgs]

Purpose:

:: Deletes the asNode in Maya scene. This function is integral to operations that involve removing elements from the scene.

Returns:

<None> #No return value, deletes the asNode or its specified component.

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"/fas:fa-question Check kwargs"}} CheckKwargs --"If kwargs are provided" --> ProcessKwargs["/fas:fa-cogs Process kwargs"] CheckKwargs --"If kwargs are not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessKwargs --> SetNcTypes SetNcTypes --> DeleteNode["/fas:fa-trash Delete Node"] DeleteNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessKwargs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style DeleteNode fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the delete function:

  1. The process starts by checking if kwargs are provided and processes them if present.

  2. The necessary node component types are set for the delete operation.

  3. The function then executes the deletion of the asNode or its specified component.

  4. The process ends after successfully deleting the node.

asNode.deleteAttr(self, attrList, **shArgs)#

[shArgs : al=attrList]

Purpose:

:: Deletes one or more attributes from an asNode. This function is used in rigging and custom tool development for removing custom attributes that are no longer needed.

Parameters:

attrList – <str/list> #A list of attribute names to be deleted from the asNode. attrList =[attrList] if type(attrList) != list else attrList

Returns:

<None> #No return value, deletes the specified attributes from the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs are provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs are not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> ConvertAttrList["/fas:fa-list-ol Convert AttrList"] ConvertAttrList --> LoopThroughAttrs{{"/fas:fa-repeat Loop Through Attrs"}} LoopThroughAttrs --"For each attrName" --> DeleteAttribute["/fas:fa-trash-alt Delete Attribute"] DeleteAttribute --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style ConvertAttrList fill:#99ccff,stroke:#000,stroke-width:2px style LoopThroughAttrs fill:#ffcc00,stroke:#000,stroke-width:2px style DeleteAttribute fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the deleteAttr function:

  1. The process begins by checking if shArgs are provided and processes them if present.

  2. It then sets the necessary node component types for the operation.

  3. The attribute list is converted into a standard format for processing.

  4. The function loops through each attribute in the list.

  5. Each attribute is deleted from the asNode.

  6. The process ends after successfully deleting all specified attributes.

asNode.deleteHistory(self, **shArgs)#

[shArgs]

Purpose:

:: Deletes the construction history of the asNode in Maya, which is commonly required in modeling and rigging to optimize scene performance and avoid unnecessary calculations.

Returns:

<None> #No return value, deletes the construction history of the asNode.

_images/deleteHistory.jpg
Flow Chart Description:

This flowchart illustrates the deleteHistory function:

  1. The process starts by checking if shArgs are provided and processes them if present.

  2. It then sets the necessary node component types for the operation.

  3. The asNode is selected to prepare for the delete history operation.

  4. The construction history of the asNode is deleted using the DeleteHistory command.

  5. The selection is cleared after the operation is completed.

  6. The process ends following the successful deletion of the asNode’s history.

asNode.deleteKey(self, attrList, **shArgs)#

[shArgs : al=attrList] :: Deletes keyframes from one or more attributes of the asNode. This function is used in animation and rigging to remove unwanted animation data.

Parameters:

attrList – <list> #A list of attribute names from which keyframes will be deleted.

Returns:

<None> #No return value, deletes keyframes from the specified attributes.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs are provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs are not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> ConvertToList{{"/fas:fa-list-ol Convert attrList to List"}} ConvertToList --"For each attribute in attrList" --> DeleteKeyframe["/fas:fa-trash-alt Delete Keyframe"] DeleteKeyframe --> ReturnTrue[("fas:fa-check-circle Return True")] ReturnTrue --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToList fill:#ffcc00,stroke:#000,stroke-width:2px style DeleteKeyframe fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the deleteKey function:

  1. The process starts by checking if shArgs are provided and processes them if present.

  2. It then sets the necessary node component types for the operation.

  3. The attrList is converted into a list format to process each attribute.

  4. Keyframes are deleted from each attribute listed in attrList.

  5. The function returns True upon successful deletion of keyframes.

  6. The process ends following the successful deletion of keyframes from the specified attributes.

asNode.deleteNode(self, **shArgs)#

[shArgs]

Purpose:

:: Deletes the asNode from the Maya scene. This function is essential for scene management and cleanup, allowing for the removal of nodes that are no longer required.

Returns:

<None> #No return value, deletes the asNode from the scene.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs are provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs are not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> DeleteAsNode["/fas:fa-trash-alt Delete asNode"] DeleteAsNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style DeleteAsNode fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the deleteNode function:

  1. The process begins with a check for provided shArgs and processes them if available.

  2. It then sets the appropriate node component types for the deletion operation.

  3. The asNode is then deleted from the Maya scene.

  4. The process concludes with the removal of the asNode.

asNode.deselect(self, **shArgs)#

[shArgs]

Purpose:

:: Deselects the current selection in Maya, clearing any active selections in the scene. This function is useful in scripting to reset the selection state.

Returns:

<None> #No return value, deselects all currently selected objects in the scene.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs are provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs are not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> DeselectNodes["/fas:fa-times-circle Deselect Nodes"] DeselectNodes --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style DeselectNodes fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the deselect function:

  1. The process begins with a check for provided shArgs and processes them if available.

  2. It then sets the appropriate node component types for the deselection operation.

  3. All currently selected nodes in the Maya scene are then deselected.

  4. The process concludes with the scene’s selection state reset.

asNode.disconnectAttr(self, srcAttr, trgtObj=None, trgtAttr=None, **shArgs)#

[shArgs : sa=srcAttr, to=trgtObj, ta=trgtAttr]

Purpose:

:: Disconnects an attribute connection between a source attribute and a target attribute in Maya. This function is used for managing and modifying node connections.

Options:

If trgtObj and trgtAttr are not provided, srcAttr on asNode will be disconnected by querying the trgtAttr

Parameters:
  • srcAttr – <str> #The source attribute from which the connection will be disconnected. srcAttr = ‘t’ | ‘sx’ etc #_ Any attribute which exists on asNode

  • trgtObj – <asNode, optional> #The target object from which the source attribute will be disconnected. trgtObj = name(str) #_ Name of the trgtObj

  • trgtAttr – <str, optional> #The target attribute from which the source attribute will be disconnected. trgtAttr = name(str) ‘t’ | ‘sx’ etc #_ Name of existing attr on trgtObj

Returns:

<None> #No return value, disconnects the specified attribute connection.

_images/disconnectAttr.jpg
Flow Chart Description:

This flowchart illustrates the disconnectAttr function:

  1. The process starts with checking for provided shArgs and processing them if available.

  2. It sets the appropriate node component types for the operation.

  3. The function checks each source attribute in the provided list.

  4. It determines if target object and attribute are provided for disconnection.

  5. If the target is provided, it disconnects the specified source attribute from the target attribute.

  6. If no target is provided, it queries the target attribute connected to the source and disconnects it.

  7. This loop continues for each source attribute in the list.

  8. The process concludes with all specified connections being disconnected.

asNode.distanceTo(self, destObjOrPos, getNode=False, parentGrp=None, hideLoc=False, **shArgs)#

[shArgs : do=destObjOrPos, gn=getNode, pg=parentGrp, hl=hideLoc]

Purpose:

:: Calculates the distance between the asNode and a specified destination object or position.

  • Commonly used in rigging and animation for spatial calculations.

  • To measure the distance between (two objects) or (two positions) or (one obj and one position or veceversa)

Parameters:
  • destObjOrPos – <asNode/position> #The destination object or position to measure the distance to.

  • getNode – <bool> #Determines whether to return the measuring node.

  • parentGrp – <asNode, optional> #Specifies a parent group for the measuring node.

  • hideLoc – <bool> #Determines whether to hide the locator used for measuring.

Returns:

<list/float> #Returns the distance value and optionally the measuring node.

Details:

[mDist, distNode, locList, distShape, distAttr] #_ If getNode is True
[mDist]                                                                                 #_ If getNode is False
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> GetSrcPos["/fas:fa-map-marker-alt Get SrcPos"] GetSrcPos --> GetDestPos{{"/fas:fa-crosshairs Get DestPos"}} GetDestPos --"If destObjOrPos is list" --> CalcDistList["/fas:fa-ruler-combined Calc Dist (List)"] GetDestPos --"If destObjOrPos is not list" --> CalcDistObj["/fas:fa-ruler-combined Calc Dist (Obj)"] CalcDistList --> CheckGetNode1{{"/fas:fa-question-circle Check getNode"}} CalcDistObj --> CheckGetNode2{{"/fas:fa-question-circle Check getNode"}} CheckGetNode1 --"If getNode is True" --> ReturnNodeDetails1["/fas:fa-info-circle Return Node Details"] CheckGetNode1 --"If getNode is False" --> ReturnDist1[("fas:fa-tape Return mDist")] CheckGetNode2 --"If getNode is True" --> ReturnNodeDetails2["/fas:fa-info-circle Return Node Details"] CheckGetNode2 --"If getNode is False" --> ReturnDist2[("fas:fa-tape Return mDist")] ReturnNodeDetails1 --> End[("fas:fa-stop End")] ReturnDist1 --> End ReturnNodeDetails2 --> End ReturnDist2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style GetSrcPos fill:#99ff99,stroke:#000,stroke-width:2px style GetDestPos fill:#ffcc00,stroke:#000,stroke-width:2px style CalcDistList fill:#99ccff,stroke:#000,stroke-width:2px style CalcDistObj fill:#99ccff,stroke:#000,stroke-width:2px style CheckGetNode1 fill:#cc99ff,stroke:#000,stroke-width:2px style CheckGetNode2 fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnNodeDetails1 fill:#ff9999,stroke:#000,stroke-width:2px style ReturnNodeDetails2 fill:#ff9999,stroke:#000,stroke-width:2px style ReturnDist1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnDist2 fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the distanceTo function:

  1. The process begins by checking for provided shArgs and processing them if available.

  2. It sets the node component types for the operation.

  3. The function retrieves the source position (GetSrcPos).

  4. It determines the destination position, which can be either a list or an object (GetDestPos).

  5. Distance calculation varies based on the type of destination: list (CalcDistList) or object (CalcDistObj).

  6. If the getNode option is true, it returns detailed node information, including measuring node and locator list.

  7. If getNode is false, it simply returns the measured distance (mDist).

  8. The process concludes with either returning the node details or the distance, based on the getNode parameter.

asNode.distanceTo_BB(self, sel02, **shArgs)#

[shArgs : s2=sel02]

Purpose:

:: Measures the distance between the bounding box of the asNode and another selected object. This function is often used in scene layout and collision detection.

Parameters:

sel02 – <asNode> #The second object to measure the distance to.

Returns:

<float> #The distance between the bounding boxes of the asNode and the specified object.

_images/distanceTo_BB.jpg
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> GetBB_A["/fas:fa-cube Get Bounding Box A"] GetBB_A --> GetBB_B["/fas:fa-cube-alt Get Bounding Box B"] GetBB_B --> CalcCenter_A["/fas:fa-dot-circle Calc Center A"] CalcCenter_A --> CalcCenter_B["/fas:fa-dot-circle Calc Center B"] CalcCenter_B --> CalcDistance["/fas:fa-ruler-combined Calculate Distance"] CalcDistance --> ReturnDistance[("fas:fa-tape Return Distance")] ReturnDistance --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style GetBB_A fill:#99ff99,stroke:#000,stroke-width:2px style GetBB_B fill:#99ff99,stroke:#000,stroke-width:2px style CalcCenter_A fill:#cc99ff,stroke:#000,stroke-width:2px style CalcCenter_B fill:#cc99ff,stroke:#000,stroke-width:2px style CalcDistance fill:#99ccff,stroke:#000,stroke-width:2px style ReturnDistance fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the distanceTo_BB function:

  1. The process begins by checking for provided shArgs and processing them if available.

  2. It sets the node component types for the operation.

  3. Retrieves the bounding box for the first object (GetBB_A).

  4. Retrieves the bounding box for the second object (GetBB_B).

  5. Calculates the center point of the first object’s bounding box (CalcCenter_A).

  6. Calculates the center point of the second object’s bounding box (CalcCenter_B).

  7. Measures the distance between the center points of the two bounding boxes (CalcDistance).

  8. Returns the calculated distance between the bounding boxes.

asNode.dupeNVersionUp(self, **shArgs)#

[shArgs]

Purpose:

:: Creates a duplicate of the asNode and increments its version or naming sequence. This is commonly used for creating iterative backups or variations of nodes.

Returns:

<asNode> #The duplicated and versioned-up asNode.

_images/dupeNVersionUp.jpg
Flow Chart Description:

This flowchart illustrates the dupeNVersionUp function:

  1. The process starts by checking if shArgs are provided and processes them if available.

  2. It sets the node component types for the operation.

  3. Selects the original node to be duplicated.

  4. Creates a duplicate of the selected node.

  5. Retrieves the duplicated node.

  6. Selects the entire hierarchy of the duplicated node.

  7. Reverses the selection order of the nodes.

  8. Iterates through each node in the reversed selection.

  9. Splits the name of each node.

  10. Increments the version or naming sequence of each node.

  11. Renames each node with the new versioned name.

  12. Continues the loop until all nodes are processed.

  13. Renames the duplicate group with the versioned name.

  14. Returns the duplicated and versioned-up node.

asNode.duplicate(self, centerPiv=False, grpLevel=0, parent=None, unParent=False, suffix=None, name=None, instance=0, uniqueNames=1, parentOnly=0, **kwargs)#

[shArgs : cp=centerPiv, gl=grpLevel, p=parent, up=unParent, sfx=suffix, n=name, i=instance, un=uniqueNames, po=parentOnly]

Purpose:

:: Duplicates the asNode with various options like centering the pivot, grouping, parenting, and naming. Widely used in modeling, rigging, and scene setup.

Parameters:
  • centerPiv – <bool> #Centers the pivot of the duplicate.

  • grpLevel – <int> #The number of groups to be added above the duplicate.

  • parent – <asNode, optional> #The parent node for the duplicate.

  • unParent – <bool> #Determines whether to unparent the duplicate.

  • suffix – <str, optional> #The suffix to be added to the duplicate’s name.

  • name – <str, optional> #The name for the duplicate.

  • instance – <bool> #Creates an instance of the asNode instead of a full duplicate.

  • uniqueNames – <bool> #Ensures the duplicate has a unique name.

  • parentOnly – <bool> #Duplicates only the parent node of the asNode.

Returns:

<list/asNode> #A list containing the duplicate and optionally its group.

Example:

if grpLevel:
        dupGrp =dupNode.grpIt(dupNode, grpLevel)[-1]
        return [dupNode, dupGrp]
else:
        return [asNode(dupNode)]
_images/duplicate.jpg
Flow Chart Description:

This flowchart illustrates the duplicate function:

  1. The process begins with checking if shArgs are provided and processes them accordingly.

  2. Node component types are set for the operation.

  3. The original node is selected for duplication.

  4. Checks if an instance is to be created, or if only the parent node is to be duplicated.

  5. Depending on the choice, creates an instance or duplicates the node.

  6. Processes any specified name or suffix for the duplicate.

  7. Renames the duplicate or instance as needed.

  8. Checks if a group level is specified and groups the duplicate accordingly.

  9. Returns the duplicate node and its group, if created.

asNode.edg(self, num=0, getNode=1, checkCount=8, **shArgs)#

[shArgs : num=number, gn=getNode, cc=checkCount]

Purpose:

:: Retrieves an edge from a mesh object in Maya. Primarily used in modeling and rigging to manipulate and analyze mesh edges.

Parameters:
  • num – <int> #The index number of the edge to retrieve.

  • getNode – <bool> #Determines whether to return the edge as a node.

  • checkCount – <bool> #Checks whether the specified edge index is within the valid range.

Returns:

<asNode> #The specified edge as an asNode. returns asNode for Edge. Use asN.e(num)

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> GetObjName["/fas:fa-tag Get ObjName"] GetObjName --> GetEdgList["/fas:fa-th-list Get EdgList"] GetEdgList --> CheckEdgeIndex{{"/fas:fa-check-circle Check Edge Index"}} CheckEdgeIndex --"If index is out of range" --> ReturnNone1[("fas:fa-times-circle Return None")] CheckEdgeIndex --"If index is within range" --> CheckNodeType{{"/fas:fa-question-circle Check NodeType"}} CheckNodeType --"If NodeType is 'mesh'" --> CheckGetNode{{"/fas:fa-question-circle Check getNode"}} CheckGetNode --"If getNode is True" --> ReturnEdgeNode["/fas:fa-link Return Edge Node"] CheckGetNode --"If getNode is False" --> ReturnEdgeString["/fas:fa-code Return Edge String"] ReturnEdgeNode --> End[("fas:fa-stop End")] ReturnEdgeString --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style GetObjName fill:#99ff99,stroke:#000,stroke-width:2px style GetEdgList fill:#cc99ff,stroke:#000,stroke-width:2px style CheckEdgeIndex fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnNone1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckNodeType fill:#cc99ff,stroke:#000,stroke-width:2px style CheckGetNode fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnEdgeNode fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEdgeString fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the edg function:

  1. The process starts by checking if shArgs are provided and processes them accordingly.

  2. Node component types are set for the operation.

  3. Retrieves the name of the object and the list of its edges.

  4. Checks if the requested edge index is within the valid range of the edge list.

  5. If the index is out of range, it returns None.

  6. If the index is valid, checks the node type of the object.

  7. Depending on the getNode parameter, either returns the edge as a node or as a string reference.

  8. Concludes by returning the specified edge in the desired format.

asNode.extendToChild(self, numChild=1, **shArgs)#

[shArgs : nc=numChild]

Purpose:

:: Extends the asNode to include a specified number of child nodes in the hierarchy. This function is often used in rigging and scene organization for expanding node hierarchies.

Parameters:

numChild – <int> #The number of child levels to include in the extension.

Returns:

<None> #No return value, extends the hierarchy of the asNode to include the specified child nodes.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> RetrieveChildNode["/fas:fa-sitemap Retrieve Child Node"] RetrieveChildNode --> CheckChildExistence{{"/fas:fa-check-circle Check Child Existence"}} CheckChildExistence --"If Child Exists" --> ReturnChildNode["/fas:fa-arrow-right Return Child Node"] CheckChildExistence --"If Child Does Not Exist" --> ReturnNone[("fas:fa-times-circle Return None")] ReturnChildNode --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveChildNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckChildExistence fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnChildNode fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the extendToChild function:

  1. The process starts by checking if shArgs are provided and processes them accordingly.

  2. Sets the node component types for the operation.

  3. Retrieves the child node at the specified hierarchy level based on numChild.

  4. Checks if the retrieved child node exists.

  5. If the child node exists, it returns the child node.

  6. If the child node does not exist, it returns None.

  7. The process concludes by returning either the child node or None, depending on the existence of the child.

asNode.extendToParent(self, numParent=1, **shArgs)#

[shArgs : np=numParent]

Purpose:

:: Extends the asNode to include a specified number of parent nodes in the hierarchy. Used in rigging and scene organization to integrate node hierarchies more deeply.

Parameters:

numParent – <int> #The number of parent levels to include in the extension.

Returns:

<None> #No return value, extends the hierarchy of the asNode to include the specified parent nodes.

_images/extendToParent.jpg
Flow Chart Description:

This flowchart illustrates the extendToParent function:

  1. The process starts by checking if shArgs are provided and processes them accordingly.

  2. Sets the node component types for the operation.

  3. Retrieves the parent node at the specified hierarchy level based on numParent.

  4. Checks if the retrieved parent node exists.

  5. If the parent node exists, it returns the parent node.

  6. If the parent node does not exist, it returns None.

  7. The process concludes by returning either the parent node or None, depending on the existence of the parent.

asNode.extendToShape(self, **shArgs)#

[shArgs]

Purpose:

:: Extends the asNode to its shape node, commonly used in operations where working directly with the shape node is necessary, such as in detailed modeling or rigging tasks.

Returns:

<asNode> #The shape node associated with the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> ExtendToShapeNode["/fas:fa-arrow-right Extend to Shape Node"] ExtendToShapeNode --> CheckShapeExistence{{"/fas:fa-check-circle Check Shape Existence"}} CheckShapeExistence --"If Shape Exists" --> ReturnShapeNode["/fas:fa-cube Return Shape Node"] CheckShapeExistence --"If Shape Does Not Exist" --> ReturnNone[("fas:fa-times-circle Return None")] ReturnShapeNode --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style ExtendToShapeNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckShapeExistence fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnShapeNode fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the extendToShape function:

  1. The process starts by checking if shArgs are provided and processes them accordingly.

  2. Sets the node component types for the operation.

  3. Extends the node to its associated shape node.

  4. Checks if the shape node exists.

  5. If the shape node exists, it returns the shape node.

  6. If the shape node does not exist, it returns None.

  7. The process concludes by returning either the shape node or None, depending on the existence of the shape.

asNode.extractNum(self, fromEnd=True, skipCount=0, **shArgs)#

[shArgs : fe=fromEnd, sc=skipCount]

Purpose:

:: Extracts a numeric value from the asNode’s name, typically used for sorting, iterations, or identifying sequence numbers in node names.

Parameters:
  • fromEnd – <bool> #Determines whether to extract the number from the end of the node name.

  • skipCount – <int> #The number of characters to skip before starting the extraction.

Returns:

<list> #A list containing the extracted number and the remaining part of the node name. return [num, numStr] #_ the extracted number from end of the object name

Usage:

obj.vtx[105] # Returns 105 obj.e[206] # Returns 206

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> ExtractNumber["/fas:fa-sort-numeric-down Extract Number"] ExtractNumber --"If fromEnd is True" --> ExtractFromEnd{{"/fas:fa-arrow-alt-circle-right Extract From End"}} ExtractNumber --"If fromEnd is False" --> ExtractFromStart{{"/fas:fa-arrow-alt-circle-left Extract From Start"}} ExtractFromEnd --> ReturnNumberEnd[("fas:fa-tape Return Number (End)")] ExtractFromStart --> ReturnNumberStart[("fas:fa-tape Return Number (Start)")] ReturnNumberEnd --> End[("fas:fa-stop End")] ReturnNumberStart --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style ExtractNumber fill:#99ff99,stroke:#000,stroke-width:2px style ExtractFromEnd fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractFromStart fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnNumberEnd fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNumberStart fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the extractNum function:

  1. The process starts by checking if shArgs are provided and processes them accordingly.

  2. Sets the node component types for the operation.

  3. Extracts a numeric value from the node’s name.

  4. Determines the extraction point based on the fromEnd parameter.

  5. Returns the extracted number from either the end or the start of the node name, along with the remaining part of the name.

asNode.freeze(self, **kwargs)#

[shArgs]

Purpose:

:: Freezes transformations of the asNode, a common operation in rigging and modeling to reset the transformation values while maintaining the current state.

Returns:

<None> #No return value, freezes the transformations of the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetDefaultArgs["/fas:fa-tools Set Default Args"] ProcessShArgs --> SetNcTypes SetDefaultArgs --> SetNcTypes["/fas:fa-stream Set ncTypes"] SetNcTypes --> SelectNode["/fas:fa-mouse-pointer Select Node"] SelectNode --> ApplyFreezeTransform["/fas:fa-snowflake Apply Freeze Transform"] ApplyFreezeTransform --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultArgs fill:#99ccff,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ff99,stroke:#000,stroke-width:2px style SelectNode fill:#99ccff,stroke:#000,stroke-width:2px style ApplyFreezeTransform fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the freeze function:

  1. The process starts by checking if kwargs are provided and processes them accordingly.

  2. If no kwargs are provided, default arguments are set based on whether the node is a joint or not.

  3. Sets the node component types for the operation.

  4. Selects the node to apply the freeze transformation to.

  5. Applies the freeze transformation to the node.

asNode.fullName(self, **shArgs)#

[shArgs]

Purpose:

:: Retrieves the full path name of the asNode within the Maya scene hierarchy.

  • It is useful whenever world space calculations are made.

  • This function is essential for scripts that require precise identification of nodes, especially in complex scenes with multiple hierarchies.

Returns:

<str> #The complete path name from the root to the asNode.

_images/fullName.jpg
Flow Chart Description:

This flowchart illustrates the fullName function:

  1. The process begins by checking if shArgs are provided.

  2. Retrieves the Dag Path of the node.

  3. Checks if component numbers exist for the node.

  4. Adjusts the Dag Path if component numbers are present.

  5. Retrieves the full path name of the node using the DagNode function.

  6. Returns the complete path name from the root to the node.

asNode.getAffectedJnts_IkHand(self, ikHand=None, **shArgs)#

[shArgs : ih=ikHand]

Purpose:

:: Retrieves a list of joints affected by a given IK handle. This function is widely used in rigging, especially in character setup, to understand and manipulate IK chains.

Parameters:

ikHand – <asNode, optional> #The IK handle to query for affected joints.

Returns:

<list> #List of joints affected by the specified IK handle.

_images/getAffectedJnts_IkHand.jpg
Flow Chart Description:

This flowchart illustrates the getAffectedJnts_IkHand function:

  1. The process begins by checking if shArgs are provided and updates ikHand accordingly.

  2. It validates the provided ikHand or selects it if not provided.

  3. After validation, it retrieves the start joint and end effector of the ikHand.

  4. The function iteratively retrieves all joints affected by the ikHand, adding each joint to a list.

  5. It then reverses the joint list to maintain the hierarchy order and returns the list of IK joints.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> CheckIkHand{"/fas:fa-check-square Check IK Hand"} CheckIkHand --"If IK Hand Not Provided"--> GetSelectedIKHand["/fas:fa-mouse-pointer Get Selected IK Hand"] CheckIkHand --"If IK Hand Provided"--> ValidateIkHand["/fas:fa-check Validate IK Hand"] GetSelectedIKHand --> ValidateIkHand ValidateIkHand --> GetStartJoint{"/fas:fa-check-square Get Start Joint"} GetStartJoint --> GetEndEffector{"/fas:fa-check-square Get End Effector"} GetEndEffector --> GetEndJoint{"/fas:fa-check-square Get End Joint"} GetEndJoint --> GetAffectedJoints{"/fas:fa-check-square Get Affected Joints"} GetAffectedJoints --> ReverseJointList{"/fas:fa-undo Reverse Joint List"} ReverseJointList --> End["/fas:fa-stop End"] ParseShArgs --> SetParameters["/fas:fa-cogs Set Parameters"] SetParameters --> CheckIkHand style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitializeParameters fill:#99ccff,stroke:#000,stroke-width:2px style CheckIkHand fill:#cc99ff,stroke:#000,stroke-width:2px style GetSelectedIKHand fill:#99ff99,stroke:#000,stroke-width:2px style ValidateIkHand fill:#ccffcc,stroke:#000,stroke-width:2px style GetStartJoint fill:#99ccff,stroke:#000,stroke-width:2px style GetEndEffector fill:#cc99ff,stroke:#000,stroke-width:2px style GetEndJoint fill:#ffcc99,stroke:#000,stroke-width:2px style GetAffectedJoints fill:#99ff99,stroke:#000,stroke-width:2px style ReverseJointList fill:#ffcc99,stroke:#000,stroke-width:2px style SetParameters fill:#ccffcc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getAffectedJnts_IkHand function:

  1. Checks if shArgs exist, and if so, parses the ih from it.

  2. If shArgs do not exist, initializes parameters with default values.

  3. Checks if an IK handle is provided; if not, retrieves the selected IK handle.

  4. Validates the provided or selected IK handle.

  5. Retrieves the start joint connected to the IK handle.

  6. Retrieves the end effector connected to the IK handle.

  7. Retrieves the end joint connected to the end effector.

  8. Iteratively retrieves all joints affected by the IK handle, adding each joint to a list.

  9. Reverses the joint list to maintain the hierarchy order.

asNode.getAttr(self, attr, *args, **kwargs)#

[shArgs : a=attr]

Purpose:

:: Retrieves the value of a specified attribute from an asNode. This function is commonly used in scripts for dynamic attribute access and manipulation within Maya.

Parameters:

attr – <str> #The name of the attribute to retrieve from the asNode.

Returns:

<various> #Returns the value of the specified attribute, with the type depending on the attribute’s data type.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> UpdateAttrName["/fas:fa-sync-alt Update Attr Name"] CheckShArgs --"If shArgs is not provided" --> PrepareAttr["/fas:fa-wrench Prepare Attr"] UpdateAttrName --> PrepareAttr PrepareAttr --> RetrieveAttrValue{{"/fas:fa-tags Retrieve Attr Value"}} RetrieveAttrValue --"Retrieve attribute value" --> EvaluateType["/fas:fa-cube Evaluate Type"] EvaluateType --"Based on attribute type" --> ProcessAttrValue["/fas:fa-cogs Process Attr Value"] ProcessAttrValue --"Return processed value" --> ReturnAttrValue[("fas:fa-arrow-right Return Attr Value")] EvaluateType --"If TypeError occurs" --> HandleTypeError["/fas:fa-exclamation-triangle Handle TypeError"] HandleTypeError --"Process TypeError" --> ReturnAttrValue EvaluateType --"If RuntimeError occurs" --> HandleRuntimeError["/fas:fa-exclamation-triangle Handle RuntimeError"] HandleRuntimeError --"Process RuntimeError" --> ReturnAttrValue ReturnAttrValue --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAttrName fill:#99ccff,stroke:#000,stroke-width:2px style PrepareAttr fill:#99ff99,stroke:#000,stroke-width:2px style RetrieveAttrValue fill:#ffcc00,stroke:#000,stroke-width:2px style EvaluateType fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessAttrValue fill:#99ccff,stroke:#000,stroke-width:2px style HandleTypeError fill:#ff6666,stroke:#000,stroke-width:2px style HandleRuntimeError fill:#ff6666,stroke:#000,stroke-width:2px style ReturnAttrValue fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getAttr function:

  1. The function starts by checking if shArgs are provided and updates the attribute name accordingly.

  2. It then prepares the attribute for retrieval by combining the asNode name and the attribute name.

  3. The attribute value is retrieved, and its type is evaluated for processing.

  4. The function handles any potential TypeError or RuntimeError during the retrieval process.

  5. Finally, the processed attribute value is returned.

asNode.getChildren(self, type=None, childImplied=True, excludeShape=0, **kwargs)#

[shArgs : t=type, ci=childImplied, es=excludeShape]

Purpose:

:: Retrieves child nodes of a specific type from the asNode. This function is useful in scenarios where only children of a certain type are relevant, such as in rigging or scene organization.

Parameters:
  • type – <str, optional> #The type of children to retrieve.

  • childImplied – <bool> #Determines whether to include implied children based on their relationship with the asNode.

  • excludeShape – <bool> #Determines whether to exclude shape nodes from the retrieved children.

Returns:

<list> #A list of child nodes of the specified type.

_images/getChildren.jpg
Flow Chart Description:

This flowchart illustrates the getChildren function:

  1. The process starts by checking if shArgs are provided and updating parameters accordingly.

  2. All children of the asNode are listed.

  3. If childImplied is True, the implied child is included in the list.

  4. The children are then filtered based on the specified type.

  5. If excludeShape is True, shape nodes are excluded from the list.

  6. For constraints, a specific filtering process is applied.

  7. Finally, the list of children matching the criteria is returned.

asNode.getClosestDist_Msh(self, meshObj, **shArgs)#

[shArgs : mo=meshObj]

Purpose:

:: Calculates the closest distance from the asNode to a specified mesh object. This function is often used in modeling, rigging, and collision detection within Maya.

Parameters:

meshObj – <asNode> #The mesh object to calculate the closest distance to.

Returns:

<float> #mDist -The closest distance from the asNode to the specified mesh object.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CreateCPOMNode["/fas:fa-network-wired Create CPOM Node"] CreateCPOMNode --> GetLocatorPosition["/fas:fa-map-marker-alt Get Locator Position"] GetLocatorPosition --> SetInitialPosition["/fas:fa-pencil-alt Set Initial Position"] SetInitialPosition --> ConnectMeshToWorldMatrix["/fas:fa-link Connect Mesh to World Matrix"] ConnectMeshToWorldMatrix --> ConnectMeshToCPOM["/fas:fa-link Connect Mesh to CPOM"] ConnectMeshToCPOM --> GetTargetPosition{{"/fas:fa-crosshairs Get Target Position"}} GetTargetPosition --> CalculateDistance{{"/fas:fa-ruler-combined Calculate Distance"}} CalculateDistance --> DeleteCPOMNode["/fas:fa-trash-alt Delete CPOM Node"] DeleteCPOMNode --> ReturnDistance[("fas:fa-tape Return Distance")] ReturnDistance --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CreateCPOMNode fill:#99ff99,stroke:#000,stroke-width:2px style GetLocatorPosition fill:#ffcc00,stroke:#000,stroke-width:2px style SetInitialPosition fill:#99ccff,stroke:#000,stroke-width:2px style ConnectMeshToWorldMatrix fill:#99ff99,stroke:#000,stroke-width:2px style ConnectMeshToCPOM fill:#99ff99,stroke:#000,stroke-width:2px style GetTargetPosition fill:#ffcc00,stroke:#000,stroke-width:2px style CalculateDistance fill:#cc99ff,stroke:#000,stroke-width:2px style DeleteCPOMNode fill:#ff9999,stroke:#000,stroke-width:2px style ReturnDistance fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getClosestDist_Msh function:

  1. The process begins by checking if shArgs are provided and updating parameters as needed.

  2. A CPOM (Closest Point On Mesh) node is created to calculate the distance.

  3. The initial position of the locator is set and connected to the mesh’s world matrix.

  4. The closest point on the mesh to the locator is determined.

  5. The distance is calculated from the locator’s position to this closest point.

  6. After the calculation, the CPOM node is deleted.

  7. The function returns the calculated distance.

asNode.getClosestParam_Crv(self, curvName, getLoc=True, **shArgs)#

[shArgs : cn=curvName, gl=getLoc, ap=attachToPath]

Purpose:

:: Determines the closest parameter point on a curve from the asNode. This function is frequently used in rigging and animation for path constraints and motion paths.

Parameters:
  • curvName – <str> #The name of the curve to evaluate.

  • getLoc – <bool> #Indicates whether to return a locator at the closest point on the curve.

  • attachToPath – <bool> #Determines whether to attach the asNode to the curve at the closest point.

Returns:

<various> #The closest parameter point on the curve, optionally including a locator.

_images/getClosestParam_Crv.jpg
Flow Chart Description:

This flowchart illustrates the getClosestParam_Crv function:

  1. The process starts by checking if shArgs are provided and processes any arguments.

  2. It then creates an AsCurv node for the specified curve.

  3. The position of the asNode is obtained to determine the closest point on the curve.

  4. The FnCurv is initialized to perform curve-related calculations.

  5. The closest position on the curve to the asNode is identified.

  6. This position is converted to an MPoint for further calculations.

  7. The closest parameter pointer on the curve is calculated.

  8. Finally, the function returns the closest parameter point on the curve.

asNode.getClosestPos_Crv(self, curvName, getLoc=True, getNPOC=False, **shArgs)#

[shArgs : cn=curvName, gl=getLoc, gnp=getNPOC]

Purpose:

:: Retrieves the closest position on a curve relative to the asNode’s position. Used in rigging and animation for aligning objects along curves.

Parameters:
  • curvName – <str> #The curve to find the closest position on.

  • getLoc – <bool> #Specifies whether to return a locator at the closest position.

  • getNPOC – <bool> #Indicates whether to get the nearest point on curve.

Returns:

<list/asNode> #The closest position on the curve, optionally including a locator. if getLoc:

if getNPOC:

return [destLoc, nameNPOC]

else:

return [destLoc]

else: #_ Returns closest pos
if getNPOC:

return [closestPos, nameNPOC]

else:

return [closestPos]

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CreateNPOCNode["/fas:fa-project-diagram Create NPOC Node"] ProcessShArgs --> CreateNPOCNode CreateNPOCNode --> GetAsNodePos["/fas:fa-map-marker-alt Get AsNode Position"] GetAsNodePos --> SetInitialPosNPOC["/fas:fa-pencil-alt Set Initial Position on NPOC"] SetInitialPosNPOC --> ConnectCurveToNPOC["/fas:fa-link Connect Curve to NPOC"] ConnectCurveToNPOC --> GetClosestPosOnCurve{{"/fas:fa-crosshairs Get Closest Position on Curve"}} GetClosestPosOnCurve --> CheckGetLoc{{"/fas:fa-question-circle Check getLoc"}} CheckGetLoc --"If getLoc is True" --> CreateLocator["/fas:fa-map-marker-alt Create Locator"] CreateLocator --> MoveLocatorToPos["/fas:fa-arrows-alt Move Locator to Position"] MoveLocatorToPos --> CheckGetNPOC2{{"/fas:fa-question-circle Check getNPOC"}} CheckGetNPOC --"If getNPOC is True" --> ReturnPosNPOC[("fas:fa-arrow-circle-right Return Position and NPOC")] CheckGetNPOC --"If getNPOC is False" --> DeleteNPOCNode["/fas:fa-trash-alt Delete NPOC Node"] CheckGetNPOC2 --"If getNPOC is True" --> ReturnLocatorNPOC[("fas:fa-arrow-circle-right Return Locator and NPOC")] CheckGetNPOC2 --"If getNPOC is False" --> DeleteNPOCNode2["/fas:fa-trash-alt Delete NPOC Node"] ReturnPosNPOC --> End[("fas:fa-stop End")] ReturnLocatorNPOC --> End DeleteNPOCNode --> ReturnPos[("fas:fa-arrow-circle-right Return Position")] DeleteNPOCNode2 --> ReturnLocator[("fas:fa-arrow-circle-right Return Locator")] ReturnPos --> End ReturnLocator --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CreateNPOCNode fill:#99ccff,stroke:#000,stroke-width:2px style GetAsNodePos fill:#99ff99,stroke:#000,stroke-width:2px style SetInitialPosNPOC fill:#99ccff,stroke:#000,stroke-width:2px style ConnectCurveToNPOC fill:#99ff99,stroke:#000,stroke-width:2px style GetClosestPosOnCurve fill:#ffcc00,stroke:#000,stroke-width:2px style CheckGetLoc fill:#cc99ff,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style MoveLocatorToPos fill:#99ccff,stroke:#000,stroke-width:2px style CheckGetNPOC fill:#cc99ff,stroke:#000,stroke-width:2px style CheckGetNPOC2 fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnPosNPOC fill:#00cc00,stroke:#000,stroke-width:2px style ReturnLocatorNPOC fill:#00cc00,stroke:#000,stroke-width:2px style DeleteNPOCNode fill:#ff9999,stroke:#000,stroke-width:2px style DeleteNPOCNode2 fill:#ff9999,stroke:#000,stroke-width:2px style ReturnPos fill:#00cc00,stroke:#000,stroke-width:2px style ReturnLocator fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getClosestPos_Crv function:

  1. The process starts by checking if shArgs are provided and processing any arguments.

  2. It creates a Nearest Point on Curve (NPOC) node for the specified curve.

  3. The asNode’s position is obtained to find the closest point on the curve.

  4. The initial position on the NPOC node is set based on the asNode’s position.

  5. The curve is then connected to the NPOC node.

  6. The closest position on the curve to the asNode is identified.

  7. If getLoc is true, a locator is created and moved to the closest position.

  8. If getNPOC is true, the function returns the position and the NPOC node; otherwise, it deletes the NPOC node.

  9. The function returns either the position or the locator, based on getLoc and getNPOC.

asNode.getClosestPos_Msh(self, meshObj, getLoc=True, **shArgs)#

[shArgs : mo=meshObj, gl=getLoc]

Purpose:

:: Calculates the closest position on a mesh from the asNode. This function is essential in deformation, collision detection, and spatial analysis within Maya.

Parameters:
  • meshObj – <asNode> #The mesh object to calculate the closest position to.

  • getLoc – <bool> #Specifies whether to return a locator at the closest position on the mesh.

Returns:

<list/asNode> #The closest position on the mesh, optionally including a locator. if getLoc:

return posLoc #_ asNode

else:

return [x, y, z] #_ locPos

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CreateCPOMNode["/fas:fa-network-wired Create CPOM Node"] ProcessShArgs --> CreateCPOMNode CreateCPOMNode --> GetLocatorPosition["/fas:fa-map-marker-alt Get Locator Position"] GetLocatorPosition --> SetInitialPosition["/fas:fa-pencil-alt Set Initial Position"] SetInitialPosition --> ConnectMeshToWorldMatrix["/fas:fa-link Connect Mesh to World Matrix"] ConnectMeshToWorldMatrix --> ConnectMeshToCPOM["/fas:fa-link Connect Mesh to CPOM"] ConnectMeshToCPOM --> GetTargetPosition{{"/fas:fa-crosshairs Get Target Position"}} GetTargetPosition --> CheckGetLoc{{"/fas:fa-question-circle Check getLoc"}} CheckGetLoc --"If getLoc is True" --> CreateLocator["/fas:fa-map-marker-alt Create Locator"] CreateLocator --> SnapLocatorToPosition["/fas:fa-magnet Snap Locator to Position"] SnapLocatorToPosition --> DeleteCPOMNode["/fas:fa-trash-alt Delete CPOM Node"] DeleteCPOMNode --> ReturnLocator[("fas:fa-check-circle Return Locator")] CheckGetLoc --"If getLoc is False" --> DeleteCPOMNode2["/fas:fa-trash-alt Delete CPOM Node"] DeleteCPOMNode2 --> ReturnPosition[("fas:fa-check-circle Return Position")] ReturnLocator --> End[("fas:fa-stop End")] ReturnPosition --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CreateCPOMNode fill:#99ff99,stroke:#000,stroke-width:2px style GetLocatorPosition fill:#99ff99,stroke:#000,stroke-width:2px style SetInitialPosition fill:#99ccff,stroke:#000,stroke-width:2px style ConnectMeshToWorldMatrix fill:#99ff99,stroke:#000,stroke-width:2px style ConnectMeshToCPOM fill:#99ff99,stroke:#000,stroke-width:2px style GetTargetPosition fill:#ffcc00,stroke:#000,stroke-width:2px style CheckGetLoc fill:#cc99ff,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style SnapLocatorToPosition fill:#99ccff,stroke:#000,stroke-width:2px style DeleteCPOMNode fill:#ff9999,stroke:#000,stroke-width:2px style ReturnLocator fill:#00cc00,stroke:#000,stroke-width:2px style DeleteCPOMNode2 fill:#ff9999,stroke:#000,stroke-width:2px style ReturnPosition fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getClosestPos_Msh function:

  1. The process starts by checking if shArgs are provided and processing them.

  2. A Closest Point on Mesh (CPOM) node is created for the specified mesh object.

  3. The asNode’s position is obtained as the initial position for the CPOM node.

  4. The initial position on the CPOM node is set, and the mesh is connected to the CPOM node.

  5. The closest position on the mesh to the asNode is identified.

  6. If getLoc is true, a locator is created and snapped to the closest position.

  7. The CPOM node is deleted, and the function returns either the locator or the position, based on getLoc.

asNode.getCluster(self, forMesh=False, grpLevel=1, clustName=None, mirrorClust=False, **shArgs)#

[shArgs : fm=forMesh, gl=grpLevel, cn=clustName, mc=mirrorClust]

Purpose:

:: Creates a cluster deformer on a specified mesh or component. This function is used in rigging and modeling for localized deformation of geometry.

Parameters:
  • forMesh – <bool> #Indicates whether the cluster is for a mesh.

  • grpLevel – <int> #The number of group nodes above the cluster.

  • clustName – <str, optional> #The name for the cluster deformer.

  • mirrorClust – <bool> #Specifies whether to create a mirrored cluster.

return:

<list> #A list containing the cluster node and optionally its group.
trgtList : cvList | vtxList | faceList
return [asClust, clustName + '_Node'] #_ asClust is asNode and Handle
_images/getCluster.jpg
Flow Chart Description:

This flowchart illustrates the getCluster function:

  1. The process starts by checking if shArgs are provided and processing them.

  2. Verifies if the target is a vertex/CV or a mesh/curve.

  3. Selects the target for cluster creation based on its type.

  4. Creates a cluster deformer on the selected target.

  5. Renames the cluster deformer as specified in clustName.

  6. Groups the cluster if grpLevel is specified.

  7. The function returns the cluster deformer and optionally its group.

asNode.getClusterCtrl(self, grpLevel=1, ctrlMirror=0, sidePrfxes=None, name=None, parentGrp=None, scaleVal=0.1, globalCtrl=None, **shArgs)#

[shArgs : gl=grpLevel, cm=ctrlMirror, sp=sidePrfxes, n=name, pg=parentGrp, sv=scaleVal, gc=globalCtrl]

_images/getClusterCtrl.jpg

Purpose:

:: Attaches a control to a cluster, typically used in advanced rigging setups.

  • This function allows for easy manipulation of cluster deformations via custom controls.

  • #asVtx =asNode(‘pSphere1.vtx[277]’)

Parameters:
  • grpLevel – <int> #The number of group nodes above the control.

  • ctrlMirror – <bool> #Determines whether to create a mirrored control.

  • sidePrfxes – <list, optional> #Prefixes to define sides for the control, like ‘L_’ or ‘R_’.

  • name – <str, optional> #The name for the control.

  • parentGrp – <asNode, optional> #The parent group for the control.

  • scaleVal – <float> #The scale value for the control.

  • globalCtrl – <asNode, optional> #The global control to which the cluster control might be linked.

Returns:

<asNode> #The control attached to the cluster.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> DetermineSide["/fas:fa-balance-scale Determine Side"] ProcessShArgs --> DetermineSide DetermineSide --> SetControlName["/fas:fa-i-cursor Set Control Name"] SetControlName --> CreateRivetNode["/fas:fa-anchor Create Rivet Node"] CreateRivetNode --> CreateControl["/fas:fa-gamepad Create Control"] CreateControl --> SetControlAttributes["/fas:fa-sliders-h Set Control Attributes"] SetControlAttributes --> GroupControl["/fas:fa-object-group Group Control"] GroupControl --> CreateCluster["/fas:fa-compress-arrows-alt Create Cluster"] CreateCluster --> ConnectControlToCluster["/fas:fa-link Connect Control to Cluster"] ConnectControlToCluster --> CheckGlobalControl{{"/fas:fa-globe-americas Check Global Control"}} CheckGlobalControl --"If Global Control exists" --> ApplyScaleConstraint["/fas:fa-expand-arrows-alt Apply Scale Constraint"] CheckGlobalControl --"If Global Control does not exist" --> CheckMirrorControl{{"/fas:fa-mirror Check Mirror Control"}} ApplyScaleConstraint --> CheckMirrorControl CheckMirrorControl --"If Mirror Control is required" --> CreateMirrorControl["/fas:fa-copy Create Mirror Control"] CheckMirrorControl --"If Mirror Control is not required" --> FinalizeSetup[("fas:fa-check-circle Finalize Setup")] CreateMirrorControl --> FinalizeSetup FinalizeSetup --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style DetermineSide fill:#ffcc00,stroke:#000,stroke-width:2px style SetControlName fill:#99ccff,stroke:#000,stroke-width:2px style CreateRivetNode fill:#99ff99,stroke:#000,stroke-width:2px style CreateControl fill:#99ccff,stroke:#000,stroke-width:2px style SetControlAttributes fill:#99ff99,stroke:#000,stroke-width:2px style GroupControl fill:#ffcc00,stroke:#000,stroke-width:2px style CreateCluster fill:#99ff99,stroke:#000,stroke-width:2px style ConnectControlToCluster fill:#99ccff,stroke:#000,stroke-width:2px style CheckGlobalControl fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyScaleConstraint fill:#99ff99,stroke:#000,stroke-width:2px style CheckMirrorControl fill:#ffcc00,stroke:#000,stroke-width:2px style CreateMirrorControl fill:#99ccff,stroke:#000,stroke-width:2px style FinalizeSetup fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getClusterCtrl function:

  1. The process starts by checking if shArgs are provided and processing them.

  2. It determines the side of the cluster based on the asNode’s position.

  3. Sets the control name based on parameters like side prefixes and mirror control requirement.

  4. Creates a rivet node for the control to attach to.

  5. Generates the control and sets its attributes like scale and visibility.

  6. Groups the control for organizational purposes.

  7. Creates a cluster deformer and connects the control to it for manipulation.

  8. Checks if a global control is specified and applies a scale constraint if needed.

  9. Checks if a mirrored control is required and creates it.

  10. Finalizes the setup, integrating the control with the cluster and any global controls.

asNode.getConstraints(self, conType=None, **shArgs)#

[shArgs : ct=conType]

Purpose:

:: Retrieves a list of constraints applied to the asNode. This function is used in rigging and animation to manage and analyze node constraints.

Parameters:

conType – <str, optional> #The type of constraint to retrieve, such as ‘parentConstraint’ or ‘pointConstraint’.

return::

<list> #A list of constraints of the specified type applied to the asNode. conType - If None : Returns all types of constraints [asNode1, asNode2, ..] if asNodes else [] #_ Returns asNodes

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CheckIfConstrained{{"/fas:fa-unlock-alt Check If Constrained"}} CheckIfConstrained --"If Not Constrained" --> ReturnNone[("fas:fa-times-circle Return None")] CheckIfConstrained --"If Constrained" --> RetrieveAllConstraints["/fas:fa-list-ul Retrieve All Constraints"] RetrieveAllConstraints --> CheckConType{{"/fas:fa-filter Check ConType"}} CheckConType --"If conType is None" --> ReturnAllConstraints[("fas:fa-arrow-circle-right Return All Constraints")] CheckConType --"If conType is Specified" --> FilterConstraints{{"/fas:fa-tasks Filter Constraints"}} FilterConstraints --"For each Constraint Type" --> AppendToList{{"/fas:fa-plus-square Append to List"}} AppendToList --> ReturnFilteredConstraints[("fas:fa-arrow-circle-right Return Filtered Constraints")] ReturnNone --> End[("fas:fa-stop End")] ReturnAllConstraints --> End ReturnFilteredConstraints --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckIfConstrained fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style RetrieveAllConstraints fill:#ffcc00,stroke:#000,stroke-width:2px style CheckConType fill:#cc99ff,stroke:#000,stroke-width:2px style FilterConstraints fill:#99ccff,stroke:#000,stroke-width:2px style AppendToList fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFilteredConstraints fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getConstraints function:

  1. The process starts by checking if shArgs are provided and processing them.

  2. It checks if the asNode is constrained.

  3. If not constrained, the function returns None.

  4. If constrained, it retrieves all constraints applied to the asNode.

  5. Then, it checks if a specific constraint type is requested.

  6. If no specific type is requested, it returns all constraints.

  7. If a specific type is requested, it filters the constraints to match the specified type.

  8. It appends the filtered constraints to a list.

  9. Finally, it returns the filtered list of constraints.

asNode.getDirPos(self, destObjOrPos, extnRatio, locName='Extn_Loc', getLoc=True, getSpot=False, extnDist=None, trgtObj=None, **shArgs)#

[shArgs : do=destObjOrPos, er=extnRatio, ln=locName, gl=getLoc, gs=getSpot, ed=extnDist, to=trgtObj]

Purpose:

:: Calculates a directional position relative to the asNode, often used in rigging for dynamic placement of objects or controls.

Parameters:
  • destObjOrPos – <asNode/position> #The target object or position to calculate direction to.

  • extnRatio – <float> #The ratio for extending the direction.

  • locName – <str> #The name for the locator at the calculated position.

  • getLoc – <bool> #Specifies whether to return a locator at the calculated position.

  • getSpot – <bool> #Determines whether to calculate a spot position.

  • extnDist – <float> #The distance for extending the direction.

  • trgtObj – <asNode, optional> #The target object for additional directional calculations.

Returns:

<list/asNode> #The calculated directional position, optionally including a locator.

_images/getDirPos.jpg
Flow Chart Description:

This flowchart illustrates the getDirPos function:

  1. The process starts with parameter processing based on the given inputs.

  2. It calculates the directional vector between the asNode and the destination object or position.

  3. Locator handling is done based on the ‘getSpot’ parameter.

  4. Optional target object handling is performed if a target object is provided.

  5. The function returns the calculated directional position, which can include a locator or a spot position.

asNode.getDirVect(self, dirObjOrPos, **shArgs)#

[shArgs : do=dirObjOrPos]

Functionality by drawing “A –> B –> C”.
Here C is placed in the direction of A–>B
graph LR A --> B B --> C style C fill:#f9f,stroke:#333,stroke-width:4px

Purpose:

:: Calculates the directional vector from the asNode to a specified object or position. Used in rigging and animation for spatial calculations and alignments.

Parameters:

dirObjOrPos – <asNode/position> #The target object or position to calculate the directional vector towards.

Returns:

<list> #A vector representing the direction from the asNode to the specified target.

_images/getDirVect.jpg
Flow Chart Description:

This flowchart illustrates the getDirVect function:

  1. The process starts by checking if shArgs are provided. If so, it processes these arguments.

  2. Retrieves the position of the destination object or specified position.

  3. Acquires the source position of the asNode.

  4. Calculates the directional vector from the source position to the destination position.

  5. Returns the calculated directional vector.

asNode.getEdgList(self, get_asNodes=True, **shArgs)#

[shArgs : gan=get_asNodes]

Purpose:

:: Retrieves a list of edges from a mesh object. This function is key in modeling scripts where edge manipulation is required.

Parameters:

get_asNodes – <bool> #Determines whether to return the edges as asNode objects.

Returns:

<list> #A list of edges from the mesh object. if self.isNodeType(‘mesh’):

return [vtxList, numVtx]

_images/getEdgList.jpg
Flow Chart Description:

This flowchart illustrates the getEdgList function:

  1. Starts by checking if the asNode is of mesh type.

  2. If the asNode is a mesh, creates an iterator for mesh edges.

  3. Counts the total number of edges in the mesh.

  4. Generates a list of all edges in the mesh.

  5. Checks if the edges should be returned as asNode objects.

  6. If get_asNodes is True, converts the edge list to asNodes.

  7. Returns the final list of edges.

  8. If the asNode is not a mesh, returns an empty list.

asNode.getEndVtx(self, endDir='+', axis='x', useEditPoints=0, **shArgs)#

[shArgs : ed=endDir, ax=axis, uep=useEditPoints]

Purpose:

:: Identifies the end vertex of a geometry along a specified axis, often used in modeling and rigging for defining extremities of a mesh.

Parameters:
  • endDir – <str> #The direction in which to find the end vertex, such as ‘+’ or ‘-‘.

  • axis – <str> #The axis along which to evaluate the end vertex, e.g., ‘x’, ‘y’, or ‘z’.

  • useEditPoints – <bool> #Determines whether to consider edit points in the evaluation.

Returns:

<asNode> #The end vertex of the geometry along the specified axis.

graph TB Start[("fa:fa-play Start")] --> CheckGeometryType{{"/fas:fa-question-circle Check Geometry Type"}} CheckGeometryType --"If Curve" --> GetCurveVertices["/fas:fa-vector-square Get Curve Vertices"] GetCurveVertices --> CreateVtxDict["/fas:fa-table Create Vertex Position Dictionary"] CheckGeometryType --"If Mesh" --> GetMeshVertices["/fas:fa-cube Get Mesh Vertices"] GetMeshVertices --> CreateVtxDict CreateVtxDict --> DefineAxis["/fas:fa-arrows-alt Define Axis"] DefineAxis --> SortVertices{{"/fas:fa-sort Sort Vertices"}} SortVertices --"Sort based on Axis and EndDir" --> IdentifyEndVertex["/fas:fa-map-marker-alt Identify End Vertex"] IdentifyEndVertex --> ReturnEndVertex[("fas:fa-check-circle Return End Vertex")] ReturnEndVertex --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckGeometryType fill:#ffcc00,stroke:#000,stroke-width:2px style GetCurveVertices fill:#99ccff,stroke:#000,stroke-width:2px style GetMeshVertices fill:#99ccff,stroke:#000,stroke-width:2px style CreateVtxDict fill:#99ff99,stroke:#000,stroke-width:2px style DefineAxis fill:#ffcc00,stroke:#000,stroke-width:2px style SortVertices fill:#cc99ff,stroke:#000,stroke-width:2px style IdentifyEndVertex fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEndVertex fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getEndVtx function:

  1. Starts by checking the type of geometry of the asNode.

  2. If it’s a curve, retrieves the vertices considering edit points if specified.

  3. If it’s a mesh, retrieves the mesh vertices.

  4. Creates a dictionary mapping each vertex to its position.

  5. Defines the axis along which to evaluate the end vertex.

  6. Sorts the vertices based on the specified axis and direction (endDir).

  7. Identifies the end vertex based on the sorting.

  8. Returns the end vertex and its position.

asNode.getFaceList(self, **shArgs)#

[shArgs]

Purpose:

:: Retrieves a list of all face components of a mesh object. This function is essential in detailed mesh manipulation and analysis within Maya.

Returns:

<list> #A list of all face components of the mesh object. Returns:(asNodes)

graph TB Start[("fa:fa-play Start")] --> InitializeIterator["/fas:fa-sync-alt Initialize Mesh Polygon Iterator"] InitializeIterator --> CreateFaceList["/fas:fa-th-list Create Face List"] CreateFaceList --> IterateFaces{{"/fas:fa-repeat Iterate through Faces"}} IterateFaces --"For each Face" --> AppendFaceToList["/fas:fa-plus-square Append Face to List"] AppendFaceToList --> ReturnFaceList[("fas:fa-check-circle Return Face List")] ReturnFaceList --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style InitializeIterator fill:#99ccff,stroke:#000,stroke-width:2px style CreateFaceList fill:#ff9999,stroke:#000,stroke-width:2px style IterateFaces fill:#ffcc00,stroke:#000,stroke-width:2px style AppendFaceToList fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFaceList fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getFaceList function:

  1. The process begins by initializing a mesh polygon iterator for the asNode.

  2. Creates a list to store all face components.

  3. Iterates through each face component of the mesh object.

  4. Appends each face to the list as an asNode.

  5. Returns the complete list of face components of the mesh object.

asNode.getGroup(self, objName='as_EmptyGrp', emptyGrp=1, parent=None, grpLevel=0, snapPos=0, snapRot=0, **shArgs)#

[shArgs : on=objName, eg=emptyGrp, p=parent, gl=grpLevel, sp=snapPos, sr=snapRot]

Purpose:

:: Creates a group node in Maya, optionally with specific properties like name, parenting, and pivot snapping.

  • Commonly used in scene organization and rigging.

  • Returns an empty group or group as a child of a parent

Parameters:
  • objName – <str> #The name for the new group node.

  • emptyGrp – <bool> #Determines whether to create an empty group.

  • parent – <asNode, optional> #The node to parent the new group under.

  • grpLevel – <int> #The hierarchical level of the group node.

  • snapPos – <bool> #Determines whether to snap the group’s position to a target.

  • snapRot – <bool> #Determines whether to snap the group’s rotation to a target.

Returns:

<asNode> #The newly created group node.

_images/getGroup.jpg
Flow Chart Description:

This flowchart illustrates the getGroup function:

  1. Begins by checking and processing any provided shArgs.

  2. Creates a new group node in Maya with the specified name and properties.

  3. Checks if a group hierarchy level is specified.

  4. If grpLevel is set, creates a hierarchical structure of group nodes.

  5. Snaps and parents the top group node based on specified parameters.

  6. If no grpLevel is set, directly snaps and parents the created group node.

  7. Returns the newly created group node and its hierarchy if applicable.

asNode.getInputs(self, nType=None, historyLevel=0, ignoreSrc=1, **shArgs)#

[shArgs : nt=nType, hl=historyLevel, is=ignoreSrc]

Purpose:

:: Retrieves the input nodes connected to the asNode, often used in node-based operations like rigging, shading, and dynamics.

Parameters:
  • nType – <str, optional> #The type of input nodes to retrieve.

  • historyLevel – <int> #The depth of history to consider when retrieving input nodes.

  • ignoreSrc – <bool> #Determines whether to ignore certain source nodes in the retrieval.

Returns:

<list> #A list of input nodes connected to the asNode.

Example:

histNodes =mc.listHistory(self.name(), pdo=1, il=1, lv=historyLevel)
if histNodes:
        if len(histNodes) == 1:
                return histNodes[0]
        elif len(histNodes) > 1:
                return histNodes
else:
        return None
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> RetrieveHistoryNodes["/fas:fa-history Retrieve History Nodes"] ProcessShArgs --> RetrieveHistoryNodes RetrieveHistoryNodes --> CheckNodeTypeFilter{{"/fas:fa-filter Check Node Type Filter"}} CheckNodeTypeFilter --"If nType is Specified" --> FilterByNodeType["/fas:fa-filter-circle Filter by Node Type"] FilterByNodeType --> CheckIgnoreSrc{{"/fas:fa-eye-slash Check Ignore Src"}} CheckNodeTypeFilter --"If nType is Not Specified" --> CheckIgnoreSrc CheckIgnoreSrc --"If ignoreSrc is True" --> RemoveSrcNode["/fas:fa-minus-circle Remove Source Node"] CheckIgnoreSrc --"If ignoreSrc is False" --> ReturnInputs[("fas:fa-arrow-circle-right Return Inputs")] RemoveSrcNode --> ReturnInputs ReturnInputs --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style RetrieveHistoryNodes fill:#99ccff,stroke:#000,stroke-width:2px style CheckNodeTypeFilter fill:#99ff99,stroke:#000,stroke-width:2px style FilterByNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style CheckIgnoreSrc fill:#cc99ff,stroke:#000,stroke-width:2px style RemoveSrcNode fill:#99ccff,stroke:#000,stroke-width:2px style ReturnInputs fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getInputs function:

  1. Starts by checking and processing any provided shArgs.

  2. Retrieves the history nodes connected to the asNode up to a specified history level.

  3. Checks if a specific node type filter is applied.

  4. If nType is specified, filters the retrieved nodes by the specified node type.

  5. Checks if the ignoreSrc flag is set to True.

  6. If ignoreSrc is True, removes the source node (if present) from the list.

  7. Returns the list of input nodes connected to the asNode.

asNode.getLength(self, **shArgs)#

[shArgs]

Purpose:

:: Calculates the length of the asNode, typically used for measuring curves, edges, or bone chains in rigging and modeling.

Returns:

<float> #The length of the asNode.

_images/getLength.jpg
Flow Chart Description:

This flowchart illustrates the getLength function:

  1. The process begins by checking the node type of the asNode.

  2. If the node is a curve, a CurveInfo node is created.

  3. The curve is then connected to the CurveInfo node, and its length is calculated.

  4. The CurveInfo node is deleted after retrieving the length.

  5. If the node is a joint, the joint length is calculated directly.

  6. For other node types, the function returns 0 as they do not have a measurable length.

asNode.getOrigNode(self, **shArgs)#

[shArgs]

Purpose:

:: Retrieves the original node of a deformed geometry in Maya. This function is crucial in deformation workflows, particularly when working with blend shapes and skinning.

Returns:

<asNode> #The original node of the deformed geometry.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> GetShapeNode["/fas:fa-cube Get Shape Node"] ProcessShArgs --> GetShapeNode GetShapeNode --> GetNodeType["/fas:fa-code-branch Get Node Type"] GetNodeType --> RetrieveTweakNode{{"/fas:fa-wrench Retrieve Tweak Node"}} RetrieveTweakNode --"If Tweak Node Found" --> RetrieveOrigNodeFromTweak["/fas:fa-history Retrieve Orig Node From Tweak"] RetrieveTweakNode --"If No Tweak Node" --> RetrieveTweakFromHistory["/fas:fa-history-alt Retrieve Tweak From History"] RetrieveTweakFromHistory --> RetrieveOrigNodeFromTweak RetrieveOrigNodeFromTweak --> CheckOrigNodeExistence{{"/fas:fa-check-circle Check Orig Node Existence"}} CheckOrigNodeExistence --"If Orig Node Exists" --> ReturnOrigNode[("fas:fa-arrow-circle-right Return Orig Node")] CheckOrigNodeExistence --"If No Orig Node" --> ReturnNone[("fas:fa-times-circle Return None")] ReturnOrigNode --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style GetShapeNode fill:#99ff99,stroke:#000,stroke-width:2px style GetNodeType fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveTweakNode fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveOrigNodeFromTweak fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveTweakFromHistory fill:#99ff99,stroke:#000,stroke-width:2px style CheckOrigNodeExistence fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnOrigNode fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getOrigNode function:

  1. The process starts by checking the node type of the asNode.

  2. If the node is a shape node, it then attempts to retrieve inputs, specifically looking for a Tweak node.

  3. If a Tweak node is found, the original node connected to this Tweak node is retrieved.

  4. If no Tweak node is found directly, the function checks the node’s history to find a Tweak node.

  5. If a Tweak node is found in the history, it then retrieves the original node connected to this Tweak node.

  6. If the original node exists, it is returned; otherwise, the function returns None.

  7. If the asNode is not a shape node, the function returns None.

asNode.getOutputs(self, nType=None, **shArgs)#

[shArgs : nt=nType]

Purpose:

:: Retrieves the output nodes connected to the asNode, important in understanding the downstream effects of node-based operations.

Parameters:

nType – <str, optional> #The type of output nodes to retrieve.

Returns:

<list> #A list of output nodes connected to the asNode.

Example::
if outNodes:
if len(outNodes) == 1:

return outNodes[0]

elif len(outNodes) > 1:

return outNodes

else:

return None

_images/getOutputs.jpg
Flow Chart Description:

This flowchart illustrates the getOutputs function:

  1. The process begins by checking if a specific node type is specified in the arguments.

  2. If a specific node type is specified, it retrieves output nodes of that particular type.

  3. If no specific node type is given, it lists all future nodes connected to the asNode.

  4. The function then checks if any output nodes exist.

  5. If output nodes exist, they are returned; if no output nodes are found, the function returns None.

asNode.getParent(self, numParent=1, allParents=False, nType=None, prntImplied=True, **shArgs)#

[shArgs : np=numParent, ap=allParents, nt=nType, pi=prntImplied]

Purpose:

:: Retrieves the parent node(s) of the asNode, used in rigging and scene organization to navigate and manipulate node hierarchies.

Parameters:
  • numParent – <int> #The number of parent levels to retrieve.

  • allParents – <bool> #Indicates whether to retrieve all parent nodes.

  • nType – <str, optional> #The type of parent nodes to retrieve.

  • prntImplied – <bool> #Determines whether to include implied parent nodes in the retrieval.

Returns:

<asNode/list> #The parent node(s) of the asNode.

nType =nodeType #_ It is used when allParents is True

allParents & numParent:#

if allParents == True and numParent=0:

#_ returns all parents

elif allParents == True and numParent=> 1:

#_ returns all parents upto numParent

elif allParents == False and numParent=> 1:

#_ Returns perticular parent at numParent (parent, grndParent Etc)

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> ReturnParentCall["/fas:fa-arrow-up Return self.parent()"] ReturnParentCall --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style ReturnParentCall fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getParent function:

  1. The process starts by checking if short arguments (shArgs) are provided and updates parameters accordingly.

  2. After processing shArgs, the function retrieves the parent node of the asNode.

  3. It then checks if a specific node type (nType) is specified for the parent node.

  4. If nType is specified, it filters the parent node based on this type and returns the filtered parent node.

  5. If nType is not specified, it directly returns the parent node of the asNode.

asNode.getPoleLoc(self, extnDist=-1.5, scaleVal=1, initRot=[0, 0, 0], grpLevel=2, ctrlName=0, refAxis=None, poleDir='z', ctrlType=1, getCtrl=False, **shArgs)#

[shArgs : ed=extnDist, sv=scaleVal, ir=initRot, gl=grpLevel, cn=ctrlName, ra=refAxis, pd=poleDir, ct=ctrlType, gc=getCtrl]

Purpose:

:: Creates a pole vector locator for an IK handle, a common requirement in rigging for controlling the orientation of IK chains.

Parameters:
  • extnDist – <float> #The distance to extend the pole vector.

  • scaleVal – <float> #The scale value for the pole vector locator.

  • initRot – <list> #Initial rotation values for the pole vector locator.

  • grpLevel – <int> #The number of group nodes above the locator.

  • ctrlName – <bool> #Determines whether to name the control.

  • refAxis – <str, optional> #The reference axis for the pole vector.

  • poleDir – <str> #The direction for the pole vector.

  • ctrlType – <int> #The type of control for the pole vector.

  • getCtrl – <bool> #Specifies whether to return the control for the pole vector.

Returns:

<asNode/list> #The pole vector locator and optionally its control.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetDefaultCtrlName["/fas:fa-tag Set Default Ctrl Name"] ProcessShArgs --> SetDefaultCtrlName SetDefaultCtrlName --> FindParentJoint["/fas:fa-link Find Parent Joint"] FindParentJoint --"Parent Joint Found" --> FindChildJoint["/fas:fa-link Find Child Joint"] FindParentJoint --"No Parent Joint" --> ReturnNone[("fas:fa-times-circle Return None")] FindChildJoint --"Child Joint Found" --> CalculateMidLoc["/fas:fa-arrows-alt Calculate Mid Location"] FindChildJoint --"No Child Joint" --> CheckChildJoints["/fas:fa-search-plus Check Child Joints"] CheckChildJoints --"Child Joints Found" --> CalculateMidLoc CheckChildJoints --"No Child Joints" --> ReturnNone CalculateMidLoc --> CalculatePolePos["/fas:fa-crosshairs Calculate Pole Position"] CalculatePolePos --"Pole Position Obtained" --> CreateLocator["/fas:fa-map-marker-alt Create Locator"] CalculatePolePos --"No Pole Position" --> HandleStraightJoints{{"/fas:fa-ruler Handle Straight Joints"}} HandleStraightJoints --"Straight Joints Handled" --> CreateLocator HandleStraightJoints --"Unable to Handle" --> ReturnNone CreateLocator --"Locator Created" --> CheckGetCtrl{{"/fas:fa-question-circle Check getCtrl"}} CheckGetCtrl --"getCtrl is True" --> CreateControl["/fas:fa-gamepad Create Control"] CheckGetCtrl --"getCtrl is False" --> ReturnLocator[("fas:fa-arrow-circle-right Return Locator")] CreateControl --> PositionControl["/fas:fa-arrows-alt Position Control"] PositionControl --> LockRotation["/fas:fa-lock Lock Rotation"] LockRotation --> ReturnControl[("fas:fa-check-circle Return Control")] ReturnLocator --> End[("fas:fa-stop End")] ReturnControl --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultCtrlName fill:#99ccff,stroke:#000,stroke-width:2px style FindParentJoint fill:#99ff99,stroke:#000,stroke-width:2px style FindChildJoint fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style CalculateMidLoc fill:#99ff99,stroke:#000,stroke-width:2px style CheckChildJoints fill:#ffcc00,stroke:#000,stroke-width:2px style CalculatePolePos fill:#99ccff,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style HandleStraightJoints fill:#ffcc00,stroke:#000,stroke-width:2px style CheckGetCtrl fill:#cc99ff,stroke:#000,stroke-width:2px style CreateControl fill:#99ff99,stroke:#000,stroke-width:2px style PositionControl fill:#99ccff,stroke:#000,stroke-width:2px style LockRotation fill:#99ff99,stroke:#000,stroke-width:2px style ReturnControl fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getPoleLoc function:

  1. The process begins by checking and updating short arguments (shArgs).

  2. It sets a default control name if none is provided.

  3. The function then locates the parent joint of the asNode.

  4. If a parent joint is found, it proceeds to find the child joint.

  5. If no child joint is directly available, it checks for child joints in the hierarchy.

  6. Once both parent and child joints are identified, it calculates the mid location between them.

  7. The pole position is calculated based on the mid location and extended distance.

  8. If joints are straight, the function handles them accordingly.

  9. A locator is created at the calculated pole position.

  10. If getCtrl is true, a control is created for the pole vector, positioned, and its rotation is locked.

  11. The function returns the locator or control based on the getCtrl parameter.

asNode.getPos(self, shapePos=False, **shArgs)#

[shArgs : sp=shapePos]

Purpose:

:: Retrieves the world position of the asNode or its shape node.

  • Essential for scripts requiring precise spatial information, like rigging or scene layout.

  • To return the world position of an object, meshVtx, meshEdg or curveCV

Parameters:

shapePos – <bool> #Determines whether to retrieve the position of the shape node instead of the transform node.

Returns:

<list> #The world position of the asNode or its shape node. [x,y,z] #_ for types: ‘obj’ or ‘cv’ or ‘vtx’ or ‘edg’ or ‘f’

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> IdentifyNodeType{{"/fas:fa-stream Identify Node Type"}} ProcessShArgs --> IdentifyNodeType IdentifyNodeType --"If Transform Node" --> CheckShapePos{{"/fas:fa-code-branch Check ShapePos"}} IdentifyNodeType --"If Component" --> IdentifyComponentType{{"/fas:fa-puzzle-piece Identify Component Type"}} CheckShapePos --"If ShapePos" --> GetShapeNodePos["/fas:fa-map-marker-alt Get Shape Node Position"] CheckShapePos --"If Not ShapePos" --> GetTransformNodePos["/fas:fa-map-marker-alt Get Transform Node Position"] GetShapeNodePos --> ReturnPos[("fas:fa-arrow-circle-right Return Position")] GetTransformNodePos --> ReturnPos IdentifyComponentType --"Vertex" --> GetVertexPos["/fas:fa-dot-circle Get Vertex Position"] IdentifyComponentType --"CV" --> GetCVPos["/fas:fa-pencil-alt Get CV Position"] IdentifyComponentType --"Edge" --> GetEdgePos["/fas:fa-ruler-combined Get Edge Position"] IdentifyComponentType --"Face" --> GetFacePos["/fas:fa-square Get Face Position"] GetVertexPos --> ReturnPos GetCVPos --> ReturnPos GetEdgePos --> ReturnPos GetFacePos --> ReturnPos ReturnPos --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style IdentifyNodeType fill:#99ccff,stroke:#000,stroke-width:2px style CheckShapePos fill:#cc99ff,stroke:#000,stroke-width:2px style GetShapeNodePos fill:#99ff99,stroke:#000,stroke-width:2px style GetTransformNodePos fill:#99ff99,stroke:#000,stroke-width:2px style IdentifyComponentType fill:#ffcc00,stroke:#000,stroke-width:2px style GetVertexPos fill:#99ccff,stroke:#000,stroke-width:2px style GetCVPos fill:#99ccff,stroke:#000,stroke-width:2px style GetEdgePos fill:#99ccff,stroke:#000,stroke-width:2px style GetFacePos fill:#99ccff,stroke:#000,stroke-width:2px style ReturnPos fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getPos function:

  1. Starts with checking and processing short arguments (shArgs).

  2. Identifies the node type of the asNode.

  3. If it’s a transform node, checks if the shape node’s position is requested.

  4. Retrieves the position of either the shape node or the transform node based on the shapePos parameter.

  5. If it’s a component, identifies the specific component type: Vertex, CV, Edge, or Face.

  6. Retrieves the position of the identified component type.

  7. Returns the calculated world position of the asNode or its component.

asNode.getPosJnt(self, makeChild=True, jntNames=None, snapOrient=False, grpLevel=0, hideJnt=1, **shArgs)#

[shArgs : mc=makeChild, jn=jntNames, so=snapOrient, gl=grpLevel, hj=hideJnt]

Purpose:

:: Creates joints at the position of the asNode, commonly used in rigging to generate skeleton structures based on object positions.

Parameters:
  • makeChild – <bool> #Determines whether to make the new joint a child of the asNode.

  • jntNames – <list/str, optional> #Names for the new joints. jntNames : it can be a single name (string) or list of names (strings)

  • snapOrient – <bool> #Specifies whether to snap the orientation of the new joints to the asNode.

  • grpLevel – <int> #The number of group nodes above the new joints.

  • hideJnt – <bool> #Determines whether to hide the new joints.

Returns:

<list> #A list of the newly created joints.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> PrepareJointCreation["/fas:fa-bone Prepare Joint Creation"] ProcessShArgs --> PrepareJointCreation PrepareJointCreation --> CheckJntNames{{"/fas:fa-tags Check JntNames"}} CheckJntNames --"If JntNames Provided" --> CreateJointsWithNames["/fas:fa-plus Create Joints With Names"] CheckJntNames --"If No JntNames" --> CreateDefaultJoint["/fas:fa-plus Create Default Joint"] CreateJointsWithNames --> ApplyJointSettings["/fas:fa-tools Apply Joint Settings"] CreateDefaultJoint --> ApplyJointSettings ApplyJointSettings --> SnapJointPosition["/fas:fa-map-marker-alt Snap Joint Position"] SnapJointPosition --> CheckSnapOrient{{"/fas:fa-sync-alt Check SnapOrient"}} CheckSnapOrient --"If SnapOrient" --> ApplyOrientation["/fas:fa-compass Apply Orientation"] ApplyOrientation --> FinalizeJoints["/fas:fa-check-circle Finalize Joints"] CheckSnapOrient --"If No SnapOrient" --> FinalizeJoints FinalizeJoints --> ReturnJoints[("fas:fa-arrow-circle-right Return Joints")] ReturnJoints --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style PrepareJointCreation fill:#99ccff,stroke:#000,stroke-width:2px style CheckJntNames fill:#ffcc00,stroke:#000,stroke-width:2px style CreateJointsWithNames fill:#99ff99,stroke:#000,stroke-width:2px style CreateDefaultJoint fill:#99ff99,stroke:#000,stroke-width:2px style ApplyJointSettings fill:#99ccff,stroke:#000,stroke-width:2px style SnapJointPosition fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSnapOrient fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyOrientation fill:#99ccff,stroke:#000,stroke-width:2px style FinalizeJoints fill:#99ff99,stroke:#000,stroke-width:2px style ReturnJoints fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getPosJnt function:

  1. The process begins with checking if short arguments are provided and processing them.

  2. Prepares for joint creation based on the asNode’s position.

  3. Checks if joint names are provided; if so, creates joints with those names, otherwise creates a default joint.

  4. Applies joint settings including visibility, group level, and snap position.

  5. If snapOrient is enabled, aligns the orientation of the joints to the asNode.

  6. Finalizes the joints, making them children of the asNode if specified.

  7. Returns the created joints.

asNode.getPosLoc(self, makeChild=1, snapRot=0, hideLoc=1, locName=None, oppAxis=None, grpLevel=0, offsetDist=None, getSpot=0, sufxLoc='_PosLoc', **shArgs)#

[shArgs : mc=makeChild, sr=snapRot, hl=hideLoc, ln=locName, oa=oppAxis, gl=grpLevel, od=offsetDist, gs=getSpot, sl=sufxLoc]

Purpose:

:: Creates locators at the position of the asNode. This function is widely used in rigging and animation for creating reference points and helpers.

Returns number of locaters as per the given list of locNames at the same position of asNode

Parameters:
  • makeChild – <bool> #Determines whether to make the locator a child of the asNode. makeChild : True | False (Makes newly created locator as child to asN)

  • snapRot – <bool> #Specifies whether to snap the locator’s rotation to the asNode. snapRot : True | False (Snaps rotation of newly created locator to asN)

  • hideLoc – <bool> #Determines whether to hide the locator. hideLoc : True | False (Hides locator on its creation)

  • locName – <str, optional> #The name for the locator. locName : It can be a single name (string) | List of names (strings)

  • oppAxis

    <str, optional> #The axis for positioning the locator opposite to the asNode.

    oppAxis : None | ‘x’ or ‘X’ | ‘y’ or ‘Y’ | ‘z’ or ‘Z’

    [Places the locator on opposite side of the axis (With snapRot as it is given)]

  • grpLevel – <int> #The number of group nodes above the locator. grpLevel : 0 | 1-10 [posLoc will be grouped with same pivot]

  • offsetDist – <list> #The distance for offsetting the locator position. offsetDist =[‘x’, 1] | [[‘x’, ‘-y’, ‘z’], 1] #_ A list contains direction and distance

  • getSpot – <bool> #Determines whether to calculate a spot position for the locator.

  • sufxLoc – <str> #The suffix for the locator’s name.

Returns:

<list> #A list of the created locators.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetDefaultValues["/fas:fa-sliders-h Set Default Values"] ProcessShArgs --> SetDefaultValues SetDefaultValues --> DetermineLocName{{"/fas:fa-i-cursor Determine Loc Name"}} DetermineLocName --"If locName provided" --> CreateNamedLocators["/fas:fa-map-marker-alt Create Named Locators"] DetermineLocName --"If no locName" --> CreateDefaultLocator["/fas:fa-map-marker-alt Create Default Locator"] CreateNamedLocators --> CheckGetSpot{{"/fas:fa-question-circle Check Get Spot"}} CreateDefaultLocator --> CheckGetSpot CheckGetSpot --"If getSpot" --> ApplySpotPosition["/fas:fa-dot-circle Apply Spot Position"] CheckGetSpot --"If not getSpot" --> SnapPositionToAsNode["/fas:fa-magnet Snap Position to AsNode"] ApplySpotPosition --> SnapPositionToAsNode SnapPositionToAsNode --> CheckSnapRot{{"/fas:fa-sync-alt Check Snap Rotation"}} CheckSnapRot --"If snapRot" --> SnapRotationToAsNode["/fas:fa-undo-alt Snap Rotation to AsNode"] CheckSnapRot --"If not snapRot" --> CheckHideLoc{{"/fas:fa-eye-slash Check Hide Locator"}} SnapRotationToAsNode --> CheckHideLoc CheckHideLoc --"If hideLoc" --> HideLocator["/fas:fa-eye-slash Hide Locator"] CheckHideLoc --"If not hideLoc" --> CheckMakeChild{{"/fas:fa-code-branch Check Make Child"}} HideLocator --> CheckMakeChild CheckMakeChild --"If makeChild" --> ParentLocatorToAsNode["/fas:fa-sitemap Parent Locator to AsNode"] CheckMakeChild --"If not makeChild" --> CheckGrpLevel{{"/fas:fa-layer-group Check Group Level"}} ParentLocatorToAsNode --> CheckGrpLevel CheckGrpLevel --"If grpLevel" --> GroupLocator["/fas:fa-object-group Group Locator"] CheckGrpLevel --"If no grpLevel" --> CheckOppAxis{{"/fas:fa-arrows-alt-h Check Opposite Axis"}} GroupLocator --> CheckOppAxis CheckOppAxis --"If oppAxis" --> ApplyOppAxisTransform["/fas:fa-exchange-alt Apply Opposite Axis Transform"] CheckOppAxis --"If no oppAxis" --> CheckOffsetDist{{"/fas:fa-ruler-horizontal Check Offset Distance"}} ApplyOppAxisTransform --> CheckOffsetDist CheckOffsetDist --"If offsetDist" --> ApplyOffsetDistance["/fas:fa-ruler-combined Apply Offset Distance"] CheckOffsetDist --"If no offsetDist" --> ReturnLocators[("fas:fa-arrow-circle-right Return Locators")] ApplyOffsetDistance --> ReturnLocators ReturnLocators --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultValues fill:#99ff99,stroke:#000,stroke-width:2px style DetermineLocName fill:#ffcc00,stroke:#000,stroke-width:2px style CreateNamedLocators fill:#99ff99,stroke:#000,stroke-width:2px style CreateDefaultLocator fill:#99ff99,stroke:#000,stroke-width:2px style CheckGetSpot fill:#cc99ff,stroke:#000,stroke-width:2px style ApplySpotPosition fill:#99ccff,stroke:#000,stroke-width:2px style SnapPositionToAsNode fill:#99ccff,stroke:#000,stroke-width:2px style CheckSnapRot fill:#cc99ff,stroke:#000,stroke-width:2px style SnapRotationToAsNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckHideLoc fill:#cc99ff,stroke:#000,stroke-width:2px style HideLocator fill:#99ff99,stroke:#000,stroke-width:2px style CheckMakeChild fill:#cc99ff,stroke:#000,stroke-width:2px style ParentLocatorToAsNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckGrpLevel fill:#cc99ff,stroke:#000,stroke-width:2px style GroupLocator fill:#99ff99,stroke:#000,stroke-width:2px style CheckOppAxis fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyOppAxisTransform fill:#99ccff,stroke:#000,stroke-width:2px style CheckOffsetDist fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyOffsetDistance fill:#99ccff,stroke:#000,stroke-width:2px style ReturnLocators fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getPosLoc function:

  1. Starts by checking if short arguments are provided and processes them.

  2. Determines the name of the locator(s) to be created.

  3. Creates locators with specified names or a default locator if no name is given.

  4. Checks if a spot position is required for the locator.

  5. Snaps the locator’s position to the asNode, and if snapRot is true, aligns rotation.

  6. Hides the locator if hideLoc is true.

  7. Parents the locator to the asNode if makeChild is true.

  8. Groups the locator if a group level is specified.

  9. Applies opposite axis transform if oppAxis is specified.

  10. Applies offset distance if provided.

  11. Returns the created locator(s).

asNode.getPos_Vtx(self, vtxOrNum, **shArgs)#

[shArgs : vn=vtxOrNum]

Purpose:

:: Retrieves the position of a specific vertex on a mesh. This function is crucial in modeling and rigging for vertex-level manipulations and analysis.

Parameters:

vtxOrNum – <asNode/int> #The vertex or its index number on the mesh.

Returns:

<list> #The position of the specified vertex.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> DetermineVtxType{{"/fas:fa-puzzle-piece Determine Vertex Type"}} DetermineVtxType --"If int" --> GetVtxPosUsingIndex["/fas:fa-map-marker-alt Get Vertex Position Using Index"] DetermineVtxType --"If asNode" --> ExtractVtxIndex["/fas:fa-code Extract Vertex Index"] ExtractVtxIndex --> GetVtxPosUsingIndex GetVtxPosUsingIndex --> ReturnVtxPos[("fas:fa-arrow-circle-right Return Vertex Position")] ReturnVtxPos --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style DetermineVtxType fill:#ffcc00,stroke:#000,stroke-width:2px style GetVtxPosUsingIndex fill:#99ff99,stroke:#000,stroke-width:2px style ExtractVtxIndex fill:#99ccff,stroke:#000,stroke-width:2px style ReturnVtxPos fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getPos_Vtx function:

  1. The process starts with checking if short arguments (shArgs) are provided and processes them.

  2. Determines whether the input is an integer or an asNode representing a vertex.

  3. If an asNode is provided, extracts the vertex index from the asNode.

  4. Retrieves the world position of the vertex using the determined index.

  5. Returns the position of the specified vertex.

asNode.getRivet(self, grpLevel=1, mirrorRivet=False, sidePrfxes=None, name=None, parentGrp=None, rivetObj=None, **shArgs)#

[shArgs : gl=grpLevel, mr=mirrorRivet, sp=sidePrfxes, n=name, pg=parentGrp, ro=rivetObj]

Purpose:

:: Creates a rivet on a mesh, commonly used in rigging for attaching objects to deforming meshes with precision.

Parameters:
  • grpLevel – <int> #The number of group nodes above the rivet.

  • mirrorRivet – <bool> #Specifies whether to create a mirrored rivet.

  • sidePrfxes – <list, optional> #Prefixes for defining sides for the rivet.

  • name – <str, optional> #The name for the rivet.

  • parentGrp – <asNode, optional> #The parent group for the rivet.

  • rivetObj – <asNode, optional> #The target mesh for the rivet.

Returns:

<list> #A list containing the rivet and optionally its group.

Example:

if grpLevel:
        return [loc, grpNode]   #_ asNodes
else:
        return [loc, None]              #_ asNode
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckVtxType{{"/fas:fa-check-circle Check Vertex Type"}} ProcessShArgs --> CheckVtxType CheckVtxType --"If Not Vertex" --> ReturnNone[("fas:fa-times-circle Return None")] CheckVtxType --"If Vertex" --> SetDefaultValues["/fas:fa-sliders-h Set Default Values"] SetDefaultValues --> CreateLocator["/fas:fa-map-marker-alt Create Locator"] CreateLocator --> GroupLocator{{"/fas:fa-object-group Group Locator"}} GroupLocator --"If grpLevel" --> CreateGroupNode["/fas:fa-sitemap Create Group Node"] GroupLocator --"If no grpLevel" --> SkipGroupNode[("fas:fa-forward Skip Group Node")] CreateGroupNode --> ApplyPointOnPolyConstraint["/fas:fa-link Apply PointOnPoly Constraint"] SkipGroupNode --> ApplyPointOnPolyConstraint ApplyPointOnPolyConstraint --> CheckParentGroup{{"/fas:fa-code-branch Check Parent Group"}} CheckParentGroup --"If Parent Group" --> ParentToGroup["/fas:fa-sitemap Parent to Group"] CheckParentGroup --"If No Parent Group" --> CheckMirrorRivet{{"/fas:fa-mirror Check Mirror Rivet"}} ParentToGroup --> CheckMirrorRivet CheckMirrorRivet --"If Mirror Rivet" --> CreateMirrorRivet["/fas:fa-copy Create Mirror Rivet"] CheckMirrorRivet --"If No Mirror Rivet" --> ReturnLocatorGroup[("fas:fa-arrow-circle-right Return Locator and Group")] CreateMirrorRivet --> ReturnMirrorAndOriginal[("fas:fa-arrow-circle-right Return Mirror and Original")] ReturnLocatorGroup --> End[("fas:fa-stop End")] ReturnMirrorAndOriginal --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckVtxType fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style SetDefaultValues fill:#99ff99,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style GroupLocator fill:#ffcc00,stroke:#000,stroke-width:2px style CreateGroupNode fill:#99ff99,stroke:#000,stroke-width:2px style SkipGroupNode fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyPointOnPolyConstraint fill:#99ccff,stroke:#000,stroke-width:2px style CheckParentGroup fill:#cc99ff,stroke:#000,stroke-width:2px style ParentToGroup fill:#99ff99,stroke:#000,stroke-width:2px style CheckMirrorRivet fill:#cc99ff,stroke:#000,stroke-width:2px style CreateMirrorRivet fill:#99ccff,stroke:#000,stroke-width:2px style ReturnLocatorGroup fill:#00cc00,stroke:#000,stroke-width:2px style ReturnMirrorAndOriginal fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getRivet function:

  1. The process starts by checking if shArgs are provided and updates the parameters accordingly.

  2. It verifies if the selected node is a vertex, otherwise returns None.

  3. Sets default values and creates a locator at the specified location.

  4. Groups the locator if a group level is specified.

  5. Applies a PointOnPoly Constraint to attach the locator to the mesh.

  6. Parents the locator to a specified group if provided.

  7. If a mirrored rivet is requested, it creates a mirrored version.

  8. Finally, the function returns the locator and its group, or the mirrored pair if applicable.

asNode.getRot(self, worldSpace=False, **shArgs)#

[shArgs : ws=worldSpace]

Purpose:

:: Retrieves the rotation values of the asNode, essential for scripts involving rotations in rigging, animation, or scene layout.

Parameters:

worldSpace – <bool> #Determines whether to retrieve the rotation in world space or local space.

Returns:

<list> #The rotation values of the asNode in the specified space.

_images/getRot.jpg
Flow Chart Description:

This flowchart illustrates the getRot function:

  1. The process begins by checking if shArgs are provided and updates the world space parameter accordingly.

  2. It determines whether the rotation is to be retrieved in world space or local space.

  3. If world space is selected, it creates a temporary locator at the asNode’s position to get accurate world rotation values.

  4. Retrieves the rotation of the locator as the world rotation of the asNode and then deletes the locator.

  5. If local space is selected, directly retrieves the local rotation values from the asNode.

  6. Finally, the function returns the rotation values in the specified space (world or local).

asNode.getScale(self, worldSpace=False, **shArgs)#

[shArgs : ws=worldSpace]

Purpose:

:: Retrieves the scale values of the asNode. This function is important in scripts that need to manage or analyze the scale of objects within Maya.

Parameters:

worldSpace – <bool> #Determines whether to retrieve the scale in world space or local space.

Returns:

<list> #The scale values of the asNode in the specified space.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> RetrieveScale["/fas:fa-balance-scale Retrieve Scale"] ProcessShArgs --> RetrieveScale RetrieveScale --> ReturnScale[("fas:fa-arrow-circle-right Return Scale")] ReturnScale --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style RetrieveScale fill:#99ccff,stroke:#000,stroke-width:2px style ReturnScale fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getScale function:

  1. The process begins by determining if shArgs are provided and updates parameters accordingly.

  2. Retrieves the scale values of the asNode, irrespective of whether the world space flag is set or not.

  3. Returns the scale values of the asNode.

asNode.getShape(self, multiShapes=False, excludeOrigShp=True, getOrigShp=False, **shArgs)#

[shArgs : ms=multiShapes, eos=excludeOrigShp, gos=getOrigShp]

Purpose:

:: Retrieves the shape node(s) of the asNode, used in operations that require direct interaction with the geometry of an object.

Parameters:
  • multiShapes – <bool> #Determines whether to retrieve multiple shape nodes if they exist. multiShapes= True | False #_ Returns multiple shapes if True and if exists

  • excludeOrigShp – <bool> #Specifies whether to exclude the original shape node, often created during deformation. excludeOrigShp = True | False #_ If True, shapeOrig will be excluded. shapeOrig will be created when deformed.

  • getOrigShp – <bool> #Determines whether to retrieve the original shape node.

Returns:

<asNode/list> #The shape node(s) of the asNode.

_images/getShape.jpg
Flow Chart Description:

This flowchart illustrates the getShape function:

  1. The process starts by checking if shArgs are provided and updates parameters as necessary.

  2. Determines if multiple shapes are to be retrieved based on the multiShapes flag.

  3. If multiShapes is True, retrieves all shape nodes. If False, retrieves only the first shape node.

  4. Checks if original shape nodes should be excluded based on the excludeOrigShp flag.

  5. Excludes or includes the original shape node in the result based on the flag’s value.

  6. Returns the shape node(s) of the asNode.

asNode.getSibIndex(self, prntImplied=True, **shArgs)#

[shArgs : pi=prntImplied]

Purpose:

:: Retrieves the index of the asNode among its siblings in the parent hierarchy. Useful in scene organization to determine the node’s position relative to its siblings.

Parameters:

prntImplied – <bool> #Determines whether to include implied parent-child relationships in the calculation.

Returns:

<int> #The index of the asNode among its siblings.

_images/getSibIndex.jpg
Flow Chart Description:

This flowchart illustrates the getSibIndex function:

  1. The process begins by determining if shArgs are provided and updates parameters accordingly.

  2. Checks if prntImplied is True and assesses if the ‘mPrnt’ attribute exists for special parent-child relationships.

  3. If ‘mPrnt’ attribute exists, compares the implied parent with the actual parent to decide the sibling index.

  4. If the parents match, retrieves the sibling index without considering implied parent-child relationships.

  5. If the parents differ, returns zero as the index.

  6. Identifies the actual parent of the asNode.

  7. Determines the index of the asNode among its siblings by comparing it with each child of the parent node.

  8. Returns the sibling index of the asNode.

  9. If the asNode has no parent, returns null.

asNode.getSiblings(self, includeSrc=0, nType=None, getShapes=0, srRange=None, fromEnd=True, skipCount=0, selectNodes=True, **shArgs)#

[shArgs : is=includeSrc, nt=nType, gs=getShapes, sr=srRange, fe=fromEnd, sc=skipCount, sn=selectNodes]

Purpose:

:: Retrieves the sibling nodes of the asNode, useful in operations that involve processing or manipulating a group of related nodes.

Parameters:
  • includeSrc – <bool> #Determines whether to include the asNode itself in the list of siblings.

  • nType – <str, optional> #Specifies the type of sibling nodes to retrieve.

  • getShapes – <bool> #Indicates whether to retrieve shape nodes among the siblings.

  • srRange – <list, optional> #Defines a range for selecting siblings.

  • fromEnd – <bool> #Determines whether to count siblings from the end.

  • skipCount – <int> #The number of siblings to skip in the count.

  • selectNodes – <bool> #Specifies whether to select the sibling nodes.

Returns:

<list> #A list of sibling nodes of the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> IdentifyParent{{"/fas:fa-users Identify Parent"}} ProcessShArgs --> IdentifyParent IdentifyParent --"If Parent Exists" --> RetrieveSiblings{{"/fas:fa-sitemap Retrieve Siblings"}} IdentifyParent --"If No Parent" --> ReturnNull[("fas:fa-ban Return Null")] RetrieveSiblings --> CheckNodeType{{"/fas:fa-filter Check Node Type"}} CheckNodeType --"If Specific Node Type" --> FilterByType["/fas:fa-tasks Filter By Type"] CheckNodeType --"Any Node Type" --> IncludeShapesCheck{{"/fas:fa-shapes Include Shapes Check"}} FilterByType --> IncludeShapesCheck IncludeShapesCheck --"If getShapes" --> IncludeShapeNodes["/fas:fa-plus-square Include Shape Nodes"] IncludeShapesCheck --"If not getShapes" --> ExcludeSourceCheck{{"/fas:fa-user-minus Exclude Source Check"}} IncludeShapeNodes --> ExcludeSourceCheck ExcludeSourceCheck --"If excludeSrc is False" --> ApplyRangeCheck{{"/fas:fa-ruler-horizontal Apply Range Check"}} ExcludeSourceCheck --"If excludeSrc is True" --> RemoveCurrentNode["/fas:fa-minus-square Remove Current Node"] RemoveCurrentNode --> ApplyRangeCheck ApplyRangeCheck --"If srRange Specified" --> ProcessRangeSelection["/fas:fa-expand-arrows-alt Process Range Selection"] ApplyRangeCheck --"If No Range Specified" --> FinalizeList["/fas:fa-check-double Finalize List"] ProcessRangeSelection --> FinalizeList FinalizeList --> CheckSelectNodes{{"/fas:fa-mouse-pointer Check Select Nodes"}} CheckSelectNodes --"If selectNodes" --> SelectSiblings["/fas:fa-hand-pointer Select Siblings"] CheckSelectNodes --"If not selectNodes" --> ReturnSiblingList[("fas:fa-arrow-circle-right Return Sibling List")] SelectSiblings --> ReturnSiblingList ReturnSiblingList --> End[("fas:fa-stop End")] ReturnNull --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style IdentifyParent fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveSiblings fill:#99ff99,stroke:#000,stroke-width:2px style CheckNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style FilterByType fill:#99ccff,stroke:#000,stroke-width:2px style IncludeShapesCheck fill:#cc99ff,stroke:#000,stroke-width:2px style IncludeShapeNodes fill:#99ff99,stroke:#000,stroke-width:2px style ExcludeSourceCheck fill:#cc99ff,stroke:#000,stroke-width:2px style RemoveCurrentNode fill:#99ff99,stroke:#000,stroke-width:2px style ApplyRangeCheck fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessRangeSelection fill:#99ccff,stroke:#000,stroke-width:2px style FinalizeList fill:#00cc00,stroke:#000,stroke-width:2px style CheckSelectNodes fill:#cc99ff,stroke:#000,stroke-width:2px style SelectSiblings fill:#99ff99,stroke:#000,stroke-width:2px style ReturnSiblingList fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNull fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getSiblings function:

  1. The function starts by checking if shArgs are provided and processes them.

  2. Identifies the parent of the asNode.

  3. Retrieves the siblings of the asNode, filtered by node type if specified.

  4. Includes shape nodes in the sibling list if getShapes is True.

  5. Removes the asNode from the sibling list if includeSrc is False.

  6. Applies a range selection based on srRange if provided.

  7. Finalizes the list of sibling nodes.

  8. Selects the sibling nodes in the Maya UI if selectNodes is True.

  9. Returns the list of sibling nodes.

  10. If no parent is found, returns null.

asNode.getSkinCluster(self, additionalCheck=1, **shArgs)#

[shArgs : ac=additionalCheck]

Purpose:

:: Retrieves the skin cluster associated with the asNode. This function is essential in rigging and skinning workflows for accessing and modifying skinning information.

Parameters:

additionalCheck – <bool> #Specifies whether to perform additional checks to ensure the skin cluster’s validity.

Returns:

<asNode> #The skin cluster node associated with the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckNodeType{{"/fas:fa-code-branch Check Node Type"}} CheckNodeType --"If Mesh, Lattice, or Curve" --> ListHistory{{"/fas:fa-history List History"}} CheckNodeType --"If Not Mesh, Lattice, or Curve" --> ReturnNone[("fas:fa-times-circle Return None")] ListHistory --"If SkinCluster Found" --> RetrieveSkinCluster{{"/fas:fa-search Retrieve SkinCluster"}} ListHistory --"If No SkinCluster" --> CheckConnectionInfo{{"/fas:fa-plug Check Connection Info"}} CheckConnectionInfo --"If Connection Info Exists" --> ValidateSkinCluster["/fas:fa-check-square Validate SkinCluster"] CheckConnectionInfo --"If No Connection Info" --> AdditionalCheck{{"/fas:fa-plus-circle Additional Check"}} ValidateSkinCluster --> ReturnSkinCluster[("fas:fa-arrow-circle-right Return SkinCluster")] AdditionalCheck --"If additionalCheck" --> PerformAdditionalChecks["/fas:fa-tasks Perform Additional Checks"] PerformAdditionalChecks --> FinalizeSkinCluster["/fas:fa-check-double Finalize SkinCluster"] FinalizeSkinCluster --> CheckFinalResult{{"/fas:fa-question-circle Check Final Result"}} CheckFinalResult --"If SkinCluster Finalized" --> ReturnFinalSkinCluster[("fas:fa-arrow-circle-right Return Final SkinCluster")] CheckFinalResult --"If No SkinCluster Finalized" --> ReturnNull[("fas:fa-ban Return Null")] ReturnFinalSkinCluster --> End[("fas:fa-stop End")] ReturnNull --> End ReturnSkinCluster --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style ListHistory fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveSkinCluster fill:#99ff99,stroke:#000,stroke-width:2px style CheckConnectionInfo fill:#cc99ff,stroke:#000,stroke-width:2px style ValidateSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style AdditionalCheck fill:#ffcc00,stroke:#000,stroke-width:2px style PerformAdditionalChecks fill:#99ccff,stroke:#000,stroke-width:2px style FinalizeSkinCluster fill:#99ff99,stroke:#000,stroke-width:2px style CheckFinalResult fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFinalSkinCluster fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNull fill:#ff6666,stroke:#000,stroke-width:2px style ReturnSkinCluster fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getSkinCluster function:

  1. The function starts by checking the node type of the asNode.

  2. If the node is a mesh, lattice, or curve, it retrieves the skin cluster from the node’s history.

  3. If a skin cluster is found, it is returned.

  4. If no skin cluster is found, the function checks for a connection to a skin cluster.

  5. If connection info exists, the skin cluster is validated and returned.

  6. If additional checks are required, the function performs these checks to finalize the skin cluster.

  7. Finally, the function returns the skin cluster if found, or null if none is found.

  8. If the asNode is not a mesh, lattice, or curve, the function returns null.

asNode.getSkinCtrl(self, skinMesh=0, grpLevel=3, ctrlGrp=0, globalGrp=0, parentJnt=0, name=0, sidePrfx='L_', mirrPrfx=None, refLoc=None, animCtrl=None, skinJnt=None, **shArgs)#

[shArgs : sm=skinMesh, gl=grpLevel, cg=ctrlGrp, gg=globalGrp, pj=parentJnt, n=name, sp=sidePrfx, mp=mirrPrfx, rl=refLoc, ac=animCtrl, sj=skinJnt]

Purpose:

:: Creates a control for manipulating a skin cluster, widely used in advanced rigging setups for more nuanced deformation control.

Parameters:
  • skinMesh – <bool> #Indicates whether the control is for a skin mesh. skinMesh = skinMesh | skinCluster

  • grpLevel – <int> #The number of group nodes above the control. grpLevel = No of groups on top of skinCtrl

  • ctrlGrp – <asNode, optional> #The control group to which the skin control belongs. ctrlGrp = Parent Grp for Ctrl Grp

  • globalGrp – <asNode, optional> #The global group for additional hierarchy organization. globalGrp = To parent Rivet Grp & Inverse Matrix Jnt Grp under Global Grp

  • parentJnt – <asNode, optional> #The joint to which the skin control will be parented. parentJnt = To Parent Skin Joint to parentJnt

  • name – <str, optional> #The name for the skin control. name = Name for groups, joints, rivets and mirror groups etc

  • sidePrfx – <str> #Prefixes for defining sides for the control. sidePrfx = [’L_’, ‘R_’] | [’l_’, ‘r_’] etc

  • mirrPrfx – <str, optional> #Prefix for creating a mirrored control.

  • refLoc – <asNode, optional> #Reference locator for alignment.

  • animCtrl – <asNode, optional> #The animation control linked to the skin control.

  • skinJnt – <asNode, optional> #The skin joint associated with the control.

Returns:

<asNode> #The skin control for manipulating the skin cluster.

graph TB Start[("fa:fa-play Start")] --> CheckVtxType{{"/fas:fa-code-branch Check Vertex Type"}} CheckVtxType --"If Not Vertex" --> ReturnNone[("fas:fa-times-circle Return None")] CheckVtxType --"If Vertex" --> SetDefaultValues["/fas:fa-sliders-h Set Default Values"] SetDefaultValues --> CreateMainGroup["/fas:fa-sitemap Create Main Group"] CreateMainGroup --> CheckRefLoc{{"/fas:fa-map-marker-alt Check Reference Locator"}} CheckRefLoc --"If RefLoc" --> UseRefLocForRivet["/fas:fa-thumbtack Use RefLoc for Rivet"] CheckRefLoc --"If No RefLoc" --> CreateRivet{{"/fas:fa-thumbtack Create Rivet"}} UseRefLocForRivet --> CreateInverseMatrixGroup["/fas:fa-object-group Create Inverse Matrix Group"] CreateRivet --> CreateInverseMatrixGroup CreateInverseMatrixGroup --> CheckAnimCtrl{{"/fas:fa-cogs Check Animation Control"}} CheckAnimCtrl --"If AnimCtrl" --> UseAnimCtrlForSkinCtrl["/fas:fa-cog Use AnimCtrl for SkinCtrl"] CheckAnimCtrl --"If No AnimCtrl" --> CreateSkinControl{{"/fas:fa-cogs Create Skin Control"}} UseAnimCtrlForSkinCtrl --> CheckSkinJoint{{"/fas:fa-code-branch Check Skin Joint"}} CreateSkinControl --> CheckSkinJoint CheckSkinJoint --"If SkinJnt" --> UseSkinJoint["/fas:fa-link Use SkinJoint"] CheckSkinJoint --"If No SkinJnt" --> DuplicateInverseJoint["/fas:fa-clone Duplicate Inverse Joint"] UseSkinJoint --> CheckParentJoint{{"/fas:fa-sitemap Check Parent Joint"}} DuplicateInverseJoint --> CheckParentJoint CheckParentJoint --"If ParentJnt" --> ParentSkinJoint["/fas:fa-arrow-up Parent Skin Joint"] CheckParentJoint --"If No ParentJnt" --> SetupConstraints{{"/fas:fa-link Setup Constraints"}} ParentSkinJoint --> SetupConstraints SetupConstraints --> CheckSkinMesh{{"/fas:fa-cube Check Skin Mesh"}} CheckSkinMesh --"If SkinMesh" --> SetupSkinCluster["/fas:fa-object-ungroup Setup Skin Cluster"] CheckSkinMesh --"If No SkinMesh" --> FinalizeSkinControl[("fas:fa-check-circle Finalize Skin Control")] SetupSkinCluster --> FinalizeSkinControl FinalizeSkinControl --> CheckMirrorControl{{"/fas:fa-mirror Check Mirror Control"}} CheckMirrorControl --"If Mirror Control" --> CreateMirrorControl["/fas:fa-copy Create Mirror Control"] CheckMirrorControl --"If No Mirror Control" --> End[("fas:fa-stop End")] CreateMirrorControl --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckVtxType fill:#ffcc00,stroke:#000,stroke-width:2px style SetDefaultValues fill:#99ff99,stroke:#000,stroke-width:2px style CreateMainGroup fill:#99ccff,stroke:#000,stroke-width:2px style CheckRefLoc fill:#cc99ff,stroke:#000,stroke-width:2px style UseRefLocForRivet fill:#99ff99,stroke:#000,stroke-width:2px style CreateRivet fill:#99ff99,stroke:#000,stroke-width:2px style CreateInverseMatrixGroup fill:#99ccff,stroke:#000,stroke-width:2px style CheckAnimCtrl fill:#cc99ff,stroke:#000,stroke-width:2px style UseAnimCtrlForSkinCtrl fill:#99ff99,stroke:#000,stroke-width:2px style CreateSkinControl fill:#99ff99,stroke:#000,stroke-width:2px style CheckSkinJoint fill:#cc99ff,stroke:#000,stroke-width:2px style UseSkinJoint fill:#99ccff,stroke:#000,stroke-width:2px style DuplicateInverseJoint fill:#99ccff,stroke:#000,stroke-width:2px style CheckParentJoint fill:#cc99ff,stroke:#000,stroke-width:2px style ParentSkinJoint fill:#99ff99,stroke:#000,stroke-width:2px style SetupConstraints fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinMesh fill:#cc99ff,stroke:#000,stroke-width:2px style SetupSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style FinalizeSkinControl fill:#00cc00,stroke:#000,stroke-width:2px style CheckMirrorControl fill:#cc99ff,stroke:#000,stroke-width:2px style CreateMirrorControl fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getSkinCtrl function:

  1. The process starts by checking if the asNode is a vertex.

  2. If not a vertex, the function returns none.

  3. The function sets default values and creates the main control group.

  4. It then checks for a reference locator to use for the rivet or creates a new rivet.

  5. An inverse matrix group is created for the control setup.

  6. The function checks if an animation control is provided and uses it or creates a new skin control.

  7. It then checks for a skin joint, using it if provided or duplicating the inverse joint.

  8. If a parent joint is specified, the skin joint is parented, followed by setting up constraints.

  9. If a skin mesh is involved, the function sets up the skin cluster.

  10. The function finalizes the skin control and checks if a mirrored control is needed.

  11. If mirror control is required, it creates the mirror control.

  12. The function ends after finalizing the control setup or creating the mirror control.

asNode.getSkinJnts(self, **shArgs)#

[shArgs]

Purpose:

:: Retrieves the list of joints influencing the asNode through skinning. This function is critical for rigging and skinning analysis, allowing for a review and modification of skin influences.

Returns:

<list> #A list of joints influencing the asNode through skinning. return [infList, len(infList)]

_images/getSkinJnts.jpg
Flow Chart Description:

This flowchart illustrates the getSkinJnts function:

  1. The process begins by checking if the asNode is a mesh or curve.

  2. If not a mesh or curve, the function returns an empty list.

  3. If it is a mesh or curve, the function retrieves the associated skin cluster.

  4. It then checks if the skin cluster exists.

  5. If no skin cluster is found, the function returns an empty list.

  6. If a skin cluster exists, the function retrieves the list of influencing joints.

  7. The function concludes by returning the list of influencing joints and their count.

asNode.getSkinWeights(self, skinClust=None, **shArgs)#

[shArgs : sc=skinClust]

Purpose:

:: Extracts the skin weights associated with the asNode. Essential in rigging and skinning to analyze, export, or modify vertex weights.

Parameters:

skinClust – <asNode, optional> #The skin cluster from which to retrieve weights.

Returns:

<dict> #A dictionary containing vertex indices and their corresponding skin weights.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckVtxCVLatticePnt{{"/fas:fa-search-plus Check Vtx/CV/Lattice Point"}} ProcessShArgs --> CheckVtxCVLatticePnt CheckVtxCVLatticePnt --"If not Vtx, CV, or Lattice Point" --> ReturnEmptyDict1[("fas:fa-times-circle Return {}")] CheckVtxCVLatticePnt --"If Vtx, CV, or Lattice Point" --> CheckSkinClust{{"/fas:fa-question-circle Check SkinClust"}} CheckSkinClust --"If skinClust not provided" --> ProcessVtxMesh["/fas:fa-sitemap Process VtxMesh"] CheckSkinClust --"If skinClust is provided" --> GetValList["/fas:fa-list Get ValList"] ProcessVtxMesh --"If VtxMesh is Shape" --> GetVtxMeshParent["/fas:fa-arrow-alt-circle-up Get VtxMesh Parent"] ProcessVtxMesh --"If VtxMesh is not Shape" --> GetSkinClustFromVtxMesh["/fas:fa-sync-alt Get SkinClust from VtxMesh"] GetVtxMeshParent --> GetSkinClustFromVtxMesh GetSkinClustFromVtxMesh --"If no SkinClust" --> ReturnEmptyDict2[("fas:fa-times-circle Return {}")] GetSkinClustFromVtxMesh --"If SkinClust found" --> GetValList GetValList --> CreateSkinValDict["/fas:fa-table Create SkinValDict"] CreateSkinValDict --> End[("fas:fa-stop End")] ReturnEmptyDict1 --> End ReturnEmptyDict2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckVtxCVLatticePnt fill:#cc99ff,stroke:#000,stroke-width:2px style CheckSkinClust fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessVtxMesh fill:#99ccff,stroke:#000,stroke-width:2px style GetVtxMeshParent fill:#ff9999,stroke:#000,stroke-width:2px style GetSkinClustFromVtxMesh fill:#99ccff,stroke:#000,stroke-width:2px style GetValList fill:#99ff99,stroke:#000,stroke-width:2px style CreateSkinValDict fill:#99ff99,stroke:#000,stroke-width:2px style ReturnEmptyDict1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnEmptyDict2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getSkinWeights function:

  1. The process begins by verifying if the asNode is a vertex, CV, or lattice point.

  2. If not, the function returns an empty dictionary.

  3. If it is, the function checks if a skin cluster is provided.

  4. If no skin cluster is provided, the function attempts to retrieve the skin cluster associated with the asNode.

  5. If no skin cluster is found, an empty dictionary is returned.

  6. If a skin cluster is found or provided, the function extracts the skin weights.

  7. The function concludes by returning a dictionary of skin weights for the asNode.

asNode.getSkinWeights_Jnt(self, forJnt, **shArgs)#

[shArgs : fj=forJnt]

Purpose:

:: Retrieves the skin weights for a specific joint influencing the asNode. This function is valuable for precise weight painting and adjustments in character rigging.

Parameters:

forJnt – <asNode> #The joint for which to retrieve skin weights.

Returns:

<dict> #A dictionary of vertex indices and their skin weights for the specified joint.

_images/getSkinWeights_Jnt.jpg
Flow Chart Description:

This flowchart illustrates the getSkinWeights_Jnt function:

  1. The function starts by checking if the asNode is a vertex.

  2. If the asNode is not a vertex, it returns an empty dictionary.

  3. If it is a vertex, the function retrieves a list of all vertices.

  4. It iterates through each vertex in the list.

  5. For each vertex, the function retrieves the skin weights.

  6. It checks if the specified joint is in the weights for each vertex.

  7. If the joint is not in the weights, the loop continues to the next vertex.

  8. If the joint is in the weights, the function stores the weight value.

  9. After all vertices are processed, it returns a dictionary mapping each vertex to the weight value for the specified joint.

asNode.getTransforms(self, worldSpace=0, **shArgs)#

[shArgs : ws=worldSpace]

Purpose:

:: Retrieves the transformation values (translation, rotation, scale) of the asNode. Useful in various scenarios like rigging, animation, and scene layout for obtaining an object’s spatial properties.

Parameters:

worldSpace – <bool> #Determines whether to retrieve the transformation values in world space or local space.

Returns:

<list> #A list containing the translation, rotation, and scale values of the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckNodeTransformable{{"/fas:fa-check-circle Check Node is Transformable"}} CheckNodeTransformable --"If Not Transformable" --> ReturnEmptyList[("fas:fa-times-circle Return Empty List")] CheckNodeTransformable --"If Transformable" --> RetrievePosition["/fas:fa-map-marker-alt Retrieve Position"] RetrievePosition --> RetrieveRotation["/fas:fa-sync-alt Retrieve Rotation"] RetrieveRotation --> RetrieveScale["/fas:fa-expand-arrows-alt Retrieve Scale"] RetrieveScale --> CompileTransforms[("/fas:fa-object-ungroup Compile Transforms")] CompileTransforms --> End[("fas:fa-stop End")] ReturnEmptyList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeTransformable fill:#ffcc00,stroke:#000,stroke-width:2px style RetrievePosition fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveRotation fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveScale fill:#99ccff,stroke:#000,stroke-width:2px style CompileTransforms fill:#99ff99,stroke:#000,stroke-width:2px style ReturnEmptyList fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getTransforms function:

  1. The process begins by verifying if the asNode is transformable.

  2. If not transformable, the function returns an empty list.

  3. If the node is transformable, it retrieves the position of the asNode.

  4. Next, it retrieves the rotation values of the asNode.

  5. Then, it retrieves the scale values of the asNode.

  6. Finally, the function compiles these values into a single list containing position, rotation, and scale, and returns this list.

asNode.getVtxList(self, get_asNodes=True, getEditPoints=0, onlyCount=0, **shArgs)#

[shArgs : gan=get_asNodes, gep=getEditPoints, oc=onlyCount]

Purpose:

:: Retrieves a list of vertices from the asNode. Essential in modeling and rigging for vertex-level operations and manipulations.

Parameters:
  • get_asNodes – <bool> #Determines whether to return the vertices as asNode objects.

  • getEditPoints – <bool> #Indicates whether to include edit points in the vertex list.

  • onlyCount – <bool> #Specifies whether to return only the count of vertices instead of the list.

Returns:

<list> #A list of vertices or their count from the asNode.

Returns(asNodes) -Example:

if self.isNodeType('nurbsCurve'):
        return [cvList, numCVs]
elif self.isNodeType('mesh'):
        return [vtxList, numVtx]
elif self.isNodeType('nurbsSurface'):
        return [cvList, numCVs]
graph TB Start[("fa:fa-play Start")] --> CheckNodeType{{"/fas:fa-check-circle Check Node Type"}} CheckNodeType --"If Not Mesh, Curve, or Lattice" --> ReturnEmptyList[("fas:fa-times-circle Return Empty List")] CheckNodeType --"If Mesh" --> RetrieveMeshVertices["/fas:fa-th Retrieve Mesh Vertices"] CheckNodeType --"If Curve" --> RetrieveCurveVertices["/fas:fa-wave-square Retrieve Curve Vertices"] CheckNodeType --"If Lattice" --> RetrieveLatticePoints["/fas:fa-th-large Retrieve Lattice Points"] RetrieveMeshVertices --> CompileVertexList[("/fas:fa-list-ol Compile Vertex List")] RetrieveCurveVertices --> CompileVertexList RetrieveLatticePoints --> CompileVertexList CompileVertexList --> CheckGetAsNodes{{"/fas:fa-question-circle Check GetAsNodes"}} CheckGetAsNodes --"If GetAsNodes" --> ConvertToAsNodes["/fas:fa-code Convert to asNode Objects"] CheckGetAsNodes --"If Not GetAsNodes" --> ReturnVertexList[("fas:fa-arrow-circle-right Return Vertex List")] ConvertToAsNodes --> ReturnConvertedVertexList[("fas:fa-arrow-circle-right Return Converted Vertex List")] ReturnVertexList --> End[("fas:fa-stop End")] ReturnConvertedVertexList --> End ReturnEmptyList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnEmptyList fill:#ff6666,stroke:#000,stroke-width:2px style RetrieveMeshVertices fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveCurveVertices fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveLatticePoints fill:#99ccff,stroke:#000,stroke-width:2px style CompileVertexList fill:#99ff99,stroke:#000,stroke-width:2px style CheckGetAsNodes fill:#ffcc00,stroke:#000,stroke-width:2px style ConvertToAsNodes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnVertexList fill:#00cc00,stroke:#000,stroke-width:2px style ReturnConvertedVertexList fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getVtxList function:

  1. The process starts by checking the type of the asNode.

  2. If the node is not a mesh, curve, or lattice, it returns an empty list.

  3. For a mesh node, it retrieves the vertices of the mesh.

  4. For a curve node, it retrieves the vertices (CVs) of the curve.

  5. For a lattice node, it retrieves the lattice points.

  6. The function then compiles these vertices into a list.

  7. It checks if the vertices should be returned as asNode objects.

  8. If yes, it converts the list items to asNode objects and returns the converted list.

  9. If not, it returns the original list of vertices.

asNode.get_2PosExtn(self, destObjOrPos, extnRatio=1, locName='as_Extn_Loc', getLoc=True, getSpot=False, extnDist=None, **shArgs)#

[shArgs : do=destObjOrPos, er=extnRatio, ln=locName, gl=getLoc, ed=extnDist]

Purpose:

:: Calculates an extended position between the asNode and a destination object or position, often used in rigging for dynamic placement and animation paths.

Parameters:
  • destObjOrPos – <asNode/position> #The target object or position for the extension. destObjOrPos = node(str) #_ Direction Object for direction vector

  • extnRatio

    <float> #The ratio determining the extent of the extension.

    extnRatio:

    extnRatio = int | float         #_ Ration Value for Direction Extended Position
                            #_ 0 => at dirObj, 1.0 => at srcObj->dirObj distance away from dirObj
                            #_ -1.0 => at srcObj, -0.5 in the middle of srcObj and dirObj
    

  • locName – <str> #The name for the locator at the extended position. locName =name(str) #_ Name of returning locator

  • getLoc – <bool> #Specifies whether to return a locator at the extended position. getLoc = True | False #_ Whether to return locator or only position of extn point

  • extnDist – <float> #The distance for the extension, overriding the ratio if specified.

extnDist:

extnDist =      int | Float             #_ if extnDist is given, extnRatio is neglected.
#_ plusValue -> distance away from dirObj
#_ negValue  -> distance from dirObj to towards srcObj
Returns:

<list/asNode> #The calculated extended position, optionally including a locator.

Usage:

eMath.get_2PosExtn(selected()[0], selected()[1], 0.5)

_images/get_2PosExtn.jpg
Flow Chart Description:

This flowchart illustrates the get_2PosExtn function:

  1. Begins by checking if shArgs are provided and processes them.

  2. Retrieves the directional vector between the source and destination.

  3. Calculates the extended position based on the extension ratio or distance.

  4. Determines if a locator is needed at the extended position.

  5. Creates and snaps the locator to the source node, maintaining the extended length.

  6. Unfreezes transformations of the locator.

  7. Returns the locator or the final extended position based on the specified options.

asNode.get_2PosVect(self, destObjOrPos, **shArgs)#

[shArgs : do=dirObjOrPos]

Purpose:

:: Computes the directional vector between the asNode and a specified object or position. Useful in rigging and animation for path calculations and directional constraints.

Parameters:

dirObjOrPos – <asNode/position> #The target object or position to compute the directional vector towards.

Returns:

<list> #A vector representing the direction from the asNode to the specified target.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> GetSourcePosition["/fas:fa-map-marker-alt Get Source Position"] ProcessShArgs --> GetSourcePosition GetSourcePosition --> GetDestinationPosition{{"/fas:fa-crosshairs Get Destination Position"}} GetDestinationPosition --"If destObjOrPos is list" --> PositionAsDestination["/fas:fa-map-pin Position as Destination"] GetDestinationPosition --"If destObjOrPos is not list" --> ObjectAsDestination["/fas:fa-object-group Object as Destination"] PositionAsDestination --> ComputeDirectionalVector["/fas:fa-arrows-alt Compute Directional Vector"] ObjectAsDestination --> ComputeDirectionalVector ComputeDirectionalVector --> ReturnVector[("fas:fa-long-arrow-alt-right Return Directional Vector")] ReturnVector --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style GetSourcePosition fill:#99ff99,stroke:#000,stroke-width:2px style GetDestinationPosition fill:#ffcc00,stroke:#000,stroke-width:2px style PositionAsDestination fill:#99ccff,stroke:#000,stroke-width:2px style ObjectAsDestination fill:#99ccff,stroke:#000,stroke-width:2px style ComputeDirectionalVector fill:#99ff99,stroke:#000,stroke-width:2px style ReturnVector fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the get_2PosVect function:

  1. The process begins by checking if shArgs are provided and updates accordingly.

  2. It then retrieves the source position of the asNode.

  3. Determines if the destination is a position list or an object.

  4. Based on the destination type, the function computes the directional vector from the source to the destination.

  5. Finally, it returns the computed directional vector.

asNode.grpIt(self, grpLevel=1, snapPiv=0, grpSufxList=None, snapRot=0, worldTrans=0, grpPrfxList=None, useBothPrfxSufx=0, **shortArgs)#

[shArgs : gl=grpLevel, sp=snapPiv, gsl=grpSufxList, sr=snapRot, wt=worldTrans, gpl=grpPrfxList, ubps=useBothPrfxSufx]

Purpose:

:: Groups the asNode with various options for hierarchy, pivots, and naming. This function is integral to scene organization and rigging workflows.

Parameters:
  • grpLevel – <int> #The number of group nodes to add above the asNode.

  • snapPiv – <bool> #Determines whether to snap the pivot of the new group to the asNode.

  • grpSufxList – <list, optional> #Custom suffixes for the new group nodes.

  • snapRot – <bool> #Specifies whether to snap the rotation of the new group to the asNode.

  • worldTrans – <int> #The transformation mode for the new group node.

  • grpPrfxList – <list, optional> #Custom prefixes for the new group nodes.

  • useBothPrfxSufx – <bool> #Determines whether to use both prefixes and suffixes for naming.

Returns:

<list> #A list of the new group nodes created above the asNode.

Args:

[**shortArgs: grpLevel =gl; snapPiv =sp; grpSufxList =gsl; snapRot =sr; worldTrans =wt; grpPrfxList =gpl, useBothPrfxSufx =ubps]

grpLevel = 0 | int                              #_ No of groups to be added on top of asNode, 0 means no groups added
snapPiv = True | False                  #_ Snaps pivot of newly added group exactly to asNode
grpSufxList = None | strList    #_ List of custom Suffixes to be provided. by default, If None, it takes following suffix list
                                                                ['_Grp', '_GrpTp', '_GrpEx', '_TopGp', '_TopEx', '_RootGp', '_RootEx']
snapRot = True | False                  #_ Snaps the rotation of newly added group to asNode
worldTrans = 0 | 1 | 2                  #_ 0 -Pivot At origin, 1 -Pivot At asNode (but freezed), 2 -Pivot At asNode (global Trans values)
grpPrfxList = None | strList    #_ List of custom Prefixs to be provided. by default, If None, it takes following Prefixes list
                                                                ['Grp_', 'GrpTp_', 'GrpEx_', 'TopGp_', 'TopEx_', 'RootGp_', 'RootEx_']
useBothPrfxSufx = True | False  #_ Both prefixes and suffixes will be used. By default above prefix and suffix lists are used.
Returns:(asNodes)::

return grpList [lsitOfGrps(asNodes)]

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckGroupLevel{{"/fas:fa-sort-amount-up Check Group Level"}} ProcessShArgs --> CheckGroupLevel CheckGroupLevel --"If No Grouping Required" --> ReturnAsNode[("fas:fa-times-circle Return asNode")] CheckGroupLevel --"If Grouping Required" --> PrepareGrouping["/fas:fa-sitemap Prepare Grouping"] PrepareGrouping --> CreateGroupNodes[("/fas:fa-object-group Create Group Nodes")] CreateGroupNodes --> ApplySnapPivot{{"/fas:fa-map-pin Apply Snap Pivot"}} ApplySnapPivot --"If Snap Pivot" --> SnapPivotToAsNode["/fas:fa-magnet Snap Pivot to asNode"] ApplySnapPivot --"If No Snap Pivot" --> CheckSnapRotation{{"/fas:fa-sync-alt Check Snap Rotation"}} SnapPivotToAsNode --> CheckSnapRotation CheckSnapRotation --"If Snap Rotation" --> SnapRotationToAsNode["/fas:fa-undo-alt Snap Rotation to asNode"] CheckSnapRotation --"If No Snap Rotation" --> ApplyWorldTransform{{"/fas:fa-globe-americas Apply World Transform"}} SnapRotationToAsNode --> ApplyWorldTransform ApplyWorldTransform --"If World Transform" --> ApplyGlobalTransform["/fas:fa-globe Apply Global Transform"] ApplyWorldTransform --"If No World Transform" --> ReturnGroupNodes[("fas:fa-arrow-circle-right Return Group Nodes")] ApplyGlobalTransform --> ReturnGroupNodes ReturnGroupNodes --> End[("fas:fa-stop End")] ReturnAsNode --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckGroupLevel fill:#cc99ff,stroke:#000,stroke-width:2px style PrepareGrouping fill:#99ccff,stroke:#000,stroke-width:2px style CreateGroupNodes fill:#99ff99,stroke:#000,stroke-width:2px style ApplySnapPivot fill:#ffcc00,stroke:#000,stroke-width:2px style SnapPivotToAsNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckSnapRotation fill:#cc99ff,stroke:#000,stroke-width:2px style SnapRotationToAsNode fill:#99ff99,stroke:#000,stroke-width:2px style ApplyWorldTransform fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyGlobalTransform fill:#99ff99,stroke:#000,stroke-width:2px style ReturnGroupNodes fill:#00cc00,stroke:#000,stroke-width:2px style ReturnAsNode fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the grpIt function:

  1. The function begins by processing any provided short arguments.

  2. It then checks the required group level for the asNode.

  3. If no grouping is needed, it returns the asNode itself.

  4. For required grouping, it prepares the grouping process based on the group level.

  5. It then creates the necessary group nodes above the asNode.

  6. The function checks if the pivot of the new group nodes needs to be snapped to the asNode.

  7. If pivot snapping is required, it applies the snapping to each group node.

  8. Next, it checks if the rotation of the group nodes needs to be snapped to the asNode.

  9. If rotation snapping is required, it aligns each group node’s rotation to the asNode.

  10. It then applies world transformation settings based on the user’s choice.

  11. If world transformation is required, it applies global transformation settings.

  12. Finally, the function returns the list of created group nodes.

asNode.hasAttr(self, attrList, **shArgs)#

[shArgs : al=attrList]

Purpose:

:: Checks whether the asNode has specific attributes. This function is crucial in scripting to ensure attributes exist before attempting to manipulate them.

Parameters:

attrList – <list> #A list of attribute names to check for on the asNode.

Returns:

<bool> #Indicates whether the asNode has all the specified attributes.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> ConvertToList{{"/fas:fa-stream Convert to List"}} ProcessShArgs --> ConvertToList ConvertToList --> CheckEachAttr{{"/fas:fa-check-square Check Each Attribute"}} CheckEachAttr --"If All Attributes Exist" --> ReturnTrue[("fas:fa-check Return True")] CheckEachAttr --"If Any Attribute Does Not Exist" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ConvertToList fill:#99ccff,stroke:#000,stroke-width:2px style CheckEachAttr fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the hasAttr function:

  1. The function begins by checking if specific arguments are provided.

  2. It then processes the arguments, converting the attribute list to a standard list format.

  3. The function checks each attribute in the list to verify if the asNode has it.

  4. If all attributes in the list exist on the asNode, the function returns True.

  5. If any of the attributes do not exist on the asNode, the function returns False.

asNode.hasAttrLocked(self, attr, **shArgs)#

[shArgs : a=attr]

Purpose:

:: Determines if a specific attribute on the asNode is locked. Essential for rigging and automation scripts to avoid modifying locked attributes.

Parameters:

attr – <str> #The name of the attribute to check the lock status.

Returns:

<bool> #Indicates whether the specified attribute is locked.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> VerifyAttrExistence{{"/fas:fa-search-plus Verify Attribute Existence"}} ProcessShArgs --> VerifyAttrExistence VerifyAttrExistence --"If Attribute Exists" --> CheckAttrType{{"/fas:fa-sliders-h Check Attribute Type"}} VerifyAttrExistence --"If Attribute Does Not Exist" --> ReturnFalse1[("fas:fa-times Return False")] CheckAttrType --"If Attribute Type is double3" --> CheckSubAttributesLock{{"/fas:fa-puzzle-piece Check Sub-Attributes Lock"}} CheckAttrType --"If Other Attribute Types" --> CheckAttributeLock{{"/fas:fa-lock Check Attribute Lock"}} CheckSubAttributesLock --"If Any Sub-Attribute is Locked" --> ReturnTrue1[("fas:fa-lock Return True")] CheckSubAttributesLock --"If No Sub-Attribute is Locked" --> ReturnFalse2[("fas:fa-unlock Return False")] CheckAttributeLock --"If Attribute is Locked" --> ReturnTrue2[("fas:fa-lock Return True")] CheckAttributeLock --"If Attribute is Not Locked" --> ReturnFalse3[("fas:fa-unlock Return False")] ReturnTrue1 --> End[("fas:fa-stop End")] ReturnTrue2 --> End ReturnFalse1 --> End ReturnFalse2 --> End ReturnFalse3 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style VerifyAttrExistence fill:#99ccff,stroke:#000,stroke-width:2px style CheckAttrType fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSubAttributesLock fill:#99ff99,stroke:#000,stroke-width:2px style CheckAttributeLock fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTrue2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse3 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the hasAttrLocked function:

  1. The process begins by checking if specific arguments are provided.

  2. It then verifies the existence of the attribute on the asNode.

  3. If the attribute exists, the function checks its type.

  4. For attributes of type ‘double3’, it evaluates if any sub-attributes are locked.

  5. If any sub-attribute is locked, the function returns True.

  6. For other attribute types, it checks if the attribute itself is locked.

  7. If the attribute is locked, it returns True, otherwise False.

  8. If the attribute does not exist, the function returns False.

asNode.hasAttrLocked2(self, attr, **shArgs)#

doc

asNode.hasChild(self, trgtObj, **shArgs)#

[shArgs : to=trgtObj]

:: Checks if the asNode has a specific child node. This function is used in scene management and rigging to verify node hierarchies.

Parameters:

trgtObj – <asNode> #The target node to check as a child of the asNode.

Returns:

<bool> #Indicates whether the asNode has the specified child node.

graph TB Start[("(fa:fa-play Start hasChild)")] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> GetNodeDg["(fas:fa-sitemap Get Node Dag)"] GetNodeDg --"Retrieve the DAG node of asNode" --> CreateAsTrgt["(fas:fa-object-group Create asNode Target)"] CreateAsTrgt --"Create asNode target object" --> IsParentOf["(fas:fa-code-branch Check if Parent of Target)"] IsParentOf --"Check if asNode is parent of target node" --> ReturnTrue["(fas:fa-check Return True)"] IsParentOf --"If asNode is not parent of target node" --> ReturnFalse["(fas:fa-times Return False)"] ReturnTrue --"asNode has the specified child node" --> End[("(fas:fa-stop End)")] ReturnFalse --"asNode does not have the specified child node" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style GetNodeDg fill:#99cc99,stroke:#000,stroke-width:3px style CreateAsTrgt fill:#99cc99,stroke:#000,stroke-width:3px style IsParentOf fill:#ff99cc,stroke:#000,stroke-width:3px style ReturnTrue fill:#99cc99,stroke:#000,stroke-width:3px style ReturnFalse fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the hasChild function:

  1. The process starts with checking if specific arguments (shArgs) are provided.

  2. If shArgs are provided, the function updates the parameters accordingly.

  3. The function retrieves the DAG (Directed Acyclic Graph) node of the asNode.

  4. It then creates an asNode target object to check against.

  5. The function checks if the asNode is the parent of the target node.

  6. If the asNode is the parent, it returns True, indicating the asNode has the specified child.

  7. If the asNode is not the parent, it returns False, indicating the asNode does not have the specified child.

asNode.hasParent(self, trgtObj, numParent=None, **shArgs)#

[shArgs : to=trgtObj, np=numParent] :: Determines if the asNode has a specific parent node, up to a certain level in the hierarchy. Useful for validating node relationships in complex scenes.

Parameters:
  • trgtObj – <asNode> #The target node to check as a parent of the asNode.

  • numParent – <int, optional> #The number of parent levels to check.

Returns:

<bool> #Indicates whether the asNode has the specified parent node within the given hierarchy level.

asNode.hasShape(self, **shArgs)#

[shArgs] :: Checks whether the asNode has a shape node associated with it. This function is crucial for scripts that need to work with the geometry of an object. :return: <bool> #Indicates whether the asNode has an associated shape node.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> BypassShArgs["/fas:fa-forward Bypass shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckCNum{{"/fas:fa-check-circle Check _cNum"}} BypassShArgs --> CheckCNum CheckCNum --"If _cNum is not None" --> CheckCNumValue{{"/fas:fa-sort-numeric-up Check _cNum Value"}} CheckCNum --"If _cNum is None" --> ListRelatives1["/fas:fa-sitemap List Relatives"] CheckCNumValue --"If _cNum >= 0" --> ListRelatives2["/fas:fa-sitemap-alt List Relatives"] CheckCNumValue --"If _cNum < 0" --> ListRelatives1 ListRelatives1 --> CheckShapes1{{"/fas:fa-shapes Check Shapes"}} ListRelatives2 --> CheckShapes2{{"/fas:fa-shapes Check Shapes"}} CheckShapes1 --"If shapes exist" --> ReturnTrue1[("fas:fa-check Return True")] CheckShapes1 --"If no shapes" --> ReturnFalse1[("fas:fa-times Return False")] CheckShapes2 --"If shapes exist" --> ReturnTrue2[("fas:fa-check Return True")] CheckShapes2 --"If no shapes" --> ReturnFalse2[("fas:fa-times Return False")] ReturnTrue1 --> End[("fas:fa-stop End")] ReturnFalse1 --> End ReturnTrue2 --> End ReturnFalse2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style BypassShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckCNum fill:#cc99ff,stroke:#000,stroke-width:2px style CheckCNumValue fill:#99ccff,stroke:#000,stroke-width:2px style ListRelatives1 fill:#99ff99,stroke:#000,stroke-width:2px style ListRelatives2 fill:#99ff99,stroke:#000,stroke-width:2px style CheckShapes1 fill:#ffcc00,stroke:#000,stroke-width:2px style CheckShapes2 fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTrue2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.hasUniqueName(self, **shArgs)#

[shArgs] :: Verifies if the asNode has a unique name in the Maya scene. This is important for scripts that require distinct identification of nodes. :return: <bool> #Indicates whether the asNode has a unique name within the scene.

..mermaid:

graph TB
    Start[("fa:fa-play Start")] --> CheckArgs{{"/fas:fa-question Check Args"}}
    CheckArgs --"If shArgs is provided" --> ProcessArgs["/fas:fa-cogs Process Args"]
    CheckArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"]
    ProcessArgs --> SetNcTypes
    SetNcTypes --> CreateDepNode["/fas:fa-sitemap Create DepNode"]
    CreateDepNode --"Create MFnDependencyNode instance" --> CheckUniqueName["/fas:fa-search-plus Check Unique Name"]
    CheckUniqueName --"Return hasUniqueName result" --> End[("fas:fa-stop End")]
    style Start fill:#00cc00,stroke:#000,stroke-width:3px
    style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px
    style ProcessArgs fill:#ff9999,stroke:#000,stroke-width:2px
    style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px
    style CreateDepNode fill:#cc99ff,stroke:#000,stroke-width:2px
    style CheckUniqueName fill:#99ff99,stroke:#000,stroke-width:2px
    style End fill:#ff6666,stroke:#000,stroke-width:3px
asNode.hide(self, drawStyle=0, **shArgs)#

[shArgs : ds=drawStyle] :: Hides the asNode in the Maya scene, commonly used in rigging and scene management to declutter the viewport. If any node’s visibility is locked, it will unlock, hide and lock the visibility again.. :param drawStyle: <int> #The draw style to apply when hiding the node. :return: <None> #No return value, the asNode is hidden in the scene.

graph TB Start[("(fa:fa-play Start hide)")] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> GetAttr["(fas:fa-eye-slash Get Attribute 'v')"] GetAttr --"Check if visibility attribute is off" --> AlreadyHidden["(fas:fa-eye-slash Already Hidden)"] GetAttr --"If visibility attribute is on" --> DrawStyleCheck["(fas:fa-paint-brush Check Draw Style)"] DrawStyleCheck --"If draw style is set" --> SetDrawStyle["(fas:fa-paint-brush Set Draw Style)"] DrawStyleCheck --"If no draw style is set" --> TryHide["(fas:fa-eye-slash Try to Hide)"] TryHide --"Attempt to hide the node" --> CheckLock["(fas:fa-lock Check if Locked)"] CheckLock --"If attribute is locked" --> UnlockHideLock["(fas:fa-lock-open Unlock, Hide, Lock)"] CheckLock --"If attribute is not locked" --> HideNode["(fas:fa-eye-slash Hide Node)"] AlreadyHidden --"Node is already hidden" --> End[("(fas:fa-stop End)")] SetDrawStyle --"Draw style applied" --> End UnlockHideLock --"Visibility changed with lock handling" --> End HideNode --"Node hidden successfully" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style GetAttr fill:#99cc99,stroke:#000,stroke-width:3px style AlreadyHidden fill:#ff99cc,stroke:#000,stroke-width:3px style DrawStyleCheck fill:#99cc99,stroke:#000,stroke-width:3px style SetDrawStyle fill:#99cc99,stroke:#000,stroke-width:3px style TryHide fill:#99cc99,stroke:#000,stroke-width:3px style CheckLock fill:#99cc99,stroke:#000,stroke-width:3px style UnlockHideLock fill:#99cc99,stroke:#000,stroke-width:3px style HideNode fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the hide function:

  1. The function begins by checking if specific arguments (shArgs) are provided.

  2. It then retrieves the visibility attribute (‘v’) of the asNode.

  3. If the asNode is already hidden, the process ends.

  4. If the asNode is visible, the function checks if a draw style is set.

  5. If a draw style is set, it applies this style and the process ends.

  6. If no draw style is set, the function attempts to hide the asNode.

  7. It checks if the visibility attribute is locked.

  8. If locked, it unlocks the attribute, hides the node, and relocks the attribute.

  9. If not locked, it directly hides the node.

  10. The function then concludes.

asNode.intersects(self, trgtObj, **shArgs)#

[shArgs : to=trgtObj] :: Checks if the asNode intersects with another specified object. This function is crucial in collision detection and spatial analysis.

Parameters:

trgtObj – <asNode> #The target object to check for intersection.

Returns:

<bool> #Indicates whether the asNode intersects with the target object.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> UpdateTrgtObj["/fas:fa-cogs Update Target Object"] CheckShArgs --"If shArgs is not provided" --> CreateBBox["/fas:fa-cube Create Bounding Box"] UpdateTrgtObj --> CreateBBox CreateBBox --"Create Bounding Box for asNode" --> CreateTrgtBBox["/fas:fa-cube Create Target Bounding Box"] CreateTrgtBBox --"Create Bounding Box for Target Object" --> CheckIntersection{{"/fas:fa-crosshairs Check Intersection"}} CheckIntersection --"If Intersects" --> ReturnTrue[("fas:fa-check Return True")] CheckIntersection --"If No Intersection" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateTrgtObj fill:#99ccff,stroke:#000,stroke-width:2px style CreateBBox fill:#99ccff,stroke:#000,stroke-width:2px style CreateTrgtBBox fill:#99ccff,stroke:#000,stroke-width:2px style CheckIntersection fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrue fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the intersects function:

  1. The process starts by checking if specific arguments (shArgs) are provided.

  2. If provided, the target object (trgtObj) is updated accordingly.

  3. The function then creates bounding boxes for both the asNode and the target object.

  4. It checks if the bounding boxes of the asNode and the target object intersect.

  5. If an intersection is detected, the function returns True.

  6. If there is no intersection, the function returns False.

  7. The process ends after determining the intersection status.

asNode.isAnimated(self, attr=None, **shArgs)#

[shArgs : a=attr]

Purpose:

:: Determines if the asNode or a specific attribute on it is animated. Essential for animation scripts to identify animated nodes or properties.

Parameters:

attr – <str, optional> #The attribute to check for animation.

Returns:

<bool> #Indicates whether the asNode or the specified attribute is animated.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CheckAttr{{"/fas:fa-search-plus Check attr"}} CheckAttr --"If attr is provided" --> FindKeyframeAttr["/fas:fa-key Find Keyframe with attr"] CheckAttr --"If attr is not provided" --> FindKeyframe["/fas:fa-key Find Keyframe"] FindKeyframeAttr --"If keyframe found" --> ReturnTrue1[("fas:fa-check Return True")] FindKeyframeAttr --"If no keyframe found" --> ReturnFalse1[("fas:fa-times Return False")] FindKeyframe --"If keyframe found" --> ReturnTrue2[("fas:fa-check Return True")] FindKeyframe --"If no keyframe found" --> ReturnFalse2[("fas:fa-times Return False")] ReturnTrue1 --> End[("fas:fa-stop End")] ReturnFalse1 --> End ReturnTrue2 --> End ReturnFalse2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckAttr fill:#cc99ff,stroke:#000,stroke-width:2px style FindKeyframeAttr fill:#99ff99,stroke:#000,stroke-width:2px style FindKeyframe fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTrue2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isAnimated function:

  1. The process begins by checking if specific arguments (shArgs) are provided.

  2. If provided, the function updates the attributes to check for animation.

  3. The function then sets the necessary node categories (ncTypes).

  4. It checks if a specific attribute is provided.

  5. If an attribute is provided, the function finds keyframes associated with that attribute.

  6. If keyframes are found, it returns True, indicating the attribute is animated.

  7. If no keyframes are found, it returns False, indicating the attribute is not animated.

  8. If no specific attribute is provided, the function checks for any keyframe on the asNode.

  9. If keyframes are found on the node, it returns True.

  10. If no keyframes are found on the node, it returns False.

  11. The process concludes after determining the animation status of the asNode or the specified attribute.

asNode.isBlendShape(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a valid blendShape deformer. This function is important in deformation and rigging workflows to identify blendShape nodes.

Returns:

<bool> #Indicates whether the asNode is a valid blendShape deformer.

_images/isBlendShape.jpg
Flow Chart Description:

This flowchart illustrates the isBlendShape function:

  1. The process begins by checking the type of the asNode.

  2. It determines if the node type matches ‘blendShape’.

  3. If the node is a blendShape, the function returns True, indicating it is a valid blendShape deformer.

  4. If the node is not a blendShape, the function returns False.

  5. The process concludes after determining the blendShape status of the asNode.

asNode.isCV(self, **shArgs)#

[shArgs]

Purpose:

:: Determines if the asNode represents a control vertex (CV). This function is critical in scripts dealing with curve and surface manipulation.

Returns:

<bool> #Indicates whether the asNode is a control vertex.

graph TB Start[("fa:fa-play Start")] --> CheckNodeName{{"/fas:fa-search-plus Check Node Name"}} CheckNodeName --"If '.cv[' in name" --> ReturnTrue[("fas:fa-check Return True")] CheckNodeName --"If '.cv[' not in name" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeName fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isCV function:

  1. The process starts by checking the name of the asNode.

  2. If the name contains ‘.cv[’, it indicates the asNode is a control vertex (CV), and the function returns True.

  3. If the name does not contain ‘.cv[’, the asNode is not a control vertex, and the function returns False.

asNode.isChildOf(self, trgtObj, checkAllParents=0, childImplied=True, **shArgs)#

[shArgs : to=trgtObj, ca=checkAllParents, ci=childImplied]

Purpose:

:: Checks if the asNode is a child of a specified target node. Useful in hierarchy traversal and verification in rigging and scene management.

If checkAllParents : trgtObj can be any of its parent else : trgtObj will be checked only for firstParent

Parameters:
  • trgtObj – <asNode> #The target node to check against.

  • checkAllParents – <bool> #Determines whether to check all parent levels.

  • childImplied – <bool> #Considers implied parent-child relationships.

Returns:

<bool> #Indicates whether the asNode is a child of the specified target node.

graph TB Start[("fa:fa-play Start isChildOf")] --> CheckArgs{{"/fas:fa-question Check shArgs"}} CheckArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckArgs --"If shArgs is not provided" --> CreateAsTarget["/fas:fa-object-group Create asNode Target"] ProcessShArgs --> CreateAsTarget CreateAsTarget --"Create asNode target object" --> CheckAllParents{{"/fas:fa-code-branch Check All Parents"}} CheckAllParents --"If checking all parents" --> HasParentCheck["/fas:fa-sitemap Has Parent Check"] CheckAllParents --"If not checking all parents" --> GetParentNode["/fas:fa-arrow-alt-circle-up Get Parent Node"] HasParentCheck --"Check if asNode has specified parent" --> ReturnResult1[("fas:fa-arrow-circle-right Return Result")] GetParentNode --"Retrieve parent of asNode" --> CompareParentToTarget{{"/fas:fa-balance-scale Compare Parent to Target"}} CompareParentToTarget --"If parent matches target" --> ReturnTrue[("fas:fa-check-circle Return True")] CompareParentToTarget --"If parent does not match target" --> ReturnFalse[("fas:fa-times-circle Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End ReturnResult1 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CreateAsTarget fill:#99ccff,stroke:#000,stroke-width:2px style CheckAllParents fill:#cc99ff,stroke:#000,stroke-width:2px style HasParentCheck fill:#99ff99,stroke:#000,stroke-width:2px style GetParentNode fill:#99ccff,stroke:#000,stroke-width:2px style CompareParentToTarget fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style ReturnResult1 fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isChildOf function:

  1. The process begins by checking if shArgs are provided and updates parameters accordingly.

  2. An asNode target object is created for comparison.

  3. The function checks if all parent levels are to be considered.

  4. If checking all parents, it performs a “Has Parent Check” to see if the trgtObj is any parent of the asNode.

  5. If not checking all parents, it retrieves the immediate parent of the asNode.

  6. It then compares this parent to the target node.

  7. If the parent matches the target, the function returns True, indicating the asNode is a child of the target.

  8. If the parent does not match, the function returns False.

  9. The process concludes after determining the child relationship of the asNode to the target node.

asNode.isComponent(self, **shArgs)#

[shArgs]

Purpose:

:: Determines if the asNode is a component like a vertex, edge, or face. This is important in modeling scripts where components need to be identified and manipulated separately from objects.

Returns:

<bool> #Indicates whether the asNode is a component.

graph TB Start[("fa:fa-play Start isComponent")] --> CheckDotPresence{{"/fas:fa-search-plus Check '.' Presence"}} CheckDotPresence --"If '.' in asNode name" --> ReturnTrue[("fas:fa-check-circle Return True")] CheckDotPresence --"If no '.' in asNode name" --> ReturnFalse[("fas:fa-times-circle Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckDotPresence fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isComponent function:

  1. The process starts by checking if the name of the asNode contains a ‘.’ character.

  2. If a ‘.’ is present in the asNode’s name, the function concludes that the asNode is a component and returns True.

  3. If there is no ‘.’ in the asNode’s name, the function determines that the asNode is not a component and returns False.

  4. The process ends after determining the component status of the asNode.

asNode.isComponentOf(self, objList=None, **shArgs)#

[shArgs : ol=objList]

Purpose:

:: Checks if the asNode is a component of any objects in a given list. Useful in scripts that need to verify the association of components to specific objects.

Parameters:

objList – <list, optional> #A list of objects to check the asNode’s component relationship with.

Returns:

<bool> #Indicates whether the asNode is a component of any of the listed objects.

graph TB Start[("fa:fa-play Start isComponentOf")] --> CheckArgs{{"/fas:fa-question Check shArgs"}} CheckArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckArgs --"If shArgs is not provided" --> GetSelectedObjects["/fas:fa-mouse-pointer Get Selected Objects"] ProcessShArgs --> CheckComponentStatus["/fas:fa-puzzle-piece Check Component Status"] GetSelectedObjects --> CheckComponentStatus CheckComponentStatus --"If asNode is not a component" --> ReturnFalse1[("fas:fa-times-circle Return False")] CheckComponentStatus --"If asNode is a component" --> CheckInObjList{{"/fas:fa-list Check In ObjList"}} CheckInObjList --"If asNode in objList" --> ReturnTrue[("fas:fa-check-circle Return True")] CheckInObjList --"If asNode not in objList" --> ReturnFalse2[("fas:fa-times-circle Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse1 --> End ReturnFalse2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style GetSelectedObjects fill:#99ccff,stroke:#000,stroke-width:2px style CheckComponentStatus fill:#cc99ff,stroke:#000,stroke-width:2px style CheckInObjList fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isComponentOf function:

  1. The process starts by checking if shArgs are provided and updates the objList if necessary.

  2. If shArgs is not provided, the function retrieves a list of currently selected objects.

  3. Next, it checks if the asNode is a component.

  4. If the asNode is not a component, the function returns False.

  5. If the asNode is a component, it checks if the asNode is part of any object in the objList.

  6. If the asNode is found in the objList, the function returns True; otherwise, it returns False.

  7. The process ends after determining the component relationship of the asNode with the objects in the list.

asNode.isConnected(self, attrName, **shArgs)#

[shArgs : an=attrName]

Purpose:

:: Verifies if a specific attribute on the asNode is connected to any other nodes. Crucial in node-based workflows for determining connections and dependencies.

Parameters:

attrName – <str> #The name of the attribute to check for connections.

Returns:

<bool> #Indicates whether the specified attribute is connected to other nodes.

graph TB Start[("fa:fa-play Start isConnected")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> GetAttrName{{"/fas:fa-i-cursor Get Attribute Name"}} ProcessShArgs --> GetAttrName GetAttrName --"Retrieve the attribute name" --> CheckConnection["/fas:fa-link Check Connection"] CheckConnection --"Check if attribute is connected" --> ReturnResult{{"/fas:fa-check-circle Return Result"}} ReturnResult --"If connected" --> ReturnTrue[("fas:fa-check Return True")] ReturnResult --"If not connected" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style GetAttrName fill:#99ccff,stroke:#000,stroke-width:2px style CheckConnection fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnResult fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isConnected function:

  1. The process starts by checking if shArgs are provided and updates the attrName if necessary.

  2. If shArgs is not provided, it retrieves the name of the attribute to check for connections.

  3. The function then checks if the specified attribute is connected to any other nodes.

  4. Based on the connection status, it returns True if the attribute is connected, or False if it is not.

  5. The process concludes after determining the connection status of the specified attribute.

asNode.isConstrained(self, byTrgtList=None, constrainList=None, **shArgs)#

[shArgs : btl=byTrgtList, cl=constrainList]

Purpose:

:: Determines if the asNode is constrained by specific targets or constraint types. This is key in rigging and animation for understanding constraint dependencies.

Parameters:
  • byTrgtList – <list, optional> #A list of target nodes to check constraints against.

  • constrainList – <list, optional> #A list of constraint types to check for.

Returns:

<bool> #Indicates whether the asNode is constrained by the specified targets or constraint types.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateByTrgtList["/fas:fa-edit Update byTrgtList"] UpdateByTrgtList --> UpdateConstrainList["/fas:fa-edit Update constrainList"] UpdateConstrainList --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> InitializeTrgtList{{"/fas:fa-list-ol Initialize TrgtList"}} InitializeTrgtList --"If byTrgtList" --> ConvertTrgtListToList["/fas:fa-object-group Convert TrgtList to List"] InitializeTrgtList --"If No byTrgtList" --> ProcessConstrainList{{"/fas:fa-cogs Process ConstrainList"}} ConvertTrgtListToList --> ProcessConstrainList ProcessConstrainList --"If constrainList" --> GetConstrainList["/fas:fa-tasks Get ConstrainList"] ProcessConstrainList --"If No constrainList" --> TestListFalse["/fas:fa-times-circle TestList = False"] GetConstrainList --> LoopConstrainList{{"/fas:fa-repeat Loop ConstrainList"}} LoopConstrainList --> CheckTrgtList{{"/fas:fa-question Check TrgtList"}} CheckTrgtList --"If TrgtList" --> LoopTrgtList{{"/fas:fa-repeat Loop TrgtList"}} CheckTrgtList --"If No TrgtList" --> ConstrainExistsTest["/fas:fa-check-square Constrain Exists Test"] LoopTrgtList --> CheckTrgtInConstrainList{{"/fas:fa-question Check Trgt In ConstrainList"}} CheckTrgtInConstrainList --"If Trgt In ConstrainList" --> TestListTrue["/fas:fa-check TestList = True"] CheckTrgtInConstrainList --"If Trgt Not In ConstrainList" --> TestListFalseInLoop["/fas:fa-times-circle TestList = False"] ConstrainExistsTest --"If Constrain Exists" --> TestListTrue ConstrainExistsTest --"If Constrain Does Not Exist" --> TestListFalseInLoop TestListTrue --> EndLoop{{"/fas:fa-repeat End Loop"}} TestListFalseInLoop --> EndLoop EndLoop --"If More Constraints" --> LoopConstrainList EndLoop --"If No More Constraints" --> ReturnResult{{"/fas:fa-arrow-right Return Result"}} TestListFalse --> ReturnResult ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateByTrgtList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateConstrainList fill:#99ccff,stroke:#000,stroke-width:2px style SetNcTypes fill:#cc99ff,stroke:#000,stroke-width:2px style InitializeTrgtList fill:#99ff99,stroke:#000,stroke-width:2px style ConvertTrgtListToList fill:#ff9999,stroke:#000,stroke-width:2px style ProcessConstrainList fill:#99ccff,stroke:#000,stroke-width:2px style GetConstrainList fill:#cc99ff,stroke:#000,stroke-width:2px style LoopConstrainList fill:#99ff99,stroke:#000,stroke-width:2px style CheckTrgtList fill:#ff9999,stroke:#000,stroke-width:2px style LoopTrgtList fill:#99ccff,stroke:#000,stroke-width:2px style CheckTrgtInConstrainList fill:#cc99ff,stroke:#000,stroke-width:2px style TestListTrue fill:#99ff99,stroke:#000,stroke-width:2px style TestListFalseInLoop fill:#ff9999,stroke:#000,stroke-width:2px style ConstrainExistsTest fill:#99ccff,stroke:#000,stroke-width:2px style EndLoop fill:#cc99ff,stroke:#000,stroke-width:2px style TestListFalse fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#99ccff,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isConstrained function:

  1. The process starts by checking if shArgs are provided and updates byTrgtList and constrainList as necessary.

  2. It initializes trgtList based on byTrgtList and converts it to a list if needed.

  3. The function processes constrainList, checking if constraints exist and looping through each constraint.

  4. It checks each constraint against the trgtList, determining if the constraint is influenced by the targets.

  5. The process concludes by returning True if the asNode is constrained by the specified targets or constraint types, otherwise False.

asNode.isConstraint(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a constraint node, such as a parent, point, or orient constraint. Essential in rigging and animation for identifying constraint nodes.

Returns:

<bool> #Indicates whether the asNode is a constraint node.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> SkipToNodeCheck CheckShArgs --"If shArgs not provided" --> SkipToNodeCheck SkipToNodeCheck --> SetConstraintList["/fas:fa-list-ol Set Constraint List"] SetConstraintList --> CheckNodeType{{"/fas:fa-check-circle Check Node Type"}} CheckNodeType --"If Node Type in Constraint List" --> ReturnTrue["/fas:fa-check Return True"] CheckNodeType --"If Node Type not in Constraint List" --> ReturnFalse["/fas:fa-times Return False"] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SkipToNodeCheck fill:#99ccff,stroke:#000,stroke-width:2px style SetConstraintList fill:#cc99ff,stroke:#000,stroke-width:2px style CheckNodeType fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue fill:#ff9999,stroke:#000,stroke-width:2px style ReturnFalse fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#cc99ff,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isConstraint function:

  1. The process starts by checking if shArgs are provided. If not, it proceeds directly to checking the node type.

  2. It sets a list of constraint types like parentConstraint, pointConstraint, orientConstraint, aimConstraint, and scaleConstraint.

  3. The function then checks if the node type of the asNode is in the list of constraint types.

  4. If the node type is in the list, it returns True, indicating the asNode is a constraint node.

  5. If the node type is not in the list, it returns False, indicating the asNode is not a constraint node.

asNode.isCurv(self, **shArgs)#

[shArgs]

Purpose:

:: Determines if the asNode represents a curve, like a NURBS or Bezier curve. Important in scripts dealing with curve creation, manipulation, and analysis.

Returns:

<bool> #Indicates whether the asNode is a curve.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> BypassShArgs["/fas:fa-forward Bypass shArgs"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] BypassShArgs --> SetNcTypes SetNcTypes --> GetShape{{"/fas:fa-shapes Get Shape"}} GetShape --"If Shape exists" --> CheckNodeTypeShape{{"/fas:fa-code-branch Check Node Type of Shape"}} GetShape --"If No Shape" --> CheckNodeTypeSelf{{"/fas:fa-code-branch Check Node Type of Self"}} CheckNodeTypeShape --"If 'nurbsCurve'" --> ReturnTrue1[("fas:fa-check Return True")] CheckNodeTypeShape --"If not 'nurbsCurve'" --> ReturnFalse1[("fas:fa-times Return False")] CheckNodeTypeSelf --"If 'nurbsCurve'" --> ReturnTrue2[("fas:fa-check Return True")] CheckNodeTypeSelf --"If not 'nurbsCurve'" --> ReturnFalse2[("fas:fa-times Return False")] ReturnTrue1 --> End[("fas:fa-stop End")] ReturnFalse1 --> End ReturnTrue2 --> End ReturnFalse2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style BypassShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style GetShape fill:#99ff99,stroke:#000,stroke-width:2px style CheckNodeTypeShape fill:#ffcc00,stroke:#000,stroke-width:2px style CheckNodeTypeSelf fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTrue2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isCurv function:

  1. The process begins by checking if any shArgs are provided. If none, it proceeds to set node types.

  2. It then checks if the asNode has a shape. If it does, the node type of the shape is verified.

  3. If the shape exists and its node type is ‘nurbsCurve’, the function returns True, indicating the asNode is a curve.

  4. If the shape exists but its node type is not ‘nurbsCurve’, the function returns False, indicating the asNode is not a curve.

  5. If the asNode does not have a shape, it checks the node type of the asNode itself.

  6. If the asNode’s node type is ‘nurbsCurve’, the function returns True.

  7. If the asNode’s node type is not ‘nurbsCurve’, the function returns False.

asNode.isDeformer(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a valid deformer node, used in deformation scripts to identify nodes that manipulate geometry, like blendShapes or skinClusters.

Returns:

<bool> #Indicates whether the asNode is a valid deformer node.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> SkipToNodeTypeCheck CheckShArgs --"If shArgs not provided" --> SkipToNodeTypeCheck SkipToNodeTypeCheck --> GetNodeType["/fas:fa-info-circle Get Node Type"] GetNodeType --> CheckDeformerType{{"/fas:fa-check-circle Check Deformer Type"}} CheckDeformerType --"If Node Type is Geometry Filter" --> ReturnTrue["/fas:fa-check Return True"] CheckDeformerType --"If Node Type is Not Geometry Filter" --> ReturnFalse["/fas:fa-times Return False"] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SkipToNodeTypeCheck fill:#99ccff,stroke:#000,stroke-width:2px style GetNodeType fill:#cc99ff,stroke:#000,stroke-width:2px style CheckDeformerType fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue fill:#ff9999,stroke:#000,stroke-width:2px style ReturnFalse fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#cc99ff,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isDeformer function:

  1. The process starts by checking the node type of the asNode.

  2. If the node type is ‘geometryFilter’, it indicates the asNode is a deformer node, and the function returns True.

  3. If the node type is not ‘geometryFilter’, the asNode is not a deformer node, and the function returns False.

asNode.isEdge(self, **shArgs)#

[shArgs]

Purpose:

:: Identifies if the asNode represents an edge in a mesh. Key in modeling scripts for operations that specifically target edges, such as beveling or subdividing.

Returns:

<bool> #Indicates whether the asNode is an edge in a mesh.

graph TB Start[("fa:fa-play Start")] --> CheckName{{"/fas:fa-search-plus Check Name"}} CheckName --"If '.e[' in Name" --> ReturnTrue[("fas:fa-check Return True")] CheckName --"If '.e[' not in Name" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckName fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isEdge function:

  1. The process begins by checking the name of the asNode.

  2. If the name contains ‘.e[’, indicating an edge component in a mesh, the function returns True.

  3. If the name does not contain ‘.e[’, the asNode is not an edge component, and the function returns False.

asNode.isFace(self, **shArgs)#

[shArgs]

Purpose:

:: Determines if the asNode represents a face component in a mesh. Essential in scripts for face-level operations in modeling and rigging.

Returns:

<bool> #Indicates whether the asNode is a face component in a mesh.

graph TB Start[("fa:fa-play Start")] --> CheckName{{"/fas:fa-search-plus Check Name"}} CheckName --"If '.f[' in Name" --> ReturnTrue[("fas:fa-check Return True")] CheckName --"If '.f[' not in Name" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckName fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isFace function:

  1. The process starts by checking the name of the asNode.

  2. If the name includes ‘.f[’, indicating a face component in a mesh, the function returns True.

  3. If the name does not contain ‘.f[’, the asNode is not a face component, and the function returns False.

asNode.isFreezed(self, attrList=['t', 'r', 's'], checkAllParents=1, getUnfreezed=0, *args, **kwargs)#

[shArgs : al=attrList, cap=checkAllParents, gu=getUnfreezed]

Purpose:

:: Checks whether the asNode’s transformations (translate, rotate, scale) are frozen. This is critical for rigging and animation scripts to ensure proper node transformations.

Parameters:
  • attrList – <list> #A list of attributes (e.g., ‘t’, ‘r’, ‘s’) to check for being frozen.

  • checkAllParents – <bool> #Determines whether to check all parent nodes for frozen transformations.

  • getUnfreezed – <bool> #Specifies whether to return attributes that are not frozen.

Returns:

<bool/list> #Indicates whether the specified attributes are frozen, optionally returning unfrozen attributes.

graph TB Start[("fa:fa-play Start")] --> CheckArgs{{"/fas:fa-question Check Args"}} CheckArgs --"If kwargs provided" --> UpdateParams["/fas:fa-cogs Update Parameters"] UpdateParams --> InitializeAttrList["/fas:fa-stream Initialize Attr List"] CheckArgs --"If kwargs not provided" --> InitializeAttrList InitializeAttrList --> LoopAttrList{{"/fas:fa-repeat Loop Attr List"}} LoopAttrList --> CheckAttrValue{{"/fas:fa-check-circle Check Attr Value"}} CheckAttrValue --"If 's' and Value != [1.0, 1.0, 1.0]" --> AppendToUnFreezed1["/fas:fa-plus-square Append to UnFreezed"] CheckAttrValue --"If 't' or 'r' and Value != [0.0, 0.0, 0.0]" --> AppendToUnFreezed2["/fas:fa-plus-square Append to UnFreezed"] CheckAttrValue --"If Value matches default" --> NextAttr["/fas:fa-arrow-right Next Attr"] AppendToUnFreezed1 --> BreakLoop1["/fas:fa-hand-paper Break Loop"] AppendToUnFreezed2 --> BreakLoop2["/fas:fa-hand-paper Break Loop"] NextAttr --> LoopAttrList BreakLoop1 --> CheckAllParents{{"/fas:fa-code-branch Check All Parents"}} BreakLoop2 --> CheckAllParents CheckAllParents --"If checkAllParents" --> LoopParentList{{"/fas:fa-repeat Loop Parent List"}} LoopParentList --> ParentAttrCheck{{"/fas:fa-check-circle Parent Attr Check"}} ParentAttrCheck --"Check Attrs in Parents" --> UpdateCheckList["/fas:fa-list-ul Update Check List"] UpdateCheckList --> EndLoopParents["/fas:fa-forward End Loop Parents"] EndLoopParents --> LoopParentList LoopParentList --"End of Parent List" --> ReturnResult1{{"/fas:fa-arrow-right Return Result"}} CheckAllParents --"If not checkAllParents" --> ReturnResult2{{"/fas:fa-arrow-right Return Result"}} ReturnResult1 --> End[("fas:fa-stop End")] ReturnResult2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams fill:#ff9999,stroke:#000,stroke-width:2px style InitializeAttrList fill:#99ccff,stroke:#000,stroke-width:2px style LoopAttrList fill:#cc99ff,stroke:#000,stroke-width:2px style CheckAttrValue fill:#99ff99,stroke:#000,stroke-width:2px style AppendToUnFreezed1 fill:#ff9999,stroke:#000,stroke-width:2px style AppendToUnFreezed2 fill:#ff9999,stroke:#000,stroke-width:2px style NextAttr fill:#99ccff,stroke:#000,stroke-width:2px style BreakLoop1 fill:#cc99ff,stroke:#000,stroke-width:2px style BreakLoop2 fill:#cc99ff,stroke:#000,stroke-width:2px style CheckAllParents fill:#99ff99,stroke:#000,stroke-width:2px style LoopParentList fill:#ff9999,stroke:#000,stroke-width:2px style ParentAttrCheck fill:#99ccff,stroke:#000,stroke-width:2px style UpdateCheckList fill:#cc99ff,stroke:#000,stroke-width:2px style EndLoopParents fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult1 fill:#ff9999,stroke:#000,stroke-width:2px style ReturnResult2 fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isFreezed function:

  1. The process starts by checking if additional parameters are provided.

  2. If provided, parameters are updated; otherwise, default values are used.

  3. The function then loops through the attributes in attrList to check if they match default frozen values.

  4. If an attribute does not match and getUnfreezed is True, it is appended to the UnFreezed list.

  5. If checkAllParents is True, the process repeats for all parent nodes.

  6. The function returns a boolean indicating if all transformations are frozen or a list of unfrozen attributes.

asNode.isHidden(self, checkParents=True, **shArgs)#

[shArgs : cp=checkParents]

Purpose:

:: Determines if the asNode is hidden in the Maya scene. This function is useful in scripts that need to identify the visibility status of nodes.

Parameters:

checkParents – <bool> #Determines whether to consider the visibility status of parent nodes.

Returns:

<bool> #Indicates whether the asNode is hidden.

graph TB Start["(fa:fa-play Start isHidden)"] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> IsVisibleCheck["(fas:fa-eye Is Visible Check)"] IsVisibleCheck --"Check if the object is visible" --> ReturnTrue["(fas:fa-check Return True)"] IsVisibleCheck --"If object is visible" --> ReturnFalse["(fas:fa-times Return False)"] ReturnTrue --"Object is hidden" --> End["(fas:fa-stop End)"] ReturnFalse --"Object is not hidden" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style IsVisibleCheck fill:#99cc99,stroke:#000,stroke-width:3px style ReturnTrue fill:#ff99cc,stroke:#000,stroke-width:3px style ReturnFalse fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the isHidden function:

  1. The function checks if additional arguments are provided. If so, parameters are updated accordingly.

  2. The visibility of the asNode is checked. If the asNode is not visible, it’s considered hidden.

  3. The function returns True if the asNode is hidden, or False if it is visible.

asNode.isInfluenceOf(self, skinClustOrSkinMesh=None, **shArgs)#

[shArgs : ssm=skinClustOrSkinMesh]

Purpose:

:: Checks if the asNode is an influence object of a given skin cluster or mesh. This is important in skinning and weight painting workflows.

Parameters:

skinClustOrSkinMesh – <asNode, optional> #The skin cluster or mesh to check the influence against.

Returns:

<bool> #Indicates whether the asNode is an influence object of the specified skin cluster or mesh.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateSkinClusterOrMesh["/fas:fa-edit Update SkinClusterOrMesh"] UpdateSkinClusterOrMesh --> CheckSkinClusterOrMeshProvided{{"/fas:fa-question Check SkinClusterOrMesh Provided"}} CheckShArgs --"If shArgs not provided" --> GetSelectedSkinClusterOrMesh["/fas:fa-mouse-pointer Get Selected SkinClusterOrMesh"] GetSelectedSkinClusterOrMesh --> CheckSkinClusterOrMeshProvided CheckSkinClusterOrMeshProvided --"If Provided" --> ConvertToAsNode["/fas:fa-exchange-alt Convert to asNode"] CheckSkinClusterOrMeshProvided --"If Not Provided" --> ReturnFalseNoSkinClusterOrMesh["/fas:fa-times Return False (No SkinClusterOrMesh)"] ConvertToAsNode --> GetSkinJointList["/fas:fa-list-ul Get Skin Joint List"] GetSkinJointList --> CheckSkinJointListExists{{"/fas:fa-question Check Skin Joint List Exists"}} CheckSkinJointListExists --"If Skin Joint List Exists" --> CheckAsNodeInfluence["/fas:fa-check-circle Check asNode Influence"] CheckSkinJointListExists --"If No Skin Joint List" --> ReturnFalseNoSkinJoints["/fas:fa-times Return False (No Skin Joints)"] CheckAsNodeInfluence --"If asNode is Influence" --> ReturnTrueAsNodeInfluence["/fas:fa-check Return True (asNode Influence)"] CheckAsNodeInfluence --"If asNode is Not Influence" --> ReturnFalseAsNodeNotInfluence["/fas:fa-times Return False (asNode Not Influence)"] ReturnTrueAsNodeInfluence --> End[("fas:fa-stop End")] ReturnFalseAsNodeNotInfluence --> End ReturnFalseNoSkinJoints --> End ReturnFalseNoSkinClusterOrMesh --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSkinClusterOrMesh fill:#ff9999,stroke:#000,stroke-width:2px style CheckSkinClusterOrMeshProvided fill:#99ccff,stroke:#000,stroke-width:2px style GetSelectedSkinClusterOrMesh fill:#cc99ff,stroke:#000,stroke-width:2px style ConvertToAsNode fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalseNoSkinClusterOrMesh fill:#ff9999,stroke:#000,stroke-width:2px style GetSkinJointList fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinJointListExists fill:#cc99ff,stroke:#000,stroke-width:2px style CheckAsNodeInfluence fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrueAsNodeInfluence fill:#ff9999,stroke:#000,stroke-width:2px style ReturnFalseAsNodeNotInfluence fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFalseNoSkinJoints fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#99ff99,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isInfluenceOf function:

  1. The function checks if additional arguments are provided and updates the skin cluster or mesh accordingly.

  2. If a skin cluster or skin mesh is specified, it is converted to an asNode object for further processing.

  3. The function retrieves the list of skin joints influencing the specified skin cluster or mesh.

  4. It checks if the asNode is in the list of skin joints, indicating that it influences the skin cluster or mesh.

  5. The function returns True if the asNode is an influence object, or False if it is not.

asNode.isJnt(self, **shArgs)#

[shArgs]

Purpose:

:: Identifies if the asNode is a joint in the Maya scene. This function is critical in rigging and animation scripts for identifying joint nodes.

Returns:

<bool> #Indicates whether the asNode is a joint.

graph TB Start[("fa:fa-play Start")] --> CheckNodeType{{"/fas:fa-check-circle Check Node Type"}} CheckNodeType --"If 'joint'" --> ReturnTrue[("fas:fa-check Return True")] CheckNodeType --"If not 'joint'" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#99ccff,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isJnt function:

  1. The process begins by checking the node type of the asNode.

  2. If the node type is ‘joint’, the function returns True, indicating that the asNode is a joint.

  3. If the node type is not ‘joint’, the function returns False, indicating that the asNode is not a joint.

asNode.isLastJnt(self, numFromEnd=0, childImplied=True, **shArgs)#

[shArgs : nfe=numFromEnd, ci=childImplied]

Purpose:

:: Determines if the asNode is the last joint in a joint chain. This function is used in rigging scripts to identify end joints for tasks like IK/FK setup.

Parameters:
  • numFromEnd – <int> #The position from the end of the chain to consider as the last joint.

  • childImplied – <bool> #Considers implied child joints in the evaluation.

Returns:

<bool> #Indicates whether the asNode is the last joint in the chain.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateNumFromEnd["/fas:fa-edit Update numFromEnd"] UpdateNumFromEnd --> UpdateChildImplied["/fas:fa-edit Update childImplied"] UpdateChildImplied --> CheckNodeType{{"/fas:fa-question Check Node Type"}} CheckShArgs --"If shArgs not provided" --> CheckNodeType CheckNodeType --"If Node is Joint" --> CheckNumFromEnd{{"/fas:fa-question Check numFromEnd"}} CheckNodeType --"If Node is Not Joint" --> RaiseError["/fas:fa-exclamation-triangle Raise Error"] CheckNumFromEnd --"If numFromEnd is Zero" --> CheckChildren{{"/fas:fa-question Check for Children"}} CheckNumFromEnd --"If numFromEnd is Not Zero" --> CompareHierarchyLength["/fas:fa-ruler-combined Compare Hierarchy Length"] CheckChildren --"If No Children" --> ReturnTrueNoChildren["/fas:fa-check Return True (No Children)"] CheckChildren --"If Children Exist" --> CheckJointChildren{{"/fas:fa-question Check if Children are Joints"}} CheckJointChildren --"If Joint Children" --> ReturnFalseJointChildren["/fas:fa-times Return False (Joint Children)"] CheckJointChildren --"If No Joint Children" --> ReturnTrueNoJointChildren["/fas:fa-check Return True (No Joint Children)"] CompareHierarchyLength --"If Hierarchy Length Equals numFromEnd" --> ReturnTrueHierarchyMatch["/fas:fa-check Return True (Hierarchy Match)"] CompareHierarchyLength --"If Hierarchy Length Not Equals numFromEnd" --> ReturnFalseHierarchyMismatch["/fas:fa-times Return False (Hierarchy Mismatch)"] RaiseError --> End[("fas:fa-stop End")] ReturnTrueNoChildren --> End ReturnFalseJointChildren --> End ReturnTrueNoJointChildren --> End ReturnTrueHierarchyMatch --> End ReturnFalseHierarchyMismatch --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateNumFromEnd fill:#ff9999,stroke:#000,stroke-width:2px style UpdateChildImplied fill:#99ccff,stroke:#000,stroke-width:2px style CheckNodeType fill:#cc99ff,stroke:#000,stroke-width:2px style CheckNumFromEnd fill:#99ff99,stroke:#000,stroke-width:2px style RaiseError fill:#ff9999,stroke:#000,stroke-width:2px style CheckChildren fill:#99ccff,stroke:#000,stroke-width:2px style CheckJointChildren fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrueNoChildren fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalseJointChildren fill:#ff9999,stroke:#000,stroke-width:2px style ReturnTrueNoJointChildren fill:#99ccff,stroke:#000,stroke-width:2px style CompareHierarchyLength fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrueHierarchyMatch fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalseHierarchyMismatch fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#99ccff,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isLastJnt function:

  1. The process begins by checking if the asNode is a joint type.

  2. If the node is not a joint, an error is raised.

  3. If the numFromEnd parameter is zero, the function checks for the presence of children.

  4. If no children are present, the asNode is considered the last joint.

  5. If children exist, the function checks if any child is a joint.

  6. If there are joint children, the asNode is not the last joint. Otherwise, it is the last joint.

  7. If numFromEnd is not zero, the function compares the hierarchy length to numFromEnd.

  8. If the hierarchy length matches numFromEnd, the asNode is considered the last joint. Otherwise, it is not.

asNode.isLattice(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a lattice deformer, commonly used in modeling and deformation scripts to identify and manipulate lattice deformers.

Returns:

<bool> #Indicates whether the asNode is a lattice deformer.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"If shArgs provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> GetShape{{"/fas:fa-shapes Get Shape"}} GetShape --"If Shape exists" --> CheckNodeTypeShape{{"/fas:fa-code-branch Check Node Type of Shape"}} GetShape --"If No Shape" --> CheckNodeTypeSelf{{"/fas:fa-code-branch Check Node Type of Self"}} CheckNodeTypeShape --"If 'lattice'" --> ReturnTrue1[("fas:fa-check Return True")] CheckNodeTypeShape --"If not 'lattice'" --> ReturnFalse1[("fas:fa-times Return False")] CheckNodeTypeSelf --"If 'lattice'" --> ReturnTrue2[("fas:fa-check Return True")] CheckNodeTypeSelf --"If not 'lattice'" --> ReturnFalse2[("fas:fa-times Return False")] ReturnTrue1 --> End[("fas:fa-stop End")] ReturnFalse1 --> End ReturnTrue2 --> End ReturnFalse2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style GetShape fill:#99ff99,stroke:#000,stroke-width:2px style CheckNodeTypeShape fill:#ffcc00,stroke:#000,stroke-width:2px style CheckNodeTypeSelf fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTrue2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isLattice function:

  1. The function begins by checking if the asNode has a shape node.

  2. If a shape node exists, it checks if the shape node type is ‘lattice’.

  3. If there is no shape node, it checks the node type of the asNode itself.

  4. If the shape node or the asNode itself is of type ‘lattice’, the function returns True, indicating it is a lattice.

  5. If neither the shape node nor the asNode is of type ‘lattice’, the function returns False.

asNode.isLatticePnt(self, **shArgs)#

[shArgs]

Purpose:

:: Identifies if the asNode is a lattice point, crucial for scripts dealing with lattice deformation where individual point manipulation is required.

Returns:

<bool> #Indicates whether the asNode is a lattice point.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"If shArgs provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> CheckName{{"/fas:fa-search Check Name Contains '.pt['"}} CheckName --"If Name Contains '.pt['" --> ReturnTrue[("fas:fa-check Return True")] CheckName --"If Name Does Not Contain '.pt['" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckName fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isLatticePnt function:

  1. The process starts by checking if specific arguments are provided (shArgs).

  2. It sets the necessary component types (ncTypes) for the function.

  3. The key check involves examining the asNode’s name to see if it contains ‘.pt[‘.

  4. If ‘.pt[’ is found in the name, the function concludes that the asNode is a lattice point and returns True.

  5. If ‘.pt[’ is not present in the name, the function returns False, indicating that the asNode is not a lattice point.

asNode.isLeftSide(self, offset=0.05, dirAxis='x', **shArgs)#

[shArgs : o=offset, da=dirAxis]

Purpose:

:: Determines if the asNode is positioned on the left side of a specified axis. Useful in rigging and scene layout scripts for spatial analysis and organization.

Parameters:
  • offset – <float> #The offset value to consider in the position evaluation.

  • dirAxis – <str> #The axis along which to determine the left side.

Returns:

<bool> #Indicates whether the asNode is on the left side of the specified axis.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateOffset["/fas:fa-edit Update Offset"] UpdateOffset --> UpdateDirAxis["/fas:fa-edit Update DirAxis"] UpdateDirAxis --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> GetPosition["/fas:fa-map-marker-alt Get Position"] GetPosition --"Retrieve Position" --> CheckLeftSide{{"/fas:fa-arrows-alt-h Check Left Side"}} CheckLeftSide --"If Position >= Offset" --> ReturnTrue[("fas:fa-check Return True")] CheckLeftSide --"If Position < Offset" --> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateOffset fill:#ff9999,stroke:#000,stroke-width:2px style UpdateDirAxis fill:#99ccff,stroke:#000,stroke-width:2px style SetNcTypes fill:#cc99ff,stroke:#000,stroke-width:2px style GetPosition fill:#99ff99,stroke:#000,stroke-width:2px style CheckLeftSide fill:#ff9999,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isLeftSide function:

  1. The process begins by checking if specific arguments are provided (shArgs).

  2. It updates the offset and directional axis (dirAxis) parameters based on the provided arguments.

  3. The necessary component types (ncTypes) are set for the function.

  4. The position of the asNode is retrieved to perform the spatial analysis.

  5. The function checks if the asNode’s position on the specified axis is greater than or equal to the offset.

  6. If the position is greater than or equal to the offset, the function concludes that the asNode is on the left side and returns True.

  7. If the position is less than the offset, the function returns False, indicating that the asNode is not on the left side.

asNode.isLoc(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a locator in the Maya scene. This function is important in rigging and scene layout for identifying locator nodes.

Returns:

<bool> #Indicates whether the asNode is a locator.

graph TB Start[("(fa:fa-play Start isLoc)")] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"No specific arguments to process" --> GetShape["(fas:fa-shapes Get Shape)"] GetShape --"Retrieve the shape of the asNode" --> ShapeTypeCheck["(fas:fa-question-circle Check Shape Type)"] ShapeTypeCheck --"Check if shape type is 'locator'" --> ReturnTrue["(fas:fa-check Return True)"] ShapeTypeCheck --"If shape type is not 'locator'" --> ReturnFalse["(fas:fa-times Return False)"] GetShape --"If no shape is present" --> NodeTypeCheck["(fas:fa-code-branch Check Node Type)"] NodeTypeCheck --"Check if node type is 'locator'" --> ReturnTrue NodeTypeCheck --"If node type is not 'locator'" --> ReturnFalse ReturnTrue --"asNode is a locator" --> End[("(fas:fa-stop End)")] ReturnFalse --"asNode is not a locator" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style GetShape fill:#99cc99,stroke:#000,stroke-width:3px style ShapeTypeCheck fill:#ff99cc,stroke:#000,stroke-width:3px style NodeTypeCheck fill:#99cc99,stroke:#000,stroke-width:3px style ReturnTrue fill:#99cc99,stroke:#000,stroke-width:3px style ReturnFalse fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px; linkStyle 5 stroke:#2ecd71,stroke-width:2px; linkStyle 6 stroke:#2ecd71,stroke-width:2px; linkStyle 7 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the isLoc function:

  1. The process begins by bypassing the need for specific arguments as none are required for this function.

  2. The shape of the asNode is retrieved for further evaluation.

  3. If the asNode has a shape, the function checks if the shape type is ‘locator’.

  4. If the shape type is ‘locator’, the function returns True, confirming the asNode is a locator.

  5. If the shape type is not ‘locator’, or if no shape is present, the function checks the node type of the asNode itself.

  6. If the node type of the asNode is ‘locator’, the function returns True.

  7. If the node type is not ‘locator’, the function returns False, indicating the asNode is not a locator.

asNode.isMesh(self, **shArgs)#

[shArgs]

Purpose:

:: Determines if the asNode is a mesh object. Essential in modeling scripts and operations that specifically target mesh geometry.

Returns:

<bool> #Indicates whether the asNode is a mesh object.

_images/isMesh.jpg
Flow Chart Description:

This flowchart illustrates the isMesh function:

  1. The process begins by bypassing the need for specific arguments as none are required for this function.

  2. The shape of the asNode is retrieved for further evaluation.

  3. If the asNode has a shape, the function checks if the shape type is ‘mesh’.

  4. If the shape type is ‘mesh’, the function returns True, confirming the asNode is a mesh object.

  5. If the shape type is not ‘mesh’, or if no shape is present, the function checks the node type of the asNode itself.

  6. If the node type of the asNode is ‘mesh’, the function returns True.

  7. If the node type is not ‘mesh’, the function returns False, indicating the asNode is not a mesh object.

asNode.isMiddleSide(self, offset=0.05, dirAxis='x', **shArgs)#

[shArgs : o=offset, da=dirAxis]

Purpose:

:: Checks if the asNode is positioned in the middle area of a specified axis. Useful in scene organization and rigging for aligning or distributing nodes spatially.

Parameters:
  • offset – <float> #The offset value to define the middle area.

  • dirAxis – <str> #The axis along which to determine the middle area.

Returns:

<bool> #Indicates whether the asNode is in the middle area of the specified axis.

graph TB Start[("(fa:fa-play Start isMiddleSide)")] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> SetOffsetAndDirAxis["/fas:fa-sliders-h Set Offset and DirAxis"] SetOffsetAndDirAxis --> GetPosition["/fas:fa-map-marker-alt Get Position"] GetPosition --"Retrieve position of asNode" --> CheckPositionWithinOffset{{"/fas:fa-arrows-alt-h Check Position Within Offset"}} CheckPositionWithinOffset --"If within offset range" --> ReturnTrue["(fas:fa-check Return True)"] CheckPositionWithinOffset --"If outside offset range" --> ReturnFalse["(fas:fa-times Return False)"] ReturnTrue --"asNode is in middle area" --> End[("(fas:fa-stop End)")] ReturnFalse --"asNode is not in middle area" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style SetOffsetAndDirAxis fill:#99cc99,stroke:#000,stroke-width:3px style GetPosition fill:#99cc99,stroke:#000,stroke-width:3px style CheckPositionWithinOffset fill:#ff99cc,stroke:#000,stroke-width:3px style ReturnTrue fill:#99cc99,stroke:#000,stroke-width:3px style ReturnFalse fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px; linkStyle 5 stroke:#2ecd71,stroke-width:2px; linkStyle 6 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the isMiddleSide function:

  1. The process begins by checking if specific arguments are provided and updating the offset and direction axis parameters accordingly.

  2. The position of the asNode is then retrieved for analysis.

  3. The function checks if the asNode’s position falls within the specified offset range along the given axis.

  4. If the asNode’s position is within the offset range, the function returns True, indicating the asNode is in the middle area.

  5. If the asNode’s position is outside the offset range, the function returns False, signifying the asNode is not in the middle area.

asNode.isNodeType(self, objType, **shArgs)#

[shArgs : ot=objType]

Purpose:

:: Verifies if the asNode is of a specific node type, like ‘transform’, ‘mesh’, or ‘joint’. Important in scripts that need to filter nodes by type.

Parameters:

objType – <str> #The node type to check against.

Returns:

<bool> #Indicates whether the asNode is of the specified node type.

_images/isNodeType.jpg
Flow Chart Description:

This flowchart illustrates the isNodeType function:

  1. The process begins by checking if specific arguments are provided and updating the object type parameter accordingly.

  2. The function then checks if the asNode has a shape node associated with it.

  3. If a shape node exists, the function compares the shape node’s type with the specified object type.

  4. If the node types match, the function returns True, indicating the asNode is of the specified type.

  5. If the node types do not match, the function returns False, signifying the asNode is not of the specified type.

  6. If no shape node is present, the function directly compares the asNode’s type with the specified object type for a match.

asNode.isOnBoundary(self, **shArgs)#

[shArgs]

Purpose:

:: Determines if the asNode, typically a component like a vertex or edge, is on the boundary of its geometry. Crucial in modeling scripts for boundary analysis.

Returns:

<bool> #Indicates whether the asNode is on the boundary of its geometry.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> SkipToComponentCheck CheckShArgs --"If shArgs not provided" --> SkipToComponentCheck SkipToComponentCheck --> ExtractVtxNumber["/fas:fa-hashtag Extract Vertex Number"] ExtractVtxNumber --> DetermineComponentType{{"/fas:fa-question Determine Component Type"}} DetermineComponentType --"If Vertex" --> InitializeVertexIterator["/fas:fa-play-circle Initialize Vertex Iterator"] DetermineComponentType --"If Edge" --> InitializeEdgeIterator["/fas:fa-play-circle Initialize Edge Iterator"] DetermineComponentType --"If Face" --> InitializeFaceIterator["/fas:fa-play-circle Initialize Face Iterator"] InitializeVertexIterator --> IterateMeshVertex["/fas:fa-forward Iterate Mesh Vertex"] InitializeEdgeIterator --> IterateMeshEdge["/fas:fa-forward Iterate Mesh Edge"] InitializeFaceIterator --> IterateMeshFace["/fas:fa-forward Iterate Mesh Face"] IterateMeshVertex --> CheckOnBoundaryVtx{{"/fas:fa-location-arrow Check On Boundary (Vtx)"}} IterateMeshEdge --> CheckOnBoundaryEdge{{"/fas:fa-location-arrow Check On Boundary (Edge)"}} IterateMeshFace --> CheckOnBoundaryFace{{"/fas:fa-location-arrow Check On Boundary (Face)"}} CheckOnBoundaryVtx --> ReturnResultVtx["/fas:fa-arrow-right Return Result (Vtx)"] CheckOnBoundaryEdge --> ReturnResultEdge["/fas:fa-arrow-right Return Result (Edge)"] CheckOnBoundaryFace --> ReturnResultFace["/fas:fa-arrow-right Return Result (Face)"] ReturnResultVtx --> End[("fas:fa-stop End")] ReturnResultEdge --> End ReturnResultFace --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SkipToComponentCheck fill:#99ccff,stroke:#000,stroke-width:2px style ExtractVtxNumber fill:#cc99ff,stroke:#000,stroke-width:2px style DetermineComponentType fill:#99ff99,stroke:#000,stroke-width:2px style InitializeVertexIterator fill:#ff9999,stroke:#000,stroke-width:2px style InitializeEdgeIterator fill:#99ccff,stroke:#000,stroke-width:2px style InitializeFaceIterator fill:#cc99ff,stroke:#000,stroke-width:2px style IterateMeshVertex fill:#99ff99,stroke:#000,stroke-width:2px style IterateMeshEdge fill:#ff9999,stroke:#000,stroke-width:2px style IterateMeshFace fill:#99ccff,stroke:#000,stroke-width:2px style CheckOnBoundaryVtx fill:#cc99ff,stroke:#000,stroke-width:2px style CheckOnBoundaryEdge fill:#99ff99,stroke:#000,stroke-width:2px style CheckOnBoundaryFace fill:#ff9999,stroke:#000,stroke-width:2px style ReturnResultVtx fill:#99ccff,stroke:#000,stroke-width:2px style ReturnResultEdge fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnResultFace fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isOnBoundary function:

  1. The process begins by checking if specific arguments are provided, but since no specific arguments exist, it moves directly to component type determination.

  2. The function extracts the vertex number and determines if the asNode is a vertex, edge, or face.

  3. Depending on the component type, the function initializes the appropriate iterator (vertex, edge, or face).

  4. The function iterates through the mesh components until it finds the one matching the asNode’s index.

  5. It then checks if the identified component is on the boundary of its geometry.

  6. The function returns a boolean result indicating whether the asNode is on the boundary for its component type.

asNode.isParentOf(self, trgtObj, prntImplied=True, **shArgs)#

[shArgs : to=trgtObj, pi=prntImplied]

Purpose:

:: Checks if the asNode is a parent of a specified target node. This function is used in scene management and rigging to verify node hierarchies.

Parameters:
  • trgtObj – <asNode> #The target node to check against.

  • prntImplied – <bool> #Considers implied parent-child relationships in the evaluation.

Returns:

<bool> #Indicates whether the asNode is a parent of the specified target node.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CreateAsTrgtNode["/fas:fa-sitemap Create asNode Target"] ProcessShArgs --> CreateAsTrgtNode CreateAsTrgtNode --"Create asNode target object" --> CheckPrntImplied{{"/fas:fa-code-branch Check prntImplied"}} CheckPrntImplied --"If prntImplied is True" --> AttrQuery["/fas:fa-search-plus Attribute Query"] CheckPrntImplied --"If prntImplied is False" --> GetNodeDg["/fas:fa-sitemap Get Node Dag"] AttrQuery --"Check 'mPrnt' attribute exists" --> CheckAttrType{{"/fas:fa-tag Check Attr Type"}} CheckAttrType --"If 'message' type" --> IsChildOfTest["/fas:fa-arrows-alt Is Child Of Test"] CheckAttrType --"If not 'message' type" --> ReturnFalse1[("fas:fa-times Return False")] IsChildOfTest --"Check if asNode is child of target node" --> ReturnTrue1[("fas:fa-check Return True")] IsChildOfTest --"If asNode is not child of target node" --> GetNodeDg GetNodeDg --"Retrieve the DAG node of asNode" --> CheckIsParentOf{{"/fas:fa-code-branch Check Is Parent Of"}} CheckIsParentOf --"If asNode is parent of target node" --> ReturnTrue2[("fas:fa-check Return True")] CheckIsParentOf --"If asNode is not parent of target node" --> ReturnFalse2[("fas:fa-times Return False")] ReturnTrue1 --> End[("fas:fa-stop End")] ReturnFalse1 --> End ReturnTrue2 --> End ReturnFalse2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CreateAsTrgtNode fill:#99ccff,stroke:#000,stroke-width:2px style CheckPrntImplied fill:#cc99ff,stroke:#000,stroke-width:2px style AttrQuery fill:#99ff99,stroke:#000,stroke-width:2px style CheckAttrType fill:#ff9999,stroke:#000,stroke-width:2px style IsChildOfTest fill:#99ccff,stroke:#000,stroke-width:2px style ReturnTrue1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse1 fill:#ff6666,stroke:#000,stroke-width:2px style GetNodeDg fill:#99ccff,stroke:#000,stroke-width:2px style CheckIsParentOf fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrue2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnFalse2 fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isParentOf function:

  1. Starts by checking if shArgs are provided and updates trgtObj and prntImplied accordingly.

  2. Creates an asNode target object for the trgtObj.

  3. Checks if prntImplied is true. If so, it performs an attribute query for ‘mPrnt’.

  4. If ‘mPrnt’ is a ‘message’ type, it tests if the asNode is a child of the target node.

  5. If the asNode is not a child, or prntImplied is false, it retrieves the DAG node of asNode.

  6. Finally, it checks if asNode is the parent of the target node and returns the appropriate boolean value.

asNode.isRightSide(self, offset=0.05, dirAxis='x', **shArgs)#

[shArgs : o=offset, da=dirAxis]

Purpose:

:: Determines if the asNode is positioned on the right side of a specified axis. Useful for spatial organization in rigging and scene layout.

Parameters:
  • offset – <float> #The offset value to consider in the position evaluation.

  • dirAxis – <str> #The axis along which to determine the right side.

Returns:

<bool> #Indicates whether the asNode is on the right side of the specified axis.

graph TB Start[("(fa:fa-play Start isRightSide)")] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> GetPosition["(fas:fa-map-marker-alt Get Position)"] GetPosition --"Retrieve the position of the asNode" --> EvaluatePosition["(fas:fa-balance-scale-right Evaluate Position)"] EvaluatePosition --"Check if position is on the right side" --> ReturnTrue["(fas:fa-check Return True)"] EvaluatePosition --"If position is not on the right side" --> ReturnFalse["(fas:fa-times Return False)"] ReturnTrue --"asNode is on the right side" --> End[("(fas:fa-stop End)")] ReturnFalse --"asNode is not on the right side" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style GetPosition fill:#99cc99,stroke:#000,stroke-width:3px style EvaluatePosition fill:#ff99cc,stroke:#000,stroke-width:3px style ReturnTrue fill:#99cc99,stroke:#000,stroke-width:3px style ReturnFalse fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the isRightSide function:

  1. The process begins by checking if shArgs are provided. If so, offset and dirAxis parameters are updated.

  2. It retrieves the position of the asNode.

  3. The position is evaluated to determine if the asNode is on the right side of the specified axis.

  4. The function returns True if the asNode is on the right side, otherwise, it returns False.

asNode.isShape(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a shape node, like a mesh or curve shape. Essential in scripts dealing with direct manipulation of geometry.

Returns:

<bool> #Indicates whether the asNode is a shape node.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> SkipToShapeCheck CheckShArgs --"If shArgs not provided" --> SkipToShapeCheck SkipToShapeCheck --> InitializeDagNodeFn["/fas:fa-code-branch Initialize DagNode Function"] InitializeDagNodeFn --> CheckDgNode{{"/fas:fa-question Check DgNode"}} CheckDgNode --"If DgNode" --> ReturnFalseNotShape["/fas:fa-times Return False (Not Shape)"] CheckDgNode --"If Not DgNode" --> GetDagPath["/fas:fa-stream Get DagPath"] GetDagPath --> ModifyDagPath["/fas:fa-wrench Modify DagPath"] ModifyDagPath --> SetDagNodeFnObject["/fas:fa-cogs Set DagNodeFn Object"] SetDagNodeFnObject --> GetParentName["/fas:fa-user Get Parent Name"] GetParentName --> CheckParentExists{{"/fas:fa-question Check Parent Exists"}} CheckParentExists --"If Parent Exists" --> ConvertToAsNodeParent["/fas:fa-exchange-alt Convert to asNode (Parent)"] CheckParentExists --"If No Parent Exists" --> CheckHasShape{{"/fas:fa-question Check Has Shape"}} ConvertToAsNodeParent --> CheckHasShape CheckHasShape --"If Has Shape" --> ReturnFalseNoShape["/fas:fa-times Return False (No Shape)"] CheckHasShape --"If No Shape" --> CheckIsTransform{{"/fas:fa-question Check Is Transform"}} CheckIsTransform --"If Is Transform" --> ListParentShapes["/fas:fa-list List Parent Shapes"] CheckIsTransform --"If Not Transform" --> ReturnFalseNoShape ListParentShapes --> CheckInParentShapes{{"/fas:fa-question Check In Parent Shapes"}} CheckInParentShapes --"If In Parent Shapes" --> ReturnTrueIsShape["/fas:fa-check Return True (Is Shape)"] CheckInParentShapes --"If Not In Parent Shapes" --> ReturnFalseNoShape ReturnFalseNotShape --> End[("fas:fa-stop End")] ReturnFalseNoShape --> End ReturnTrueIsShape --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SkipToShapeCheck fill:#99ccff,stroke:#000,stroke-width:2px style InitializeDagNodeFn fill:#cc99ff,stroke:#000,stroke-width:2px style CheckDgNode fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalseNotShape fill:#ff9999,stroke:#000,stroke-width:2px style GetDagPath fill:#99ccff,stroke:#000,stroke-width:2px style ModifyDagPath fill:#cc99ff,stroke:#000,stroke-width:2px style SetDagNodeFnObject fill:#99ff99,stroke:#000,stroke-width:2px style GetParentName fill:#ff9999,stroke:#000,stroke-width:2px style CheckParentExists fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToAsNodeParent fill:#cc99ff,stroke:#000,stroke-width:2px style CheckHasShape fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalseNoShape fill:#ff9999,stroke:#000,stroke-width:2px style CheckIsTransform fill:#99ccff,stroke:#000,stroke-width:2px style ListParentShapes fill:#cc99ff,stroke:#000,stroke-width:2px style CheckInParentShapes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrueIsShape fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#99ccff,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isShape function:

  1. The function begins by initializing the DagNode Function.

  2. It checks if the current node is a DgNode.

  3. If it’s a DgNode, the function returns False, indicating it’s not a shape.

  4. If not a DgNode, the function initializes and modifies the DagPath.

  5. Sets the DagNodeFn object and gets the parent name.

  6. Checks if a parent exists. If it does, it converts the parent to an asNode.

  7. Checks if the current node has a shape.

  8. If it has a shape, it checks if it’s a transform node and lists parent shapes.

  9. Checks if the current node is in the parent shapes.

  10. If in parent shapes, returns True, indicating it is a shape. Otherwise, returns False.

asNode.isSkinMesh(self, latticeCheck=0, **shArgs)#

[shArgs : lc=latticeCheck]

Purpose:

:: Determines if the asNode is a skinned mesh, which is important in rigging and animation workflows for identifying skinned geometries.

Parameters:

latticeCheck – <bool> #Specifies whether to check if the mesh is influenced by a lattice deformer.

Returns:

<bool> #Indicates whether the asNode is a skinned mesh.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateLatticeCheck["/fas:fa-edit Update LatticeCheck"] CheckShArgs --"If shArgs not provided" --> CheckIsMesh{{"/fas:fa-question Check Is Mesh"}} UpdateLatticeCheck --> CheckIsMesh CheckIsMesh --"If Is Mesh" --> ListSkinClusterHistory["/fas:fa-history List SkinCluster History"] CheckIsMesh --"If Not Mesh" --> ReturnFalseNotMesh["/fas:fa-times Return False (Not Mesh)"] ListSkinClusterHistory --> CheckSkinClusterExists{{"/fas:fa-question Check SkinCluster Exists"}} CheckSkinClusterExists --"If SkinCluster Exists" --> CheckLatticeCheck{{"/fas:fa-question Check LatticeCheck"}} CheckSkinClusterExists --"If No SkinCluster" --> ReturnFalseNoSkinCluster["/fas:fa-times Return False (No SkinCluster)"] CheckLatticeCheck --"If LatticeCheck" --> CheckInfluenceByLattice["/fas:fa-cube Check Influence By Lattice"] CheckLatticeCheck --"If No LatticeCheck" --> ReturnTrueSkinMesh["/fas:fa-check Return True (SkinMesh)"] CheckInfluenceByLattice --"If Influenced By Lattice" --> ReturnTrueLatticeInfluence["/fas:fa-check Return True (Lattice Influence)"] CheckInfluenceByLattice --"If Not Influenced By Lattice" --> ReturnFalseNoLatticeInfluence["/fas:fa-times Return False (No Lattice Influence)"] ReturnFalseNotMesh --> End[("fas:fa-stop End")] ReturnFalseNoSkinCluster --> End ReturnTrueSkinMesh --> End ReturnTrueLatticeInfluence --> End ReturnFalseNoLatticeInfluence --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateLatticeCheck fill:#ff9999,stroke:#000,stroke-width:2px style CheckIsMesh fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFalseNotMesh fill:#cc99ff,stroke:#000,stroke-width:2px style ListSkinClusterHistory fill:#99ff99,stroke:#000,stroke-width:2px style CheckSkinClusterExists fill:#ff9999,stroke:#000,stroke-width:2px style CheckLatticeCheck fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFalseNoSkinCluster fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrueSkinMesh fill:#99ff99,stroke:#000,stroke-width:2px style CheckInfluenceByLattice fill:#ff9999,stroke:#000,stroke-width:2px style ReturnTrueLatticeInfluence fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFalseNoLatticeInfluence fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#99ff99,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isSkinMesh function:

  1. The process starts by checking if shArgs are provided. If so, it updates the latticeCheck parameter.

  2. It checks if the asNode is a mesh.

  3. If the asNode is not a mesh, the function returns False.

  4. If it is a mesh, the function lists the skin cluster history.

  5. It checks if a skin cluster exists.

  6. If a skin cluster exists and latticeCheck is enabled, it checks if the mesh is influenced by a lattice.

  7. If influenced by a lattice, the function returns True, otherwise False.

  8. If there is no skin cluster or lattice check is not enabled, and the node is a mesh, it returns True, indicating the node is a skinned mesh.

asNode.isTrans(self, **shArgs)#

[shArgs]

Purpose:

:: Checks if the asNode is a transform node. This is a basic yet crucial function in many scripts for identifying transform nodes in Maya.

Returns:

<bool> #Indicates whether the asNode is a transform node.

graph TB Start[("fa:fa-play Start")] --> CheckNodeType{{"/fas:fa-sitemap Check Node Type"}} CheckNodeType --"Node Type is 'transform'"--> ReturnTrue[("fas:fa-check Return True")] CheckNodeType --"Node Type is not 'transform'"--> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isTrans function:

  1. The function begins by checking the node type of the asNode.

  2. If the node type is ‘transform’, it returns True, indicating the asNode is a transform node.

  3. If the node type is not ‘transform’, it returns False.

asNode.isVertex(self, **shArgs)#

[shArgs]

Purpose:

:: Identifies if the asNode is a vertex in a mesh, crucial for scripts that need to manipulate vertices directly, such as in modeling or rigging.

Returns:

<bool> #Indicates whether the asNode is a vertex.

graph TB Start[("fa:fa-play Start")] --> CheckNameForVertex{{"/fas:fa-search Check Name for Vertex"}} CheckNameForVertex --"Name includes '.vtx['"--> ReturnTrue[("fas:fa-check Return True")] CheckNameForVertex --"Name does not include '.vtx['"--> ReturnFalse[("fas:fa-times Return False")] ReturnTrue --> End[("fas:fa-stop End")] ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNameForVertex fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isVertex function:

  1. The function starts by checking the name of the asNode.

  2. If the name includes ‘.vtx[’, it returns True, indicating the asNode is a vertex.

  3. If the name does not include ‘.vtx[’, it returns False.

asNode.isVisible(self, checkParents=True, **shArgs)#

[shArgs : cp=checkParents]

Purpose:

:: Determines if the asNode is visible in the Maya scene. This function is important for scripts that need to check the visibility status of nodes.

Parameters:

checkParents – <bool> #Determines whether to consider the visibility status of parent nodes.

Returns:

<bool> #Indicates whether the asNode is visible.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateCheckParents["/fas:fa-sync-alt Update checkParents"] CheckShArgs --"shArgs not provided"--> CheckVisibilityAttr{{"/fas:fa-eye Check Visibility Attr"}} UpdateCheckParents --> CheckVisibilityAttr CheckVisibilityAttr --"Not Visible"--> ReturnFalseNotVisible[("fas:fa-eye-slash Return False (Not Visible)")] CheckVisibilityAttr --"Visible"--> CheckParents{{"/fas:fa-users Check Parents"}} CheckParents --"Check Parents"--> GetParentList["/fas:fa-list-ul Get Parent List"] CheckParents --"No Check Parents"--> ReturnTrueVisible[("fas:fa-check Return True (Visible)")] GetParentList --> EvaluateParentsVisibility{{"/fas:fa-eye Evaluate Parents Visibility"}} EvaluateParentsVisibility --"All Parents Visible"--> ReturnTrueVisible EvaluateParentsVisibility --"Any Parent Not Visible"--> ReturnFalseParentNotVisible[("fas:fa-eye-slash Return False (Parent Not Visible)")] ReturnFalseNotVisible --> End[("fas:fa-stop End")] ReturnFalseParentNotVisible --> End ReturnTrueVisible --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateCheckParents fill:#ff9999,stroke:#000,stroke-width:2px style CheckVisibilityAttr fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFalseNotVisible fill:#ff9999,stroke:#000,stroke-width:2px style CheckParents fill:#cc99ff,stroke:#000,stroke-width:2px style GetParentList fill:#99ff99,stroke:#000,stroke-width:2px style EvaluateParentsVisibility fill:#ffcc99,stroke:#000,stroke-width:2px style ReturnTrueVisible fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalseParentNotVisible fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isVisible function:

  1. The process starts by checking if shArgs are provided. If so, it updates the checkParents parameter.

  2. It checks the visibility attribute of the asNode.

  3. If the asNode is not visible, the function returns False.

  4. If the asNode is visible and checkParents is true, it checks the visibility of all parent nodes.

  5. If all parent nodes are visible, the function returns True, otherwise False.

  6. If checkParents is false, the function returns True as the asNode is visible.

asNode.jntAxis(self, **shArgs)#

[shArgs]

Purpose:

:: Retrieves the primary joint axis of the asNode, typically used in rigging to determine the orientation of joints.

Returns:

<list> #A list representing the primary joint axis. return [[0, 1, 0], ‘y’] or [[-1, 0, 0], ‘-x’] etc

graph TB Start[("fa:fa-play Start")] --> CheckNodeType{{"/fas:fa-sitemap Check Node Type"}} CheckNodeType --"Node Type is 'joint'"--> GetChildJoint["/fas:fa-arrow-right Get Child Joint"] CheckNodeType --"Node Type is not 'joint'"--> RaiseError[("fas:fa-exclamation-triangle Raise Error")] GetChildJoint --> CheckChildJoint{{"/fas:fa-question-circle Check Child Joint"}} CheckChildJoint --"Child Joint Exists"--> CalculateAimVector["/fas:fa-calculator Calculate Aim Vector"] CheckChildJoint --"No Child Joint"--> CheckParentJoint{{"/fas:fa-question-circle Check Parent Joint"}} CheckParentJoint --"Parent Joint Exists"--> CalculateAimVector CheckParentJoint --"No Parent Joint"--> SetDefaultDirection["/fas:fa-arrow-right Set Default Direction"] CalculateAimVector --> DeterminePrimaryAxis{{"/fas:fa-arrows-alt Determine Primary Axis"}} DeterminePrimaryAxis --> ReturnAxisValue[("fas:fa-check Return Axis Value")] SetDefaultDirection --> ReturnDefaultAxisValue[("fas:fa-check Return Default Axis Value")] RaiseError --> End[("fas:fa-stop End")] ReturnAxisValue --> End ReturnDefaultAxisValue --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style GetChildJoint fill:#99ccff,stroke:#000,stroke-width:2px style RaiseError fill:#ff9999,stroke:#000,stroke-width:2px style CheckChildJoint fill:#cc99ff,stroke:#000,stroke-width:2px style CalculateAimVector fill:#99ff99,stroke:#000,stroke-width:2px style CheckParentJoint fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultDirection fill:#99ccff,stroke:#000,stroke-width:2px style DeterminePrimaryAxis fill:#ffcc99,stroke:#000,stroke-width:2px style ReturnAxisValue fill:#99ff99,stroke:#000,stroke-width:2px style ReturnDefaultAxisValue fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntAxis function:

  1. The process starts by checking the node type of the asNode. If it’s not a joint, an error is raised.

  2. If it’s a joint, it checks for the existence of a child joint.

  3. If a child joint exists, it calculates the aim vector between the joint and its child.

  4. If no child joint is found, it checks for a parent joint.

  5. If a parent joint exists, it calculates the aim vector based on the parent joint.

  6. If no parent joint is found, a default direction is set.

  7. The function then determines the primary axis based on the calculated aim vector.

  8. The primary axis value is returned, or a default value is returned if no child or parent joints are found.

asNode.jntBindTo(self, skinMesh=None, jntList=None, clustName=None, ignoreHI=0, skinMethod=2, maxInflu=3, dropRate=8.5, curvRigidEnds=[1, 1], **shArgs)#

[shArgs : sm=skinMesh, jl=jntList, cn=clustName, ihi=ignoreHI, sm=skinMethod, mi=maxInflu, dr=dropRate, cre=curvRigidEnds]

Purpose:

:: Binds a skin mesh to a set of joints, forming a skin cluster. This function is essential in rigging workflows for creating skinned deformations.

Parameters:
  • skinMesh – <asNode> #The mesh to bind to the joints.

  • jntList – <list> #A list of joints to bind the mesh to.

  • clustName – <str> #The name for the skin cluster.

  • ignoreHI – <bool> #Determines whether to ignore the hierarchy of joints when binding.

  • skinMethod – <int> #The skinning method to use (e.g., linear, dual quaternion).

  • maxInflu – <int> #The maximum number of joint influences per vertex.

  • dropRate – <float> #The drop-off rate for skin weighting.

  • curvRigidEnds – <list> #Settings for rigid ends in curve-based skinning.

Returns:

<asNode> #The created skin cluster node.

ARgs: skinCluster(n=’clustName’, tsb=True, ih=False, sm=2, nw=1, mi=3, omi=1, dr=8.5, rui=0, ps=1, sw=1) bindMethod : ignoreHI - Disregard the place of joints hierarchy when computing the closest joints that influence a point of the geometry. skinMethod : 0 - Classical linear skinning (default). 1 - Dual quaternion (volume preserving), 2 - A weighted blend between the two.

Other Args: nw : 0 - None, 1 - Interactive, 2 - Post (default) for normalizing weights

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateParameters["/fas:fa-edit Update Parameters"] UpdateParameters --> InitializeJointList["/fas:fa-list-ol Initialize Joint List"] CheckShArgs --"If shArgs not provided" --> InitializeJointList InitializeJointList --> InitializeSkinMeshList["/fas:fa-th Initialize Skin Mesh List"] InitializeSkinMeshList --> SetDefaultClusterName["/fas:fa-tag Set Default Cluster Name"] SetDefaultClusterName --> LoopSkinMeshList{{"/fas:fa-repeat Loop Skin Mesh List"}} LoopSkinMeshList --> CheckSkinMeshType{{"/fas:fa-question Check Skin Mesh Type"}} CheckSkinMeshType --"If Valid Skin Mesh" --> CheckExistingSkinCluster{{"/fas:fa-search-plus Check Existing Skin Cluster"}} CheckSkinMeshType --"If Invalid Skin Mesh" --> ContinueLoop["/fas:fa-forward Continue Loop"] CheckExistingSkinCluster --"If Skin Cluster Exists" --> AddJointsToSkinCluster["/fas:fa-plus Add Joints to Skin Cluster"] CheckExistingSkinCluster --"If No Skin Cluster" --> CreateSkinCluster["/fas:fa-magic Create Skin Cluster"] AddJointsToSkinCluster --> EndSkinMeshLoop{{"/fas:fa-repeat End Skin Mesh Loop"}} CreateSkinCluster --> CheckIfCurveMesh["/fas:fa-curve Check If Curve Mesh"] CheckIfCurveMesh --"If Curve Mesh" --> AutoWeightCurve["/fas:fa-balance-scale Auto Weight Curve"] CheckIfCurveMesh --"If Not Curve Mesh" --> EndSkinMeshLoop AutoWeightCurve --> EndSkinMeshLoop EndSkinMeshLoop --"If More Skin Meshes" --> LoopSkinMeshList EndSkinMeshLoop --"If No More Skin Meshes" --> ReturnResult["/fas:fa-arrow-right Return Result"] ContinueLoop --> EndSkinMeshLoop ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style InitializeJointList fill:#99ccff,stroke:#000,stroke-width:2px style InitializeSkinMeshList fill:#cc99ff,stroke:#000,stroke-width:2px style SetDefaultClusterName fill:#99ff99,stroke:#000,stroke-width:2px style LoopSkinMeshList fill:#ff9999,stroke:#000,stroke-width:2px style CheckSkinMeshType fill:#99ccff,stroke:#000,stroke-width:2px style CheckExistingSkinCluster fill:#cc99ff,stroke:#000,stroke-width:2px style AddJointsToSkinCluster fill:#99ff99,stroke:#000,stroke-width:2px style CreateSkinCluster fill:#ff9999,stroke:#000,stroke-width:2px style CheckIfCurveMesh fill:#99ccff,stroke:#000,stroke-width:2px style AutoWeightCurve fill:#cc99ff,stroke:#000,stroke-width:2px style EndSkinMeshLoop fill:#99ff99,stroke:#000,stroke-width:2px style ContinueLoop fill:#ff9999,stroke:#000,stroke-width:2px style ReturnResult fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#cc99ff,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntBindTo function:

  1. The function starts by checking and updating parameters based on shArgs.

  2. It initializes a list of joints to bind to the skin mesh.

  3. The function checks if the mesh is valid for skinning (either a mesh or curve).

  4. If a skin cluster exists on the mesh, it adds the joints to the existing skin cluster.

  5. If no skin cluster exists, it creates a new skin cluster.

  6. For curve meshes, it performs auto-weighting.

  7. The process loops for each skin mesh in the list.

  8. Once all meshes are processed, the function returns the result, including the skin cluster and skin joints.

asNode.jntDisconnect(self, disconnectHI=False, **shArgs)#

[shArgs : di=disconnectHI]

Purpose:

:: Disconnects the hierarchy of the asNode if it is a joint. This function is used in rigging scripts where joint hierarchies need to be restructured.

Parameters:

disconnectHI – <bool> #Determines whether to disconnect the entire hierarchy of joints.

Returns:

<None> #No return value, the joint hierarchy is disconnected.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateDisconnectHI["/fas:fa-sync-alt Update disconnectHI"] UpdateDisconnectHI --> PerformDisconnect["/fas:fa-unlink Perform Disconnect"] CheckShArgs --"shArgs not provided"--> PerformDisconnect PerformDisconnect --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateDisconnectHI fill:#ff9999,stroke:#000,stroke-width:2px style PerformDisconnect fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntDisconnect function:

  1. The process starts by checking if shArgs are provided. If so, it updates the disconnectHI parameter.

  2. The function then performs the disconnection of the joint hierarchy based on the disconnectHI parameter.

  3. The joint hierarchy is disconnected, and the function completes its execution.

asNode.jntDist(self, includeHI=False, impliedParent=True, **shArgs)#

[shArgs : ih=includeHI, ip=impliedParent]

Purpose:

:: Calculates the distance between joints in a joint chain. This function is crucial in rigging for measuring joint distances for tasks like IK setup and joint placement.

Parameters:
  • includeHI – <bool> #Determines whether to include all joints in the hierarchy for the distance calculation.

  • impliedParent – <bool> #Considers implied parent joints in the calculation.

Returns:

<float> #The total distance between the joints in the chain.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateParameters["/fas:fa-sync-alt Update Parameters"] CheckShArgs --"shArgs not provided"--> DetermineCalculationMethod{{"/fas:fa-calculator Determine Calculation Method"}} UpdateParameters --> DetermineCalculationMethod DetermineCalculationMethod --"Include Hierarchy"--> SelectHierarchy["/fas:fa-sitemap Select Hierarchy"] SelectHierarchy --> CalculateTotalDistanceHI{{"/fas:fa-ruler-combined Calculate Total Distance (Hierarchy)"}} CalculateTotalDistanceHI --> ReturnTotalDistance[("fas:fa-arrow-right Return Total Distance")] DetermineCalculationMethod --"Single Joint or Implied Parent"--> CheckParentJoint{{"/fas:fa-question-circle Check Parent Joint"}} CheckParentJoint --"Parent Joint Exists"--> CalculateDistanceToParent{{"/fas:fa-ruler-vertical Calculate Distance to Parent"}} CalculateDistanceToParent --> ReturnDistanceToParent[("fas:fa-arrow-right Return Distance to Parent")] CheckParentJoint --"No Parent Joint"--> ReturnZero[("fas:fa-ban Return Zero")] ReturnTotalDistance --> End[("fas:fa-stop End")] ReturnDistanceToParent --> End ReturnZero --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style DetermineCalculationMethod fill:#99ccff,stroke:#000,stroke-width:2px style SelectHierarchy fill:#cc99ff,stroke:#000,stroke-width:2px style CalculateTotalDistanceHI fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTotalDistance fill:#99ccff,stroke:#000,stroke-width:2px style CheckParentJoint fill:#ffcc99,stroke:#000,stroke-width:2px style CalculateDistanceToParent fill:#ff9999,stroke:#000,stroke-width:2px style ReturnDistanceToParent fill:#99ff99,stroke:#000,stroke-width:2px style ReturnZero fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntDist function:

  1. The process starts by checking and updating parameters based on shArgs.

  2. The function then determines the calculation method based on whether to include the entire hierarchy or just the implied parent.

  3. If including hierarchy, it selects all joints in the hierarchy and calculates the total distance.

  4. If not including hierarchy, it checks if a parent joint exists.

  5. If a parent joint exists, it calculates the distance to the parent.

  6. If no parent joint is found, it returns zero.

  7. The function returns the total distance for hierarchy or the distance to the parent joint, as applicable.

asNode.jntLength(self, includeHI=False, impliedParent=True, **shArgs)#

[shArgs : ih=includeHI, ip=impliedParent]

Purpose:

:: Measures the length of a joint chain. Essential in rigging for determining the lengths of bone chains and for setting up IK solvers.

Parameters:
  • includeHI – <bool> #Specifies whether to include the entire hierarchy of joints in the length calculation.

  • impliedParent – <bool> #Considers implied parent joints in the calculation.

Returns:

<float> #The total length of the joint chain.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateParameters["/fas:fa-sync-alt Update Parameters"] CheckShArgs --"shArgs not provided"--> DetermineCalculationMethod{{"/fas:fa-calculator Determine Calculation Method"}} UpdateParameters --> DetermineCalculationMethod DetermineCalculationMethod --"Include Hierarchy"--> SelectHierarchy["/fas:fa-sitemap Select Hierarchy"] SelectHierarchy --> CalculateTotalLengthHI{{"/fas:fa-ruler-combined Calculate Total Length (Hierarchy)"}} CalculateTotalLengthHI --> ReturnTotalLength[("fas:fa-arrow-right Return Total Length")] DetermineCalculationMethod --"Single Joint or Implied Parent"--> CheckChildJoint{{"/fas:fa-question-circle Check Child Joint"}} CheckChildJoint --"Child Joint Exists"--> CalculateDistanceToChild{{"/fas:fa-ruler-vertical Calculate Distance to Child"}} CalculateDistanceToChild --> ReturnDistanceToChild[("fas:fa-arrow-right Return Distance to Child")] CheckChildJoint --"No Child Joint"--> ReturnZero[("fas:fa-ban Return Zero")] ReturnTotalLength --> End[("fas:fa-stop End")] ReturnDistanceToChild --> End ReturnZero --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style DetermineCalculationMethod fill:#99ccff,stroke:#000,stroke-width:2px style SelectHierarchy fill:#cc99ff,stroke:#000,stroke-width:2px style CalculateTotalLengthHI fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTotalLength fill:#99ccff,stroke:#000,stroke-width:2px style CheckChildJoint fill:#ffcc99,stroke:#000,stroke-width:2px style CalculateDistanceToChild fill:#ff9999,stroke:#000,stroke-width:2px style ReturnDistanceToChild fill:#99ff99,stroke:#000,stroke-width:2px style ReturnZero fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntLength function:

  1. The process starts by checking and updating parameters based on shArgs.

  2. The function then determines the calculation method based on whether to include the entire hierarchy or just the implied parent.

  3. If including hierarchy, it selects all joints in the hierarchy and calculates the total length.

  4. If not including hierarchy, it checks if a child joint exists.

  5. If a child joint exists, it calculates the distance to the child joint.

  6. If no child joint is found, it returns zero.

  7. The function returns the total length for hierarchy or the distance to the child joint, as applicable.

asNode.jntOrient(self, jntAxis='x', secAxisList=['y', 'y'], selectHI=True, endJnt=True, freezeIt=False, **shArgs)#

[shArgs : ja=jntAxis, sal=secAxisList, si=selectHI, ej=endJnt, fi=freezeIt]

Purpose:

:: Orients joints in a joint chain according to specified axes, crucial for rigging to ensure proper joint rotation axes alignment.

Parameters:
  • jntAxis – <str> #The primary axis for joint orientation (e.g., ‘x’).

  • secAxisList – <list> #A list defining the secondary axis for orientation (e.g., [‘y’, ‘y’]).

  • selectHI – <bool> #Determines whether to select the entire hierarchy of joints.

  • endJnt – <bool> #Specifies whether to include the end joint in the orientation process.

  • freezeIt – <bool> #Determines whether to freeze transformations after orienting.

Returns:

<None> #No return value, joints are oriented as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateParameters["/fas:fa-edit Update Parameters"] UpdateParameters --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> CheckFreezeTransformations{{"/fas:fa-question Check Freeze Transformations"}} CheckFreezeTransformations --"If Freeze Transformations" --> FreezeTransformations["/fas:fa-snowflake-o Freeze Transformations"] CheckFreezeTransformations --"If No Freeze Transformations" --> CheckPrimaryAxisNegativity{{"/fas:fa-question Check Primary Axis Negativity"}} FreezeTransformations --> CheckPrimaryAxisNegativity CheckPrimaryAxisNegativity --> CheckPrimarySecondaryAxisMismatch{{"/fas:fa-exchange-alt Check Primary & Secondary Axis Mismatch"}} CheckPrimarySecondaryAxisMismatch --> CheckSecondaryAxisNegativity{{"/fas:fa-minus-circle Check Secondary Axis Negativity"}} CheckSecondaryAxisNegativity --> PrepareJointOrientation["/fas:fa-cogs Prepare Joint Orientation"] PrepareJointOrientation --> SelectHierarchyJoints{{"/fas:fa-sitemap Select Hierarchy Joints"}} SelectHierarchyJoints --> CheckEndJointInclusion{{"/fas:fa-question Check End Joint Inclusion"}} CheckEndJointInclusion --"If Include End Joint" --> ProcessEndJoints["/fas:fa-arrow-circle-right Process End Joints"] CheckEndJointInclusion --"If Not Include End Joint" --> OrientJoints["/fas:fa-redo-alt Orient Joints"] ProcessEndJoints --> OrientJoints OrientJoints --> CleanUpTemporaryJoints["/fas:fa-broom Clean Up Temporary Joints"] CleanUpTemporaryJoints --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckFreezeTransformations fill:#cc99ff,stroke:#000,stroke-width:2px style FreezeTransformations fill:#99ff99,stroke:#000,stroke-width:2px style CheckPrimaryAxisNegativity fill:#ff9999,stroke:#000,stroke-width:2px style CheckPrimarySecondaryAxisMismatch fill:#99ccff,stroke:#000,stroke-width:2px style CheckSecondaryAxisNegativity fill:#cc99ff,stroke:#000,stroke-width:2px style PrepareJointOrientation fill:#99ff99,stroke:#000,stroke-width:2px style SelectHierarchyJoints fill:#ff9999,stroke:#000,stroke-width:2px style CheckEndJointInclusion fill:#99ccff,stroke:#000,stroke-width:2px style ProcessEndJoints fill:#cc99ff,stroke:#000,stroke-width:2px style OrientJoints fill:#99ff99,stroke:#000,stroke-width:2px style CleanUpTemporaryJoints fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#99ccff,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntOrient function:

  1. The function begins by checking and updating parameters based on shArgs.

  2. It then checks if freeze transformations are required and performs them if necessary.

  3. The function determines if the primary and secondary axes are negative and prepares joint orientation accordingly.

  4. It selects the hierarchy of joints based on the specified criteria.

  5. The joints are oriented according to the primary and secondary axis settings.

  6. The function checks if the end joint is included and processes the orientation for end joints if necessary.

  7. Any temporary joints created during the process are cleaned up.

  8. The function completes its execution after orienting the joints as specified.

asNode.jntOrientTo(self, trgtJnt, axisList=['x', 'y', 'z'], **shArgs)#

[shArgs : tj=trgtJnt, al=axisList]

Purpose:

:: Orients a joint to align with another target joint. Widely used in rigging for aligning joint orientations for consistency and proper deformation.

Parameters:
  • trgtJnt – <asNode> #The target joint to align the orientation to.

  • axisList – <list> #List of axes to use for the orientation alignment.

Returns:

<None> #No return value, the joint is oriented to match the target joint.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateParameters["/fas:fa-edit Update Parameters"] UpdateParameters --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> ConvertAxisListToList["/fas:fa-list-ol Convert AxisList to List"] ConvertAxisListToList --> CheckTrgtNodeType{{"/fas:fa-question Check Target Node Type"}} CheckTrgtNodeType --"If Target is Joint" --> CheckAxisListLength{{"/fas:fa-ruler-horizontal Check Axis List Length"}} CheckTrgtNodeType --"If Target is Not Joint" --> RaiseError["/fas:fa-exclamation-triangle Raise Error"] CheckAxisListLength --"If 3 Axes" --> GetTargetAttributes["/fas:fa-tags Get Target Attributes (All Axes)"] CheckAxisListLength --"If Not 3 Axes" --> LoopThroughAxes{{"/fas:fa-repeat Loop Through Axes"}} GetTargetAttributes --> SetJointAttributes["/fas:fa-wrench Set Joint Attributes (All Axes)"] LoopThroughAxes --> GetTargetAttributeSingleAxis["/fas:fa-tag Get Target Attribute (Single Axis)"] GetTargetAttributeSingleAxis --> SetJointAttributeSingleAxis["/fas:fa-wrench Set Joint Attribute (Single Axis)"] SetJointAttributes --> End[("fas:fa-stop End")] SetJointAttributeSingleAxis --> EndLoop{{"/fas:fa-repeat End Loop"}} EndLoop --"If More Axes" --> LoopThroughAxes EndLoop --"If No More Axes" --> End RaiseError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style ConvertAxisListToList fill:#cc99ff,stroke:#000,stroke-width:2px style CheckTrgtNodeType fill:#99ff99,stroke:#000,stroke-width:2px style CheckAxisListLength fill:#ff9999,stroke:#000,stroke-width:2px style GetTargetAttributes fill:#99ccff,stroke:#000,stroke-width:2px style RaiseError fill:#cc99ff,stroke:#000,stroke-width:2px style SetJointAttributes fill:#99ff99,stroke:#000,stroke-width:2px style LoopThroughAxes fill:#ff9999,stroke:#000,stroke-width:2px style GetTargetAttributeSingleAxis fill:#99ccff,stroke:#000,stroke-width:2px style SetJointAttributeSingleAxis fill:#cc99ff,stroke:#000,stroke-width:2px style EndLoop fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff9999,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntOrientTo function:

  1. The function starts by checking and updating parameters based on shArgs.

  2. It converts the axis list to a list format if necessary.

  3. The function then checks if the target joint is a valid joint node.

  4. If the target joint is not valid, an error is raised.

  5. If valid, it checks the length of the axis list.

  6. If the axis list has 3 axes, the function orients the joint to match all axes of the target joint.

  7. If the axis list does not have 3 axes, it loops through each axis to orient the joint.

  8. The joint is oriented for each specified axis to match the target joint.

  9. The function completes its execution after orienting the joint as specified.

asNode.jntRadius(self, val=None, **shArgs)#

[shArgs : v=val]

Purpose:

:: Sets or retrieves the radius attribute of a joint, which is essential in rigging to visually adjust the joint size for clarity and selection ease.

Parameters:

val – <float, optional> #The value to set for the joint’s radius.

Returns:

<float> #The radius value of the joint, if ‘val’ is not specified.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateValue["/fas:fa-edit Update Value"] UpdateValue --> DetermineAction{{"/fas:fa-decision Determine Action"}} CheckShArgs --"shArgs not provided"--> DetermineAction DetermineAction --"Value Provided"--> SetRadius["/fas:fa-circle Set Radius"] DetermineAction --"No Value Provided"--> GetRadius["/fas:fa-info-circle Get Radius"] SetRadius --> End[("fas:fa-stop End")] GetRadius --> ReturnRadiusValue[("fas:fa-arrow-right Return Radius Value")] ReturnRadiusValue --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateValue fill:#ff9999,stroke:#000,stroke-width:2px style DetermineAction fill:#99ccff,stroke:#000,stroke-width:2px style SetRadius fill:#cc99ff,stroke:#000,stroke-width:2px style GetRadius fill:#99ff99,stroke:#000,stroke-width:2px style ReturnRadiusValue fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntRadius function:

  1. The function starts by checking and updating the value based on shArgs.

  2. It then determines whether to set or get the radius attribute.

  3. If a value is provided, the function sets the radius attribute of the joint to that value.

  4. If no value is provided, the function retrieves the current radius attribute of the joint.

  5. The function returns the radius value if it is retrieving, or it completes after setting the value.

asNode.jntSkinIndex(self, skinClust=None, **shArgs)#

[shArgs : sc=skinClust]

Purpose:

:: Retrieves the index of the asNode in a skin cluster’s influence list. Crucial in skinning and rigging scripts for managing joint influences. >>>”To Reset skin deformation for selected joint(s)”

Parameters:

skinClust – <asNode, optional> #The skin cluster to query the influence index from.

Returns:

<int> #The index of the asNode in the skin cluster’s influence list.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"If shArgs is provided" --> UpdateSkinClust["/fas:fa-sync-alt Update skinClust"] CheckShArgs --"If shArgs is not provided" --> IsJointCheck{{"/fas:fa-code-branch Check if self is joint"}} UpdateSkinClust --> IsJointCheck IsJointCheck --"self.isJnt() returns False" --> ReturnNone1[("fas:fa-ban Return None")] IsJointCheck --"self.isJnt() returns True" --> CheckSkinClust{{"/fas:fa-check-square Check if skinClust is provided"}} CheckSkinClust --"skinClust is provided" --> ProcessSkinClust["/fas:fa-cogs Process skinClust"] CheckSkinClust --"skinClust not provided" --> ListConnections["/fas:fa-sitemap List Connections"] ProcessSkinClust --"Extract and return index" --> ReturnIndex1[("fas:fa-location-arrow Return Index")] ListConnections --"Iterate through connections" --> ReturnIndex2[("fas:fa-location-arrow Return Index/List")] ListConnections --"No connections" --> ReturnEmptyList[("fas:fa-list Return Empty List")] ReturnNone1 --> End[("fas:fa-stop End")] ReturnIndex1 --> End ReturnIndex2 --> End ReturnEmptyList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSkinClust fill:#ff9999,stroke:#000,stroke-width:2px style IsJointCheck fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinClust fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessSkinClust fill:#99ff99,stroke:#000,stroke-width:2px style ListConnections fill:#ff6666,stroke:#000,stroke-width:2px style ReturnNone1 fill:#cccccc,stroke:#000,stroke-width:2px style ReturnIndex1 fill:#cccccc,stroke:#000,stroke-width:2px style ReturnIndex2 fill:#cccccc,stroke:#000,stroke-width:2px style ReturnEmptyList fill:#cccccc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntSkinIndex function:

  1. The process begins by checking if shArgs are provided and updating the skinClust parameter if necessary.

  2. It then verifies if the node is a joint.

  3. If the node is not a joint, it returns None.

  4. If the node is a joint and a specific skin cluster is provided, it processes the joint with that skin cluster to retrieve its index.

  5. If no specific skin cluster is provided, it lists connections to find the joint’s influence index in any connected skin clusters.

  6. The function returns the index of the joint in the skin cluster’s influence list or an empty list if there are no connections.

asNode.jntSplit(self, splitCount=1, makeCopy=False, namePrfx=None, nameSufx='_Skn_Jnt', matchOrient=False, getPos=0, getLoc=0, getEnds=0, **shArgs)#

[shArgs : sc=splitCount, mc=makeCopy, np=namePrfx, ns=nameSufx, mo=matchOrient, gp=getPos, gl=getLoc, ge=getEnds]

Purpose:

:: Splits a joint into multiple segments, widely used in rigging to create additional deformation controls within a joint chain.

Parameters:
  • splitCount – <int> #The number of segments to split the joint into.

  • makeCopy – <bool> #Determines whether to make copies of the joint for splitting.

  • namePrfx – <str, optional> #The prefix for naming the split joints.

  • nameSufx – <str> #The suffix for naming the split joints.

  • matchOrient – <bool> #Specifies whether to match the orientation of the split joints to the original.

  • getPos – <bool> #Determines whether to retrieve the positions of the split joints.

  • getLoc – <bool> #Specifies whether to create locators at the split joint positions.

  • getEnds – <bool> #Indicates whether to include the end joints in the result.

Returns:

<list> #A list of the split joints created from the original joint. Returns: (asNodes) [‘Split_01_Skn_Jnt’, ‘Split_02_Skn_Jnt’, ..] #_ asNodes

Note:

baseJnt : baseJnt should have at least one child jnt namePrfx : if not given, splitJnt new name is :

>> baseJnt.shortName().replace(‘_Jnt’, ‘’) + ‘%0.2d’ %num + nameSufx

makeCopyif True

>> Copy baseJnt and parents all split jnts under baseJnt

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"Update parameters if shArgs provided" --> CheckChild{{"/fas:fa-code-branch Check for Child Joint"}} CheckShArgs --"Proceed with given parameters" --> CheckChild CheckChild --"No child joint" --> ReturnEmptyList1[("fas:fa-list Return Empty List")] CheckChild --"Child joint exists" --> DetermineJntAxis{{"/fas:fa-arrows-alt Determine Joint Axis"}} DetermineJntAxis --"Determine axis and operations" --> CheckMakeCopy{{"/fas:fa-clone Check makeCopy"}} CheckMakeCopy --"makeCopy is True" --> ProcessCopyTrue["/fas:fa-copy Process with makeCopy True"] CheckMakeCopy --"makeCopy is False" --> ProcessCopyFalse["/fas:fa-times-circle Process with makeCopy False"] ProcessCopyTrue --> CalculatePositions{{"/fas:fa-ruler-combined Calculate Positions"}} ProcessCopyFalse --> CalculatePositions CalculatePositions --"Calculate split joint positions" --> CheckGetPos{{"/fas:fa-search-plus Check getPos"}} CheckGetPos --"If getPos is True" --> ReturnPositions[("fas:fa-map-marker-alt Return Positions")] CheckGetPos --"Continue processing" --> CreateSplitJoints{{"/fas:fa-project-diagram Create Split Joints"}} CreateSplitJoints --"Create and process split joints" --> ReturnSplitJoints[("fas:fa-link Return Split Joints")] ReturnEmptyList1 --> End[("fas:fa-stop End")] ReturnPositions --> End ReturnSplitJoints --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckChild fill:#ff9999,stroke:#000,stroke-width:2px style DetermineJntAxis fill:#99ccff,stroke:#000,stroke-width:2px style CheckMakeCopy fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessCopyTrue fill:#99ff99,stroke:#000,stroke-width:2px style ProcessCopyFalse fill:#ff6666,stroke:#000,stroke-width:2px style CalculatePositions fill:#cccccc,stroke:#000,stroke-width:2px style CheckGetPos fill:#ffcc99,stroke:#000,stroke-width:2px style ReturnPositions fill:#cccccc,stroke:#000,stroke-width:2px style CreateSplitJoints fill:#ff9999,stroke:#000,stroke-width:2px style ReturnSplitJoints fill:#cccccc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the jntSplit function:

  1. The process starts by checking and updating parameters based on shArgs.

  2. It then verifies if a child joint exists.

  3. If no child joint is found, the function returns an empty list.

  4. If a child joint exists, the function determines the joint axis for splitting.

  5. Based on the makeCopy parameter, it processes the split either by making a copy of the joint or not.

  6. The function calculates the positions for split joints.

  7. Split joints are created at the calculated positions.

  8. If the getPos parameter is true, it returns the positions of the split joints.

  9. Otherwise, it finalizes the split joints, matching orientations if needed, and returns the list of split joints.

asNode.length(self, nameLength=False, **shArgs)#

[shArgs : nl=nameLength]

Purpose:

:: Calculates the length of an object, such as a curve or bone chain. This function is vital in rigging and animation for determining distances and proportions.

Parameters:

nameLength – <bool> #Determines whether to calculate the length based on the name’s length.

Returns:

<float> #The calculated length of the object.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateNameLength["/fas:fa-sync-alt Update NameLength"] CheckShArgs --"shArgs not provided"--> DecideCalculationMethod{{"/fas:fa-calculator Decide Calculation Method"}} UpdateNameLength --> DecideCalculationMethod DecideCalculationMethod --"Calculate Based on Name Length"--> CalculateNameLength["/fas:fa-text Calculate Name Length"] DecideCalculationMethod --"Calculate Physical Length"--> CalculatePhysicalLength["/fas:fa-ruler Calculate Physical Length"] CalculateNameLength --> ReturnNameLength[("fas:fa-arrow-right Return Name Length")] CalculatePhysicalLength --> ReturnPhysicalLength[("fas:fa-arrow-right Return Physical Length")] ReturnNameLength --> End[("fas:fa-stop End")] ReturnPhysicalLength --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateNameLength fill:#ff9999,stroke:#000,stroke-width:2px style DecideCalculationMethod fill:#99ccff,stroke:#000,stroke-width:2px style CalculateNameLength fill:#cc99ff,stroke:#000,stroke-width:2px style CalculatePhysicalLength fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNameLength fill:#99ccff,stroke:#000,stroke-width:2px style ReturnPhysicalLength fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the length function:

  1. The process starts by checking if shArgs are provided and updating the nameLength parameter if necessary.

  2. The function then decides the calculation method based on the nameLength parameter.

  3. If calculating based on the name’s length, it computes the length of the object’s name.

  4. If calculating the physical length, it computes the actual length of the object.

  5. The function returns the calculated length, either based on the name or the physical dimensions of the object.

asNode.listAttr(self, shortForm=True, **kwargs)#

[shArgs : sf=shortForm]

Purpose:

:: Lists the attributes of the asNode, essential in scripts that need to query or manipulate node attributes.

Parameters:

shortForm – <bool> #Specifies whether to return the attributes in short form.

Returns:

<list> #A list of attributes of the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateShortForm["/fas:fa-sync-alt Update ShortForm"] CheckShArgs --"shArgs not provided"--> ListAttributes["/fas:fa-list-alt List Attributes"] UpdateShortForm --> ListAttributes ListAttributes --"Retrieve attribute list"--> CheckShortForm{{"/fas:fa-exchange-alt Check ShortForm"}} CheckShortForm --"Short Form Required"--> ConvertToShortForm["/fas:fa-compress-arrows-alt Convert to Short Form"] CheckShortForm --"Full Form Required"--> ReturnFullFormAttributes[("fas:fa-arrow-right Return Full Form Attributes")] ConvertToShortForm --> ReturnShortFormAttributes[("fas:fa-arrow-right Return Short Form Attributes")] ReturnFullFormAttributes --> End[("fas:fa-stop End")] ReturnShortFormAttributes --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateShortForm fill:#ff9999,stroke:#000,stroke-width:2px style ListAttributes fill:#99ccff,stroke:#000,stroke-width:2px style CheckShortForm fill:#cc99ff,stroke:#000,stroke-width:2px style ConvertToShortForm fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFullFormAttributes fill:#99ccff,stroke:#000,stroke-width:2px style ReturnShortFormAttributes fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the listAttr function:

  1. The process starts by checking if shArgs are provided and updating the shortForm parameter accordingly.

  2. The function then lists the attributes of the asNode.

  3. It checks if the attributes need to be returned in short form.

  4. If short form is required, it converts the attribute names to short form and returns them.

  5. If short form is not required, it returns the attribute names in their full form.

  6. The function completes by returning the list of attributes in the specified format.

asNode.listConnections(self, attr=None, *args, **kwargs)#

[shArgs : a=attr]

Purpose:

:: Lists the connections of a specified attribute on the asNode. Key in scripts for managing and understanding node dependencies and relationships.

Parameters:

attr – <str, optional> #The attribute to list connections for.

Returns:

<list> #A list of nodes connected to the specified attribute.

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"/fas:fa-question-circle Check kwargs"}} CheckKwargs --"Update kwargs if provided"--> CheckAttribute{{"/fas:fa-check-square Check if Attribute Specified"}} CheckKwargs --"Proceed with default kwargs"--> CheckAttribute CheckAttribute --"Attribute Specified"--> ListAttributeConnections["/fas:fa-link List Attribute Connections"] CheckAttribute --"No Attribute Specified"--> ListNodeConnections["/fas:fa-sitemap List Node Connections"] ListAttributeConnections --"Retrieve connected nodes"--> ProcessAttributeConnections{{"/fas:fa-filter Process Attribute Connections"}} ListNodeConnections --"Retrieve connected nodes"--> ProcessNodeConnections{{"/fas:fa-filter Process Node Connections"}} ProcessAttributeConnections --"Connections Found"--> ReturnAttributeConnections[("fas:fa-arrow-right Return Attribute Connections")] ProcessAttributeConnections --"No Connections"--> ReturnEmptyList1[("fas:fa-list Return Empty List")] ProcessNodeConnections --"Connections Found"--> ReturnNodeConnections[("fas:fa-arrow-right Return Node Connections")] ProcessNodeConnections --"No Connections"--> ReturnEmptyList2[("fas:fa-list Return Empty List")] ReturnAttributeConnections --> End[("fas:fa-stop End")] ReturnNodeConnections --> End ReturnEmptyList1 --> End ReturnEmptyList2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckAttribute fill:#ff9999,stroke:#000,stroke-width:2px style ListAttributeConnections fill:#99ccff,stroke:#000,stroke-width:2px style ListNodeConnections fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessAttributeConnections fill:#99ff99,stroke:#000,stroke-width:2px style ProcessNodeConnections fill:#ff9999,stroke:#000,stroke-width:2px style ReturnAttributeConnections fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNodeConnections fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnEmptyList1 fill:#99ff99,stroke:#000,stroke-width:2px style ReturnEmptyList2 fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the listConnections function:

  1. The process begins by checking and updating kwargs if provided.

  2. It then checks if a specific attribute is targeted for listing connections.

  3. If an attribute is specified, it lists the connections for that attribute.

  4. If no attribute is specified, it lists the connections for the entire node.

  5. The function processes the connections to filter out irrelevant nodes.

  6. It returns the list of connections, either for the specified attribute or the node, or returns an empty list if there are no connections.

asNode.listConstraints(self, conTypes=None, **shArgs)#

[shArgs : ct=conTypes]

Purpose:

:: Lists the constraints applied to the asNode, crucial for rigging and animation scripts to manage and analyze constraints.

Usage:

conTypes =[‘point’, ‘orient’, ‘parent’, ‘scale’, ‘aim’, ‘geometry’, ‘normal’, ‘tangent’] #_ if type is not given, it lists all constraints..

asN.listConstraints()

#_ Else it list only requested type

asN.listConstraints(conType=’point’) asN.listConstraints(conType=’parent’)

Parameters:

conTypes – <list, optional> #A list of constraint types to filter the results.

Returns:

<list> #A list of constraints applied to the asNode. if conNodes:

return conNodes #_ List of nodes

else:

return None

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"Update conTypes if shArgs provided" --> DefineConList["/fas:fa-list-ol Define Constraint List"] CheckShArgs --"Proceed with given conTypes" --> DefineConList DefineConList --"List of all constraint types" --> CheckConTypes{{"/fas:fa-filter Check if conTypes is provided"}} CheckConTypes --"conTypes provided" --> ValidateConTypes{{"/fas:fa-check-circle Validate conTypes"}} CheckConTypes --"conTypes not provided" --> ListAllConstraints{{"/fas:fa-stream List All Constraints"}} ValidateConTypes --"Iterate and validate each type" --> ListSelectedConstraints{{"/fas:fa-tasks List Selected Constraints"}} ListSelectedConstraints --"List constraints of selected types" --> ReturnConNodes[("fas:fa-link Return Constraint Nodes")] ListAllConstraints --"List constraints of all types" --> ReturnConNodes ValidateConTypes --"Invalid type found" --> ReturnNone1[("fas:fa-ban Return None")] ReturnConNodes --"If constraints found" --> End[("fas:fa-stop End")] ReturnConNodes --"No constraints found" --> ReturnNone2[("fas:fa-ban Return None")] ReturnNone1 --> End ReturnNone2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style DefineConList fill:#ff9999,stroke:#000,stroke-width:2px style CheckConTypes fill:#99ccff,stroke:#000,stroke-width:2px style ValidateConTypes fill:#cc99ff,stroke:#000,stroke-width:2px style ListSelectedConstraints fill:#99ff99,stroke:#000,stroke-width:2px style ListAllConstraints fill:#ff6666,stroke:#000,stroke-width:2px style ReturnConNodes fill:#cccccc,stroke:#000,stroke-width:2px style ReturnNone1 fill:#cccccc,stroke:#000,stroke-width:2px style ReturnNone2 fill:#cccccc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the listConstraints function:

  1. The process starts by checking if shArgs are provided and updating the conTypes parameter if necessary.

  2. The function then defines a list of all possible constraint types.

  3. It checks if specific constraint types are provided.

  4. If specific types are provided, it validates these types and lists the constraints of these selected types.

  5. If no specific types are provided, it lists all constraints applied to the node.

  6. The function returns a list of constraint nodes or None if no constraints are found.

  7. If an invalid constraint type is found during validation, the function returns None.

asNode.listHistory(self, **kwargs)#

[shArgs]

Purpose:

:: Lists the history of the asNode, important for scripts that need to trace the construction history or previous operations on a node.

Returns:

<list> #A list of nodes in the history of the asNode.

Usage:

asN.listHistory() #_ type & type=’constraint’ are supported asN.listHistory(type=’pointConstraint’) asN.listHistory(type=’skinCluster’)

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"/fas:fa-question Check kwargs"}} CheckKwargs --"If kwargs is provided" --> SelectNode["/fas:fa-hand-pointer Select Node"] CheckKwargs --"If kwargs is not provided" --> TryListHistory["/fas:fa-list-ol Try mc.listHistory()"] SelectNode --> TryListHistory TryListHistory --"Successful listHistory"--> HistNodesExists{"/fas:fa-check-circle Hist Nodes Exist?"} TryListHistory --"Exception occurs"--> CheckTypeInKwargs{{"/fas:fa-search-plus Check 'type' in kwargs"}} CheckTypeInKwargs --"If 'type' in kwargs"--> NodeListAssignment["/fas:fa-th-list Assign nodeList"] CheckTypeInKwargs --"If 'type' not in kwargs"--> ReturnEmptyHistNodes["/fas:fa-times-circle Return Empty Hist Nodes"] NodeListAssignment --> LoopNodeList{{"/fas:fa-sync-alt Loop through nodeList"}} LoopNodeList --"For each node in nodeList"--> CheckKwargsType["/fas:fa-tags Check kwargs['type']"] CheckKwargsType --"If 'constraint' in kwargs['type']"--> ConstraintTypeCheck["/fas:fa-tools Constraint Type Check"] CheckKwargsType --"Else If 'Constraint' in kwargs['type']"--> SpecificConstraintCheck["/fas:fa-screwdriver Specific Constraint Check"] CheckKwargsType --"Else"--> TypeMatchAppend["/fas:fa-plus Type Match Append"] ConstraintTypeCheck --"Various constraint type checks"--> IsParentOfCheck1["/fas:fa-sitemap Is self.isParentOf(node)?"] SpecificConstraintCheck --> IsParentOfCheck2["/fas:fa-sitemap Is self.isParentOf(node)?"] TypeMatchAppend --> HistNodesAppend1["/fas:fa-arrow-down Append to histNodes"] IsParentOfCheck1 --> HistNodesAppend2["/fas:fa-arrow-down Append to histNodes"] IsParentOfCheck2 --> HistNodesAppend3["/fas:fa-arrow-down Append to histNodes"] HistNodesAppend1 --> EndLoopNodeList[("fas:fa-repeat End Loop NodeList")] HistNodesAppend2 --> EndLoopNodeList HistNodesAppend3 --> EndLoopNodeList EndLoopNodeList --"End of loop"--> ReturnEmptyHistNodes HistNodesExists --"If histNodes exist"--> TryAsNodeConversion["/fas:fa-code-branch Try asNode Conversion"] HistNodesExists --"If histNodes don't exist"--> ReturnEmptyHistNodes TryAsNodeConversion --"Successful conversion"--> ReturnHistNodes["/fas:fa-arrow-right Return Hist Nodes"] TryAsNodeConversion --"Exception in conversion"--> ReturnHistNodesAlt["/fas:fa-arrow-right Return Hist Nodes Alternative"] ReturnHistNodes --> End[("fas:fa-stop End")] ReturnHistNodesAlt --> End ReturnEmptyHistNodes --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style SelectNode fill:#ff9999,stroke:#000,stroke-width:2px style TryListHistory fill:#99ccff,stroke:#000,stroke-width:2px style CheckTypeInKwargs fill:#cc99ff,stroke:#000,stroke-width:2px style NodeListAssignment fill:#99ff99,stroke:#000,stroke-width:2px style LoopNodeList fill:#ffcc99,stroke:#000,stroke-width:2px style CheckKwargsType fill:#ccffcc,stroke:#000,stroke-width:2px style ConstraintTypeCheck fill:#ffcc99,stroke:#000,stroke-width:2px style SpecificConstraintCheck fill:#ccffcc,stroke:#000,stroke-width:2px style TypeMatchAppend fill:#ff9999,stroke:#000,stroke-width:2px style IsParentOfCheck1 fill:#cc99ff,stroke:#000,stroke-width:2px style IsParentOfCheck2 fill:#99ff99,stroke:#000,stroke-width:2px style HistNodesAppend1 fill:#ffcc00,stroke:#000,stroke-width:2px style HistNodesAppend2 fill:#ff9999,stroke:#000,stroke-width:2px style HistNodesAppend3 fill:#99ccff,stroke:#000,stroke-width:2px style HistNodesExists fill:#cc99ff,stroke:#000,stroke-width:2px style TryAsNodeConversion fill:#99ff99,stroke:#000,stroke-width:2px style ReturnHistNodes fill:#ccffcc,stroke:#000,stroke-width:2px style ReturnHistNodesAlt fill:#ffcc99,stroke:#000,stroke-width:2px style ReturnEmptyHistNodes fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the listHistory function:

  1. The process starts by checking if kwargs are provided and selecting the node if necessary.

  2. It then attempts to list the history of the node using Maya commands.

  3. If an exception occurs, it checks if ‘type’ is specified in kwargs.

  4. If ‘type’ is specified, it assigns a nodeList and loops through each node to check for matches with the specified type.

  5. If matches are found, they are appended to a list of historical nodes.

  6. If ‘type’ is not specified or no matches are found, it returns an empty list of historical nodes.

  7. Finally, the function returns a list of historical nodes if they exist or an empty list if they don’t.

asNode.listLockedAttrs(self, compoundAttr, **shArgs)#

[shArgs : ca=compoundAttr]

Purpose:

:: Lists the locked attributes of the asNode, particularly useful in rigging and scripting to avoid manipulating locked attributes.

Parameters:

compoundAttr – <str> #The compound attribute to check for locked sub-attributes.

Returns:

<list> #A list of locked attributes on the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateCompoundAttr["/fas:fa-sync-alt Update CompoundAttr"] CheckShArgs --"shArgs not provided"--> CheckCompoundAttrExists{{"/fas:fa-check-square Check if CompoundAttr Exists"}} UpdateCompoundAttr --> CheckCompoundAttrExists CheckCompoundAttrExists --"CompoundAttr Exists"--> QueryAttributeType{{"/fas:fa-info-circle Query Attribute Type"}} CheckCompoundAttrExists --"CompoundAttr Not Exists"--> ReturnEmptyList[("fas:fa-list Return Empty List")] QueryAttributeType --"Attribute Type is 'double3'"--> ListChildAttrs{{"/fas:fa-stream List Child Attributes"}} QueryAttributeType --"Attribute Type Not 'double3'"--> ReturnEmptyList ListChildAttrs --"List Child Attributes"--> LoopThroughChildAttrs{{"/fas:fa-repeat Loop Through Child Attributes"}} LoopThroughChildAttrs --"For Each Child Attribute"--> CheckLockedAttr{{"/fas:fa-lock Check Locked Attribute"}} CheckLockedAttr --"If Locked"--> AppendLockedAttr["/fas:fa-plus Append Locked Attribute"] AppendLockedAttr --> ContinueLoop{{"/fas:fa-arrow-right Continue Loop"}} ContinueLoop --> LoopThroughChildAttrs CheckLockedAttr --"If Not Locked"--> ContinueLoop LoopThroughChildAttrs --"End of Loop"--> ReturnLockedAttrs[("fas:fa-arrow-right Return Locked Attributes")] ReturnLockedAttrs --> End[("fas:fa-stop End")] ReturnEmptyList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateCompoundAttr fill:#ff9999,stroke:#000,stroke-width:2px style CheckCompoundAttrExists fill:#99ccff,stroke:#000,stroke-width:2px style QueryAttributeType fill:#cc99ff,stroke:#000,stroke-width:2px style ListChildAttrs fill:#99ff99,stroke:#000,stroke-width:2px style LoopThroughChildAttrs fill:#ff9999,stroke:#000,stroke-width:2px style CheckLockedAttr fill:#99ccff,stroke:#000,stroke-width:2px style AppendLockedAttr fill:#cc99ff,stroke:#000,stroke-width:2px style ContinueLoop fill:#99ff99,stroke:#000,stroke-width:2px style ReturnLockedAttrs fill:#ccffcc,stroke:#000,stroke-width:2px style ReturnEmptyList fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the listLockedAttrs function:

  1. The process begins by checking if shArgs are provided, updating the compoundAttr parameter if necessary.

  2. It then checks if the compound attribute exists on the node.

  3. If the compound attribute exists and is of type ‘double3’, it lists its child attributes.

  4. For each child attribute, it checks if the attribute is locked.

  5. If the attribute is locked, it appends the attribute to the list of locked attributes.

  6. After processing all child attributes, it returns the list of locked attributes.

  7. If the compound attribute does not exist or is not of type ‘double3’, it returns an empty list.

asNode.listRelatives(self, typeFilter='', parent=0, children=0, siblings=0, fullPath=0, *args, **shArgs)#

[shArgs : t=typeFilter, p=parent, c=children, s=siblings, f=fullPath]

Purpose:

:: Lists the relatives (parents, children, siblings) of the asNode, essential in rigging and scene management scripts for navigating node hierarchies.

Parameters:
  • typeFilter – <str, optional> #The type of relatives to list (e.g., ‘mesh’, ‘joint’).

  • parent – <bool> #Specifies whether to list parent nodes.

  • children – <bool> #Specifies whether to list child nodes.

  • siblings – <bool> #Specifies whether to list sibling nodes.

  • fullPath – <bool> #Determines whether to return the full path names of the nodes.

Returns:

<list> #A list of relative nodes of the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateFilters["/fas:fa-sync-alt Update Filters"] CheckShArgs --"shArgs not provided"--> SetDefaultFullPath{"Set Default fullPath"} UpdateFilters --> SetDefaultFullPath SetDefaultFullPath --"Set fullPath to True"--> SelectNode["/fas:fa-hand-pointer Select Node"] SelectNode --> TryListRelatives["/fas:fa-list-ol Try mc.listRelatives()"] TryListRelatives --"Successful listRelatives"--> CheckRelativesExist{"/fas:fa-check-circle Relatives Exist?"} TryListRelatives --"Exception occurs"--> ReturnNone["/fas:fa-ban Return None"] CheckRelativesExist --"Relatives Exist"--> ConvertToListNodes["/fas:fa-code-branch Convert to List of Nodes"] CheckRelativesExist --"No Relatives"--> ReturnEmptyList["/fas:fa-times-circle Return Empty List"] ConvertToListNodes --"Successful Conversion"--> ReturnListNodes["/fas:fa-arrow-right Return List of Nodes"] ConvertToListNodes --"Conversion Fails"--> ReturnRawRelatives["/fas:fa-arrow-right Return Raw Relatives"] ReturnListNodes --> End[("fas:fa-stop End")] ReturnRawRelatives --> End ReturnEmptyList --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateFilters fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultFullPath fill:#99ccff,stroke:#000,stroke-width:2px style SelectNode fill:#cc99ff,stroke:#000,stroke-width:2px style TryListRelatives fill:#99ff99,stroke:#000,stroke-width:2px style CheckRelativesExist fill:#ff6666,stroke:#000,stroke-width:2px style ConvertToListNodes fill:#cccccc,stroke:#000,stroke-width:2px style ReturnListNodes fill:#ffcc99,stroke:#000,stroke-width:2px style ReturnRawRelatives fill:#ccffcc,stroke:#000,stroke-width:2px style ReturnEmptyList fill:#ff9999,stroke:#000,stroke-width:2px style ReturnNone fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the listRelatives function:

  1. The process starts by checking if shArgs are provided and updating the filters accordingly.

  2. It sets the default value for the fullPath parameter to True.

  3. The node is then selected, and an attempt is made to list its relatives using Maya commands.

  4. If the attempt is successful and relatives are found, they are converted into a list of nodes.

  5. If the conversion is successful, a list of node relatives is returned.

  6. If no relatives are found or the conversion fails, an empty list or raw relatives list is returned.

  7. In case of any exceptions during the process, None is returned.

asNode.lockAttrs(self, attrList=None, keyable=False, **shArgs)#

[shArgs : a=attr, l=lock, k=keyable]

Purpose:

:: Locks or unlocks an attribute on the asNode, commonly used in rigging to prevent unwanted manipulation of key attributes.

Parameters:
  • attrList – <str/list> #The attribute to lock or unlock. attrList = ‘t’ | ‘tx’ | ‘v’ | [‘t’, ‘r’] | [‘translateX’, ‘r’] etc

  • lock – <bool> #Determines whether to lock or unlock the attribute.

  • keyable – <bool> #Specifies whether to make the attribute keyable or non-keyable.

Returns:

<None> #No return value, the attribute is locked or unlocked as specified.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"shArgs provided"--> UpdateParameters["/fas:fa-sync-alt Update Parameters"] CheckShArgs --"shArgs not provided"--> ConvertAttrListToList{"Convert AttrList to List"} UpdateParameters --> ConvertAttrListToList ConvertAttrListToList --"Convert if attrList is String"--> LoopThroughAttrs{{"/fas:fa-repeat Loop Through Attrs"}} LoopThroughAttrs --"For Each Attr in attrList"--> QueryAttributeType{{"/fas:fa-info-circle Query Attribute Type"}} QueryAttributeType --"If 'double3' Type"--> ListSubAttrs{{"/fas:fa-stream List Sub-Attributes"}} QueryAttributeType --"Else"--> LockUnlockAttr["/fas:fa-lock Lock/Unlock Attribute"] ListSubAttrs --"List Sub-Attributes"--> LoopThroughSubAttrs{{"/fas:fa-sync-alt Loop Through Sub-Attributes"}} LoopThroughSubAttrs --"For Each Sub-Attr"--> LockUnlockSubAttr["/fas:fa-lock Lock/Unlock Sub-Attribute"] LockUnlockSubAttr --> ContinueLoopSubAttrs{{"/fas:fa-arrow-right Continue Loop Sub-Attrs"}} ContinueLoopSubAttrs --> LoopThroughSubAttrs LoopThroughSubAttrs --"End of Sub-Attr Loop"--> ContinueLoopAttrs{{"/fas:fa-arrow-right Continue Loop Attrs"}} LockUnlockAttr --> ContinueLoopAttrs ContinueLoopAttrs --> LoopThroughAttrs LoopThroughAttrs --"End of Attr Loop"--> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style ConvertAttrListToList fill:#99ccff,stroke:#000,stroke-width:2px style LoopThroughAttrs fill:#cc99ff,stroke:#000,stroke-width:2px style QueryAttributeType fill:#99ff99,stroke:#000,stroke-width:2px style ListSubAttrs fill:#ff9999,stroke:#000,stroke-width:2px style LoopThroughSubAttrs fill:#99ccff,stroke:#000,stroke-width:2px style LockUnlockSubAttr fill:#cc99ff,stroke:#000,stroke-width:2px style ContinueLoopSubAttrs fill:#99ff99,stroke:#000,stroke-width:2px style LockUnlockAttr fill:#ff6666,stroke:#000,stroke-width:2px style ContinueLoopAttrs fill:#cccccc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the lockAttrs function:

  1. The process begins by checking if shArgs are provided and updating the parameters accordingly.

  2. If attrList is a string, it converts it to a list.

  3. The function then loops through each attribute in attrList.

  4. For each attribute, it queries its type. If the type is ‘double3’, it lists its sub-attributes.

  5. For each sub-attribute, it locks or unlocks it based on the input parameters.

  6. If the attribute type is not ‘double3’, it directly locks or unlocks the attribute.

  7. The loop continues until all attributes in attrList are processed.

  8. The function concludes without returning a value.

asNode.lockNode(self, lockedState=1, **shArgs)#

[shArgs : ls=lockedState]

Purpose:

:: Locks or unlocks the asNode, preventing or allowing modifications to its attributes and properties, commonly used in rigging and scene security.

Parameters:

lockedState – <int> #Determines the lock state (1 for locked, 0 for unlocked).

Returns:

<None> #No return value, the asNode is locked or unlocked as specified.

_images/lockNode.jpg
Flow Chart Description:

This flowchart illustrates the lockNode function:

  1. The process starts by checking if shArgs are provided and updates the locked state accordingly.

  2. It determines the desired lock state based on the lockedState parameter.

  3. The node is selected for processing.

  4. The function checks if it’s in query mode. If so, it queries the current lock state of the node.

  5. If not in query mode, it determines whether to lock or unlock the node.

  6. Depending on the state, it either locks or unlocks the node.

  7. The function concludes without returning a value.

asNode.longName(self, **shArgs)#

Purpose:

It is useful whenever world space calculations are made.

Returns:

MFnDagNode.fullPathName() #_ Complete path name from root to asNode

graph TB Start[("fa:fa-play Start")] --> InitializeDagNodeFn["/fas:fa-code-branch Initialize DagNode Function"] InitializeDagNodeFn --> CheckComponentNum{{"Check if _cNum Exists"}} CheckComponentNum --"If _cNum Exists"--> CheckComponentNumPositive{"Check if _cNum >= 0"} CheckComponentNum --"If _cNum Does Not Exist"--> ReturnFullDagPath["/fas:fa-arrow-right Return Full DagPath"] CheckComponentNumPositive --"If _cNum >= 0"--> ReturnFullPathWithComponent["/fas:fa-arrow-right Return Full Path With Component"] CheckComponentNumPositive --"If _cNum < 0"--> ReturnFullDagPath ReturnFullPathWithComponent --> End[("fas:fa-stop End")] ReturnFullDagPath --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style InitializeDagNodeFn fill:#ffcc00,stroke:#000,stroke-width:2px style CheckComponentNum fill:#ff9999,stroke:#000,stroke-width:2px style CheckComponentNumPositive fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFullPathWithComponent fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFullDagPath fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the longName function:

  1. The function starts by initializing the DagNode function.

  2. It checks if _cNum (component number) exists.

  3. If _cNum exists, it then checks if _cNum is greater than or equal to zero.

  4. If _cNum >= 0, the function returns the full DAG path with the component information.

  5. If _cNum < 0 or does not exist, the function returns only the full DAG path.

  6. The process concludes by returning the appropriate path name.

asNode.longestObj(self, objList, **shArgs)#

[shArgs : ol=objList]

Purpose:

:: Identifies the longest object or vertex in a given list, useful in scenarios where size comparison is required, such as in rigging or scene layout.

Parameters:

objList – <list> #A list of objects or vertices to evaluate.

Returns:

<asNode> #The longest object or vertex from the provided list.

_images/longestObj.jpg
Flow Chart Description:

This flowchart illustrates the longestObj function:

  1. The process begins by checking if shArgs are provided and updates the object list accordingly.

  2. It initializes a dictionary to track distances (distanceDict).

  3. The function loops through each object in the list.

  4. For each object, it calculates the distance from the reference object.

  5. The distances along with their corresponding objects are stored in distanceDict.

  6. After all objects are processed, the function identifies the longest distance.

  7. It returns the object corresponding to the longest distance as the longest object.

asNode.ls(self, *args, **kwargs)#

[shArgs : *args, **kwargs]

Purpose:

:: Lists asNodes based on specified parameters, a versatile function for querying nodes in the scene according to various criteria.

Args:

Additional positional arguments specifying listing criteria.

Kwargs:

Additional keyword arguments specifying detailed listing options.

Returns:

<list> #A list of asNodes that meet the specified criteria.

graph TB Start[("fa:fa-play Start")] --> CheckArguments{{"/fas:fa-question-circle Check *args and **kwargs"}} CheckArguments --"Use args and kwargs"--> PerformLs["/fas:fa-search-plus Perform mc.ls()"] PerformLs --"Retrieve nodes based on criteria"--> ConvertToAsNodeList["/fas:fa-exchange-alt Convert Retrieved Nodes to asNode List"] ConvertToAsNodeList --"Convert each node to asNode"--> ReturnAsNodeList[("fas:fa-list-ol Return asNode List")] ReturnAsNodeList --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArguments fill:#ffcc00,stroke:#000,stroke-width:2px style PerformLs fill:#ff9999,stroke:#000,stroke-width:2px style ConvertToAsNodeList fill:#99ccff,stroke:#000,stroke-width:2px style ReturnAsNodeList fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#99ff99,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the ls function:

  1. The function starts by checking the provided positional (*args) and keyword (**kwargs) arguments.

  2. It then performs the mc.ls() operation using the specified criteria from the arguments.

  3. The retrieved nodes are converted into a list of asNode objects.

  4. The function concludes by returning this list of asNode objects.

asNode.mConstrain(self, objList=None, conList='parent', extras=None, **kwargs)#

[shArgs : ol=objList, cl=conList, ex=extras, *kwargs]

Purpose:

:: Applies various types of constraints to objects in the objList based on specified parameters, widely used in rigging for controlling object movements and relations.

Parameters:
  • objList – <list, optional> #The list of objects to apply constraints to.

  • conList – <str/list> #The type(s) of constraints to apply (‘point’, ‘orient’, ‘parent’, etc.).

  • extras – <str, optional> #Additional operations like ‘mirror’, ‘copy’, or ‘move’.

Kwargs:

Additional keyword arguments for constraint options like weight, maintainOffset, remove, etc.

Returns:

<list> #A list of the created constraint nodes.

Examples:

  • mConstrain([‘object02’, ‘object03’], [‘orient’, ‘point’])

  • mConstrain(‘object02’, ‘orient’, mirror=’copy’)

Query Mode:

  • mConstrain(q=1, wal=1)

  • Additional *kwargs processing based on specific constraint options.

Args:

conList = ‘point’ | ‘orient’ | ‘parent’ | ‘scale’ | ‘geometry’ | ‘normal | ‘tangent’ | ‘aim’ | ‘poleVector’ | ‘pointOnPoly’ extras = None | ‘mirror’ | ‘copy’ | ‘move’ [objList should be provided] **kwargs :

weight(w=1), maintainOffset(mo=1), remove(rm=1), targetList(tl=1), weightAliasList(wal=1), name(n=’_PointCon’), e=1, q=1

**kwargs (Aim)

w=1, upVector=[0, 1, 0], mo=1, worldUpObject=’PosLoc’, worldUpType=”object”, aimVector=[0, 0, -1]

Examples:

asNode.mConstrain(‘object02’, ‘orient’) #_ If no kwargs, kwargs ={‘mo’=1, ‘w’:1}

# Result: [u’object02_OrientCon’]

asNode.mConstrain([‘object02’, ‘object03’], [‘orient’, ‘point’])

# Result: [u’object02_OrientCon’, u’object02_OrientCon’, u’object03_PointCon’, u’object03_PointCon’]

Query Mode:

asNode.mConstrain(q=1, wal=1) #asNode =’object03’

# Result: [u’object01W0’, u’object02W0’] #

asNode.mConstrain(q=1) #_ Return all constraints list

# Result: [‘object02_OrientCon’, ‘object02_PointCon’] #

graph TB Start[("fa:fa-play Start")] --> CheckKwargs{{"/fas:fa-question Check kwargs"}} CheckKwargs --"If kwargs is provided" --> ProcessKwargs["/fas:fa-cogs Process kwargs"] CheckKwargs --"If kwargs is not provided" --> SetDefaultKwargs["/fas:fa-sliders-h Set Default kwargs"] ProcessKwargs --> SetDefaultKwargs SetDefaultKwargs --> CheckQueryMode{{"/fas:fa-search-plus Check Query Mode"}} CheckQueryMode --"If Query Mode" --> ExecuteQueryMode["/fas:fa-database Execute Query Mode"] CheckQueryMode --"If Not Query Mode" --> ConvertLists{{"/fas:fa-list-ul Convert objList and conList to Lists"}} ExecuteQueryMode --> ReturnQueryResults[("fas:fa-arrow-circle-right Return Query Results")] ConvertLists --> ApplyConstraints{{"/fas:fa-link Apply Constraints"}} ApplyConstraints --> CheckEndResults{{"/fas:fa-tasks Check for Same End Results"}} CheckEndResults --"Validate End Results" --> CreateConNodes["/fas:fa-sitemap Create Constraint Nodes"] CreateConNodes --> ReturnConNodes[("fas:fa-arrow-circle-right Return Constraint Nodes")] ReturnConNodes --> End[("fas:fa-stop End")] ReturnQueryResults --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessKwargs fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultKwargs fill:#99ff99,stroke:#000,stroke-width:2px style CheckQueryMode fill:#cc99ff,stroke:#000,stroke-width:2px style ExecuteQueryMode fill:#99ccff,stroke:#000,stroke-width:2px style ConvertLists fill:#ffcc00,stroke:#000,stroke-width:2px style ApplyConstraints fill:#99ccff,stroke:#000,stroke-width:2px style CheckEndResults fill:#cc99ff,stroke:#000,stroke-width:2px style CreateConNodes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnConNodes fill:#00cc00,stroke:#000,stroke-width:2px style ReturnQueryResults fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mConstrain function:

  1. The function begins by checking if additional arguments (kwargs) are provided and processes these arguments accordingly.

  2. If kwargs are not provided, it sets default parameters for constraints.

  3. The function then checks if it’s in Query Mode based on the kwargs.

  4. If in Query Mode, it executes the query and returns the results.

  5. If not in Query Mode, it converts the objList and conList to lists for processing.

  6. It then applies the specified constraints to the objects in the objList.

  7. The function checks if the end results are valid and creates constraint nodes as needed.

  8. Finally, it returns the list of created constraint nodes.

asNode.mDistance_Vtx(self, src, dest, **shArgs)#

[shArgs : s=src, d=dest]

Purpose:

:: Calculates the distance between two vertices, often used in modeling and rigging to measure spatial relationships.

Parameters:
  • src – <asNode> #The source vertex to measure from.

  • dest – <asNode> #The destination vertex to measure to.

Returns:

<float> #The distance between the specified vertices.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"If shArgs provided"--> UpdateSrcDest["/fas:fa-cogs Update src and dest"] CheckShArgs --"If shArgs not provided"--> SetSrcDestDefault["/fas:fa-sliders-h Set src and dest to Default"] UpdateSrcDest --> GetSrcPosition["/fas:fa-map-marker-alt Get Source Position"] SetSrcDestDefault --> GetSrcPosition GetSrcPosition --> GetDestPosition["/fas:fa-map-marker-alt Get Destination Position"] GetDestPosition --> CalculateDistances{{"/fas:fa-ruler-combined Calculate Distance X, Y, Z"}} CalculateDistances --> ComputeMDistance["/fas:fa-calculator Compute mDistance"] ComputeMDistance --> ReturnMDistance[("fas:fa-arrow-circle-right Return mDistance")] ReturnMDistance --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSrcDest fill:#ff9999,stroke:#000,stroke-width:2px style SetSrcDestDefault fill:#99ccff,stroke:#000,stroke-width:2px style GetSrcPosition fill:#cc99ff,stroke:#000,stroke-width:2px style GetDestPosition fill:#99ff99,stroke:#000,stroke-width:2px style CalculateDistances fill:#99ccff,stroke:#000,stroke-width:2px style ComputeMDistance fill:#ff9999,stroke:#000,stroke-width:2px style ReturnMDistance fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mDistance_Vtx function:

  1. The process starts by checking if shArgs are provided and updates src and dest as necessary.

  2. It retrieves the world space positions of the source and destination vertices.

  3. The function then calculates the X, Y, and Z distance components between the source and destination.

  4. It computes the mathematical distance using the square root of the sum of squared distances in each dimension.

  5. Finally, the function returns the calculated distance between the two vertices.

asNode.makeNextSibling(self, trgt=None, pos=None, **shArgs)#

[shArgs : t=trgt, p=pos]

Purpose:

:: Sets the asNode as the next sibling to a target node in the hierarchy, often used in rigging and scene organization to rearrange node order.

Parameters:
  • trgt – <asNode, optional> #The target node to place the asNode next to in the hierarchy.

  • pos – <int, optional> #The position index where the asNode should be placed relative to the target node.

Returns:

<None> #No return value, the asNode is repositioned as the next sibling of the target node.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckTarget{{"/fas:fa-search-plus Check Target"}} ProcessShArgs --> CheckTarget CheckTarget --"If Target is provided" --> UseProvidedTarget["/fas:fa-user-check Use Provided Target"] CheckTarget --"If no Target" --> SelectNextSibling["/fas:fa-hand-pointer Select Next Sibling Manually"] UseProvidedTarget --> SetToNextSib["/fas:fa-arrow-right Set to Next Sibling"] SelectNextSibling --> SetToNextSib SetToNextSib --> CheckParentExistence{{"/fas:fa-home Check Parent Existence"}} CheckParentExistence --"If Parent Exists" --> ParentToSameParent["/fas:fa-sitemap Parent to Same Parent"] CheckParentExistence --"If No Parent" --> EndFunction[("fas:fa-check End Function")] ParentToSameParent --> SetSiblingIndex{{"/fas:fa-list-ol Set Sibling Index"}} SetSiblingIndex --> EndFunction style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckTarget fill:#99ccff,stroke:#000,stroke-width:2px style UseProvidedTarget fill:#99ff99,stroke:#000,stroke-width:2px style SelectNextSibling fill:#99ff99,stroke:#000,stroke-width:2px style SetToNextSib fill:#99ccff,stroke:#000,stroke-width:2px style CheckParentExistence fill:#cc99ff,stroke:#000,stroke-width:2px style ParentToSameParent fill:#99ff99,stroke:#000,stroke-width:2px style SetSiblingIndex fill:#99ccff,stroke:#000,stroke-width:2px style EndFunction fill:#00cc00,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the makeNextSibling function:

  1. The function starts by checking if additional arguments (shArgs) are provided.

  2. If shArgs are provided, it processes these arguments to determine the target (trgt) and position (pos).

  3. If no target is provided, it selects the next sibling manually.

  4. The function then sets the node to be the next sibling to the target.

  5. It checks if a parent exists for the current node. If so, it parents the target to the same parent as the current node.

  6. Finally, it sets the sibling index of the target node based on the provided position and concludes the function.

asNode.mirrorPos(self, trgtObj=None, srcPrefix='R_', destPrefix='L_', mirrorRot=True, mirrorAxis='x', **shArgs)#

[shArgs : to=trgtObj, sp=srcPrefix, dp=destPrefix, mr=mirrorRot, ma=mirrorAxis]

Purpose:

:: Mirrors the position of the asNode relative to a target object, used in rigging for creating symmetrical poses or structures. mirrorDir = ‘L2R’|’l2r’ or ‘R2L’ or ‘r2l’ or ‘invert’

Parameters:
  • trgtObj – <asNode, optional> #The target object for mirror reference.

  • srcPrefix – <str> #The prefix of the source side (e.g., ‘R_’).

  • destPrefix – <str> #The prefix of the destination side (e.g., ‘L_’).

  • mirrorRot – <bool> #Determines whether to also mirror the rotation.

  • mirrorAxis – <str> #The axis along which to mirror (‘x’, ‘y’, ‘z’). |br| mirrAxis = ‘x’|’X’ or ‘Y’|’y’ or ‘Z’|’z’

Returns:

<asNode> #The mirrored position vertex or object. |br| return oppVtx

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckTrgtObj{{"/fas:fa-search-plus Check Target Object"}} ProcessShArgs --> CheckTrgtObj CheckTrgtObj --"If Target Object Provided" --> UseProvidedTrgtObj["/fas:fa-user-check Use Provided Target Object"] CheckTrgtObj --"If No Target Object" --> DetermineOppNode["/fas:fa-exchange-alt Determine Opposite Node"] UseProvidedTrgtObj --> GetOppPos["/fas:fa-map-marker-alt Get Opposite Position"] DetermineOppNode --> GetOppPos GetOppPos --> SetMirroredPos["/fas:fa-arrows-alt-h Set Mirrored Position"] SetMirroredPos --> CheckMirrorRot{{"/fas:fa-sync-alt Check Mirror Rotation"}} CheckMirrorRot --"If Mirror Rotation" --> GetSetMirroredRot["/fas:fa-redo-alt Get & Set Mirrored Rotation"] CheckMirrorRot --"If No Mirror Rotation" --> ReturnAsNode[("fas:fa-arrow-circle-right Return asNode")] GetSetMirroredRot --> ReturnAsNode ReturnAsNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckTrgtObj fill:#99ccff,stroke:#000,stroke-width:2px style UseProvidedTrgtObj fill:#99ff99,stroke:#000,stroke-width:2px style DetermineOppNode fill:#99ff99,stroke:#000,stroke-width:2px style GetOppPos fill:#99ccff,stroke:#000,stroke-width:2px style SetMirroredPos fill:#99ff99,stroke:#000,stroke-width:2px style CheckMirrorRot fill:#cc99ff,stroke:#000,stroke-width:2px style GetSetMirroredRot fill:#99ccff,stroke:#000,stroke-width:2px style ReturnAsNode fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mirrorPos function:

  1. The process starts by checking if shArgs are provided and updates the parameters accordingly.

  2. It checks whether a target object is provided. If not, it determines the opposite node based on source and destination prefixes.

  3. The function then gets the opposite position and sets the mirrored position of the asNode.

  4. If mirror rotation is enabled, it also gets and sets the mirrored rotation.

  5. Finally, the function returns the asNode with its position and rotation mirrored.

asNode.mirrorSelectVtx(self, mirrorDir='L2R', dirAxis='x', precision=1, excludeVtxNums=[], LPrefix=None, RPrefix=None, **shArgs)#

[shArgs : md=mirrorDir, da=dirAxis, p=precision, evn=excludeVtxNums, lp=LPrefix, rp=RPrefix]

Purpose:

:: Selects the mirror vertex corresponding to the selected vertex, used in modeling and rigging for symmetrical edits.

Parameters:
  • mirrorDir – <str> #The direction of mirror operation (‘L2R’, ‘R2L’, etc.). mirrorDir = ‘L2R’|’l2r’ or ‘R2L’ or ‘r2l’ or ‘invert’

  • dirAxis – <str> #The axis along which the mirroring occurs. dirAxis = ‘x’|’X’ or ‘Y’|’y’ or ‘Z’|’z’

  • precision – <int> #The precision level for vertex matching.

  • excludeVtxNums – <list> #List of vertex numbers to exclude from mirroring.

  • LPrefix – <str, optional> #The prefix for the left side, if applicable.

  • RPrefix – <str, optional> #The prefix for the right side, if applicable.

Returns:

<asNode> #The mirrored vertex.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question-circle Check shArgs"}} CheckShArgs --"If shArgs provided"--> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs not provided"--> SetDefaults["/fas:fa-sliders-h Set Default Values"] ProcessShArgs --> SetDefaults SetDefaults --> CheckPrefixes{{"/fas:fa-text-width Check LPrefix and RPrefix"}} CheckPrefixes --"If Prefixes Provided"--> UsePrefixes["/fas:fa-arrows-alt-h Use LPrefix and RPrefix"] CheckPrefixes --"If No Prefixes"--> UseMeshAsIs["/fas:fa-cube Use Current Mesh"] UsePrefixes --> DetermineOppVtx["/fas:fa-exchange-alt Determine Opposite Vertex"] UseMeshAsIs --> DetermineOppVtx DetermineOppVtx --> SetLocator["/fas:fa-map-marker-alt Set Locator at Vertex"] SetLocator --> FindNearestVtx["/fas:fa-search-plus Find Nearest Vertex"] FindNearestVtx --> CheckMirrorDir{{"/fas:fa-sync-alt Check Mirror Direction"}} CheckMirrorDir --"If 'L2R' or 'R2L'"--> SelectOppositeVtx["/fas:fa-check-circle Select Opposite Vertex"] CheckMirrorDir --"If 'Invert'"--> SelectInvertedVtx["/fas:fa-undo-alt Select Inverted Vertex"] SelectOppositeVtx --> ReturnOppVtx[("fas:fa-arrow-circle-right Return Opposite Vertex")] SelectInvertedVtx --> ReturnOppVtx ReturnOppVtx --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaults fill:#99ff99,stroke:#000,stroke-width:2px style CheckPrefixes fill:#cc99ff,stroke:#000,stroke-width:2px style UsePrefixes fill:#99ccff,stroke:#000,stroke-width:2px style UseMeshAsIs fill:#99ff99,stroke:#000,stroke-width:2px style DetermineOppVtx fill:#99ccff,stroke:#000,stroke-width:2px style SetLocator fill:#cc99ff,stroke:#000,stroke-width:2px style FindNearestVtx fill:#99ff99,stroke:#000,stroke-width:2px style CheckMirrorDir fill:#cc99ff,stroke:#000,stroke-width:2px style SelectOppositeVtx fill:#99ccff,stroke:#000,stroke-width:2px style SelectInvertedVtx fill:#99ff99,stroke:#000,stroke-width:2px style ReturnOppVtx fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mirrorSelectVtx function:

  1. The process begins by checking and processing any provided short arguments (shArgs).

  2. If specific prefixes (LPrefix and RPrefix) are provided, they are used to determine the opposite mesh; otherwise, the current mesh is used.

  3. A locator is set at the vertex’s position, and the nearest opposite vertex is identified based on the mirror direction and axis.

  4. The function then selects the appropriate opposite or inverted vertex.

  5. Finally, the mirrored vertex is returned.

asNode.mirrorSelectVtx_Adv(self, mirrorDir='L2R', dirAxis='x', precision=1, excludeVtxNums=[], LPrefix=None, RPrefix=None, **shArgs)#

[shArgs : md=mirrorDir, da=dirAxis, p=precision, evn=excludeVtxNums, lp=LPrefix, rp=RPrefix]

Purpose:

:: An advanced version of vertex mirroring, allowing for more complex and precise symmetrical selections in modeling and rigging.

Parameters:
  • mirrorDir – <str> #The direction of mirror operation (‘L2R’, ‘R2L’, etc.).

  • dirAxis – <str> #The axis along which the mirroring occurs.

  • precision – <int> #The precision level for vertex matching.

  • excludeVtxNums – <list> #List of vertex numbers to exclude from mirroring.

  • LPrefix – <str, optional> #The prefix for the left side, if applicable.

  • RPrefix – <str, optional> #The prefix for the right side, if applicable.

Returns:

<asNode> #The advanced mirrored vertex.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckPrefixes{{"/fas:fa-code-branch Check Prefixes"}} ProcessShArgs --> CheckPrefixes CheckPrefixes --"If LPrefix and RPrefix" --> MirrorWithPrefixes["/fas:fa-exchange-alt Mirror With Prefixes"] CheckPrefixes --"If no Prefixes" --> CheckExcludeVtxNums{{"/fas:fa-minus-circle Check Exclude Vertex Numbers"}} MirrorWithPrefixes --> SelectMirrorVertex["/fas:fa-dot-circle Select Mirror Vertex"] CheckExcludeVtxNums --"If excludeVtxNums" --> MirrorWithExclusions["/fas:fa-filter Mirror With Exclusions"] CheckExcludeVtxNums --"If no excludeVtxNums" --> SetReflectionMode["/fas:fa-mirror Set Reflection Mode"] MirrorWithExclusions --> SelectMirrorVertex SetReflectionMode --> RefreshView["/fas:fa-sync-alt Refresh View"] RefreshView --> DetermineMirroredList{{"/fas:fa-list-ol Determine Mirrored List"}} DetermineMirroredList --> SelectMirroredVertices["/fas:fa-hand-pointer Select Mirrored Vertices"] SelectMirroredVertices --> ConvertToAsNodeFormat["/fas:fa-exchange-alt Convert to asNode Format"] ConvertToAsNodeFormat --> ReturnFirstMirroredVertex[("fas:fa-arrow-circle-right Return First Mirrored Vertex")] ReturnFirstMirroredVertex --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckPrefixes fill:#99ccff,stroke:#000,stroke-width:2px style MirrorWithPrefixes fill:#99ff99,stroke:#000,stroke-width:2px style CheckExcludeVtxNums fill:#cc99ff,stroke:#000,stroke-width:2px style MirrorWithExclusions fill:#99ff99,stroke:#000,stroke-width:2px style SetReflectionMode fill:#99ccff,stroke:#000,stroke-width:2px style RefreshView fill:#99ff99,stroke:#000,stroke-width:2px style DetermineMirroredList fill:#cc99ff,stroke:#000,stroke-width:2px style SelectMirroredVertices fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToAsNodeFormat fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFirstMirroredVertex fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mirrorSelectVtx_Adv function:

  1. The process starts by checking for any provided short arguments (shArgs).

  2. If LPrefix and RPrefix are provided, the function mirrors vertices with these prefixes; otherwise, it checks for vertex numbers to exclude.

  3. The function then mirrors the vertex using the specified direction, axis, and precision, considering any exclusions.

  4. If no exclusions or prefixes are provided, it uses reflection mode for mirroring.

  5. The view is refreshed to update the mirrored selection.

  6. The mirrored list of vertices is determined, and the mirrored vertices are selected.

  7. The selected mirrored vertices are converted into the asNode format.

  8. Finally, the first mirrored vertex is returned, completing the process.

asNode.moveAnimTo(self, dest, attr='r', remove=True, **shArgs)#

[shArgs : d=dest, a=attr, r=remove]

Purpose:

:: Transfers animation data from the asNode to a specified destination node, commonly used in animation workflows for re-targeting motion.

Parameters:
  • dest – <asNode> #The destination node to transfer animation to.

  • attr – <str> #The attribute to transfer animation for.

  • remove – <bool> #Determines whether to remove the animation from the source after transferring.

Returns:

<None> #No return value, animation data is moved or copied to the destination.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> UpdateDest["/fas:fa-exchange-alt Update dest"] CheckShArgs --"If shArgs is not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] UpdateDest --> UpdateAttr["/fas:fa-pencil-alt Update attr"] UpdateAttr --> UpdateRemove["/fas:fa-trash-alt Update remove"] UpdateRemove --> SetNcTypes SetNcTypes --> TransferAnim["/fas:fa-arrows-alt Transfer Animation"] TransferAnim --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateDest fill:#ff9999,stroke:#000,stroke-width:2px style UpdateAttr fill:#99ccff,stroke:#000,stroke-width:2px style UpdateRemove fill:#cc99ff,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ff99,stroke:#000,stroke-width:2px style TransferAnim fill:#ffcc99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the moveAnimTo function:

  1. The process starts by checking if short arguments (shArgs) are provided.

  2. If provided, the destination (dest), attribute (attr), and remove flag are updated accordingly.

  3. If no shArgs are provided, the node component types (ncTypes) are set.

  4. The function then proceeds to transfer the animation from the asNode to the destination node.

  5. The specified attribute’s animation is transferred, and if the remove flag is True, the animation is removed from the asNode after transfer.

  6. The process ends once the animation transfer is complete.

asNode.moveAnimToGrp(self, attr='r', **shArgs)#

[shArgs : a=attr]

Purpose:

:: Moves animation data from the asNode to a group node, often used in rigging to reorganize animation layers and controllers.

Parameters:

attr – <str> #The attribute to move animation for.

Returns:

<None> #No return value, animation data is moved to a group node.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateAttr["/fas:fa-pencil-alt Update attr"] CheckShArgs --"If shArgs not provided" --> CheckSelection{{"/fas:fa-hand-pointer Check Selection"}} UpdateAttr --> CheckSelection CheckSelection --"If no ctrlList provided" --> ErrorNoSelection["/fas:fa-exclamation-triangle Error: No Selection Provided"] CheckSelection --"If ctrlList provided" --> ConvertAttrList["/fas:fa-list-ol Convert Attr List"] ConvertAttrList --> TransferAnimEachAttr{{"/fas:fa-repeat Transfer Animation for Each Attribute"}} TransferAnimEachAttr --"For each attribute in attrList" --> SelectCtrl["/fas:fa-hand-pointer Select Ctrl"] SelectCtrl --> RefreshView["/fas:fa-sync-alt Refresh View"] RefreshView --> PickWalkUp["/fas:fa-arrow-up Pick Walk Up"] PickWalkUp --> TransferAnimToCtrlGrp["/fas:fa-arrows-alt Transfer Animation to Ctrl Group"] TransferAnimToCtrlGrp --> EndLoop[("fas:fa-repeat End Loop")] EndLoop --"End of loop" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAttr fill:#ff9999,stroke:#000,stroke-width:2px style CheckSelection fill:#99ccff,stroke:#000,stroke-width:2px style ErrorNoSelection fill:#ff6666,stroke:#000,stroke-width:2px style ConvertAttrList fill:#99ff99,stroke:#000,stroke-width:2px style TransferAnimEachAttr fill:#cc99ff,stroke:#000,stroke-width:2px style SelectCtrl fill:#ffcc99,stroke:#000,stroke-width:2px style RefreshView fill:#99ccff,stroke:#000,stroke-width:2px style PickWalkUp fill:#99ff99,stroke:#000,stroke-width:2px style TransferAnimToCtrlGrp fill:#99ccff,stroke:#000,stroke-width:2px style EndLoop fill:#ffcc99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the moveAnimToGrp function:

  1. The process begins by checking if short arguments (shArgs) are provided.

  2. If provided, the attribute to be moved (attr) is updated.

  3. Next, the function checks if a control list (ctrlList) is provided.

  4. If no ctrlList is provided, an error is raised due to the lack of selection.

  5. If a ctrlList is present, the function converts the attribute list for processing.

  6. The animation data for each attribute in the attrList is transferred.

  7. For each control in the ctrlList, the function selects the control, refreshes the view, and picks the walk-up group node.

  8. The animation data is then transferred from the control to the control group node.

  9. This process repeats for each attribute in the attrList.

  10. The function ends once all attributes have been processed.

asNode.movePoseToGrp(self, attrList=['r'], grpLevel=1, unlockAttrs=True, **shArgs)#

[shArgs : al=attrList, gl=grpLevel, ua=unlockAttrs]

Purpose:

:: Transfers pose data from the asNode to a group node, facilitating the reorganization of pose information in rigging and animation.

Parameters:
  • attrList – <list> #The list of attributes to transfer pose data for.

  • grpLevel – <int> #The group level to transfer pose data to.

  • unlockAttrs – <bool> #Determines whether to unlock attributes before transferring.

Returns:

<None> #No return value, pose data is moved to the specified group node.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateAttrList["/fas:fa-pencil-alt Update attrList"] CheckShArgs --"If shArgs not provided" --> CheckGroupLevel{{"/fas:fa-layer-group Check Group Level"}} UpdateAttrList --> CheckGroupLevel CheckGroupLevel --"Determine grpLevel" --> DetermineGroupNode["/fas:fa-code-branch Determine Group Node"] DetermineGroupNode --> CreatePoseLocator["/fas:fa-location-arrow Create Pose Locator"] CreatePoseLocator --> TransferPoseForEachAttr{{"/fas:fa-repeat Transfer Pose for Each Attribute"}} TransferPoseForEachAttr --"For each attribute in attrList" --> CheckAttributeType{{"/fas:fa-tags Check Attribute Type"}} CheckAttributeType --"If 't'" --> HandleTranslation["/fas:fa-arrows-alt Handle Translation"] CheckAttributeType --"If 'r'" --> HandleRotation["/fas:fa-sync-alt Handle Rotation"] HandleTranslation --> CheckLockStateT{{"/fas:fa-lock Check Lock State 't'"}} HandleRotation --> CheckLockStateR{{"/fas:fa-lock Check Lock State 'r'"}} CheckLockStateT --"Unlock 't' if needed" --> ResetTranslation["/fas:fa-undo Reset Translation"] CheckLockStateR --"Unlock 'r' if needed" --> ResetRotation["/fas:fa-undo-alt Reset Rotation"] ResetTranslation --> TransferTranslationToGrp["/fas:fa-exchange-alt Transfer Translation to Grp"] ResetRotation --> TransferRotationToGrp["/fas:fa-exchange-alt Transfer Rotation to Grp"] TransferTranslationToGrp --> ReLockTIfNecessary{{"/fas:fa-lock Re-Lock 't' If Necessary"}} TransferRotationToGrp --> ReLockRIfNecessary{{"/fas:fa-lock Re-Lock 'r' If Necessary"}} ReLockTIfNecessary --> EndLoop[("fas:fa-repeat End Loop")] ReLockRIfNecessary --> EndLoop EndLoop --"End of loop" --> DeletePoseLocator["/fas:fa-trash-alt Delete Pose Locator"] DeletePoseLocator --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAttrList fill:#ff9999,stroke:#000,stroke-width:2px style CheckGroupLevel fill:#99ccff,stroke:#000,stroke-width:2px style DetermineGroupNode fill:#cc99ff,stroke:#000,stroke-width:2px style CreatePoseLocator fill:#99ff99,stroke:#000,stroke-width:2px style TransferPoseForEachAttr fill:#ffcc99,stroke:#000,stroke-width:2px style CheckAttributeType fill:#ccffcc,stroke:#000,stroke-width:2px style HandleTranslation fill:#ffcc99,stroke:#000,stroke-width:2px style HandleRotation fill:#ccffcc,stroke:#000,stroke-width:2px style CheckLockStateT fill:#ff9999,stroke:#000,stroke-width:2px style CheckLockStateR fill:#99ccff,stroke:#000,stroke-width:2px style ResetTranslation fill:#99ff99,stroke:#000,stroke-width:2px style ResetRotation fill:#99ccff,stroke:#000,stroke-width:2px style TransferTranslationToGrp fill:#cc99ff,stroke:#000,stroke-width:2px style TransferRotationToGrp fill:#99ff99,stroke:#000,stroke-width:2px style ReLockTIfNecessary fill:#99ccff,stroke:#000,stroke-width:2px style ReLockRIfNecessary fill:#99ff99,stroke:#000,stroke-width:2px style EndLoop fill:#ffcc99,stroke:#000,stroke-width:2px style DeletePoseLocator fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the movePoseToGrp function:

  1. The process starts with checking if short arguments (shArgs) are provided.

  2. It then updates the list of attributes (attrList) if provided.

  3. The function determines the group level (grpLevel) to which the pose data will be moved.

  4. A pose locator is created to facilitate pose transfer.

  5. For each attribute in attrList, the function checks if it is a translation (‘t’) or rotation (‘r’) attribute.

  6. The translation or rotation data is handled accordingly.

  7. If the attribute is locked, it is unlocked for transferring.

  8. The translation or rotation data is then transferred to the group node.

  9. The attribute is relocked if it was initially locked.

  10. This process is repeated for each attribute in the attrList.

  11. After processing all attributes, the pose locator is deleted.

  12. The function ends once all operations are completed.

asNode.moveValuesFromGrps(self, srcList, attrList=['r'], grpLevel=2, **shArgs)#

[shArgs : sl=srcList, al=attrList, gl=grpLevel]

Purpose:

:: Transfers attribute values from source groups to the asNode, used in rigging to consolidate attribute changes from multiple nodes.

Parameters:
  • srcList – <list> #The list of source groups to transfer values from.

  • attrList – <list> #The list of attributes to transfer values for.

  • grpLevel – <int> #The group level to transfer values from.

Returns:

<None> #No return value, attribute values are transferred from the source groups to the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateSrcList["/fas:fa-edit Update srcList"] CheckShArgs --"If shArgs not provided" --> UpdateAttrList["/fas:fa-pencil-alt Update attrList"] UpdateSrcList --> UpdateAttrList UpdateAttrList --> UpdateGroupLevel["/fas:fa-layer-group Update grpLevel"] UpdateGroupLevel --> LoopThroughSrcList{{"/fas:fa-repeat Loop Through SrcList"}} LoopThroughSrcList --"For each src in srcList" --> LoopThroughAttrList{{"/fas:fa-sync-alt Loop Through AttrList"}} LoopThroughAttrList --"For each attr in attrList" --> CheckAttrType{{"/fas:fa-tags Check Attr Type"}} CheckAttrType --"If 't'" --> HandleTranslation["/fas:fa-arrows-alt Handle Translation"] CheckAttrType --"If 'r'" --> HandleRotation["/fas:fa-sync-alt Handle Rotation"] HandleTranslation --> CreatePosLocator["/fas:fa-location-arrow Create Position Locator"] HandleRotation --> CreateRotLocator["/fas:fa-location-arrow Create Rotation Locator"] CreatePosLocator --> ParentPosLocator["/fas:fa-link Parent Position Locator"] CreateRotLocator --> ParentRotLocator["/fas:fa-link Parent Rotation Locator"] ParentPosLocator --> RetrieveBaseValT["/fas:fa-search-plus Retrieve Base Value 't'"] ParentRotLocator --> RetrieveBaseValR["/fas:fa-search-plus Retrieve Base Value 'r'"] RetrieveBaseValT --> ResetGroupTranslate["/fas:fa-undo-alt Reset Group Translate"] RetrieveBaseValR --> ResetGroupRotate["/fas:fa-undo-alt Reset Group Rotate"] ResetGroupTranslate --> ApplyTranslationToSrc["/fas:fa-exchange-alt Apply Translation to Src"] ResetGroupRotate --> ApplyRotationToSrc["/fas:fa-exchange-alt Apply Rotation to Src"] ApplyTranslationToSrc --> DeletePosLocator["/fas:fa-trash-alt Delete Position Locator"] ApplyRotationToSrc --> DeleteRotLocator["/fas:fa-trash-alt Delete Rotation Locator"] DeletePosLocator --> EndLoopAttrList[("fas:fa-repeat End Loop AttrList")] DeleteRotLocator --> EndLoopAttrList EndLoopAttrList --"End of Loop" --> EndLoopSrcList[("fas:fa-repeat End Loop SrcList")] EndLoopSrcList --"End of Loop" --> SelectSrcList["/fas:fa-hand-pointer Select SrcList"] SelectSrcList --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSrcList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateAttrList fill:#99ccff,stroke:#000,stroke-width:2px style UpdateGroupLevel fill:#cc99ff,stroke:#000,stroke-width:2px style LoopThroughSrcList fill:#99ff99,stroke:#000,stroke-width:2px style LoopThroughAttrList fill:#ffcc99,stroke:#000,stroke-width:2px style CheckAttrType fill:#ccffcc,stroke:#000,stroke-width:2px style HandleTranslation fill:#ffcc99,stroke:#000,stroke-width:2px style HandleRotation fill:#ccffcc,stroke:#000,stroke-width:2px style CreatePosLocator fill:#ff9999,stroke:#000,stroke-width:2px style CreateRotLocator fill:#99ccff,stroke:#000,stroke-width:2px style ParentPosLocator fill:#99ff99,stroke:#000,stroke-width:2px style ParentRotLocator fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveBaseValT fill:#cc99ff,stroke:#000,stroke-width:2px style RetrieveBaseValR fill:#99ff99,stroke:#000,stroke-width:2px style ResetGroupTranslate fill:#99ccff,stroke:#000,stroke-width:2px style ResetGroupRotate fill:#99ff99,stroke:#000,stroke-width:2px style ApplyTranslationToSrc fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyRotationToSrc fill:#99ff99,stroke:#000,stroke-width:2px style DeletePosLocator fill:#99ccff,stroke:#000,stroke-width:2px style DeleteRotLocator fill:#99ff99,stroke:#000,stroke-width:2px style EndLoopAttrList fill:#ffcc99,stroke:#000,stroke-width:2px style EndLoopSrcList fill:#ff9999,stroke:#000,stroke-width:2px style SelectSrcList fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the moveValuesFromGrps function:

  1. The function starts by checking and updating the source list (srcList), attribute list (attrList), and group level (grpLevel).

  2. It then loops through each source in srcList and each attribute in attrList.

  3. Based on the attribute type (‘t’ for translation, ‘r’ for rotation), the function handles each attribute.

  4. For translation, it creates a position locator, parents it to the top group, and retrieves base translation values.

  5. For rotation, it creates a rotation locator, parents it to the top group, and retrieves base rotation values.

  6. The function resets group translations and rotations to zero and applies the base values to the source object.

  7. Position and rotation locators are deleted after use.

  8. This process is repeated for each attribute in attrList and each source in srcList.

  9. Finally, the source list is reselected, concluding the function.

asNode.moveValuesToGrp(self, attrList=['r'], grpLevel=1, **shArgs)#

[shArgs : al=attrList, gl=grpLevel]

Purpose:

:: Moves attribute values from the asNode to a specified group node. This function is typically used in rigging to streamline attribute management and organization.

Parameters:
  • attrList – <list> #The list of attributes for which the values are to be moved.

  • grpLevel – <int> #The group level to which the values are to be moved.

Returns:

<None> #No return value. The attribute values are moved to the specified group node.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateAttrList["/fas:fa-pencil-alt Update attrList"] CheckShArgs --"If shArgs not provided" --> UpdateGroupLevel["/fas:fa-layer-group Update grpLevel"] UpdateAttrList --> UpdateGroupLevel UpdateGroupLevel --> LoopThroughAttrList{{"/fas:fa-sync-alt Loop Through AttrList"}} LoopThroughAttrList --"For each attr in attrList" --> CheckAttrType{{"/fas:fa-tags Check Attr Type"}} CheckAttrType --"If 't'" --> HandleTranslation["/fas:fa-arrows-alt Handle Translation"] CheckAttrType --"If 'r'" --> HandleRotation["/fas:fa-sync-alt Handle Rotation"] HandleTranslation --> SelectNode["/fas:fa-hand-pointer Select Node"] HandleRotation --> SelectNode SelectNode --> LoopThroughGrpLevels{{"/fas:fa-repeat Loop Through GrpLevels"}} LoopThroughGrpLevels --"For each group level" --> PickWalkUpToGrp{{"/fas:fa-arrow-up Pick Walk Up To Group"}} PickWalkUpToGrp --> RetrieveBaseValT["/fas:fa-search-plus Retrieve Base Value 't'"] RetrieveBaseValT --> UpdateGrpTranslateVal["/fas:fa-exchange-alt Update Group Translate Value"] PickWalkUpToGrp --> RetrieveBaseValR["/fas:fa-search-plus Retrieve Base Value 'r'"] RetrieveBaseValR --> UpdateGrpRotateVal["/fas:fa-exchange-alt Update Group Rotate Value"] UpdateGrpTranslateVal --> ResetNodeTranslate["/fas:fa-undo-alt Reset Node Translate"] UpdateGrpRotateVal --> ResetNodeRotate["/fas:fa-undo-alt Reset Node Rotate"] ResetNodeTranslate --> EndLoopAttrList[("fas:fa-repeat End Loop AttrList")] ResetNodeRotate --> EndLoopAttrList EndLoopAttrList --"End of Loop" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAttrList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateGroupLevel fill:#99ccff,stroke:#000,stroke-width:2px style LoopThroughAttrList fill:#99ff99,stroke:#000,stroke-width:2px style CheckAttrType fill:#ffcc99,stroke:#000,stroke-width:2px style HandleTranslation fill:#ccffcc,stroke:#000,stroke-width:2px style HandleRotation fill:#ffcc99,stroke:#000,stroke-width:2px style SelectNode fill:#99ccff,stroke:#000,stroke-width:2px style LoopThroughGrpLevels fill:#99ff99,stroke:#000,stroke-width:2px style PickWalkUpToGrp fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveBaseValT fill:#cc99ff,stroke:#000,stroke-width:2px style RetrieveBaseValR fill:#99ff99,stroke:#000,stroke-width:2px style UpdateGrpTranslateVal fill:#99ccff,stroke:#000,stroke-width:2px style UpdateGrpRotateVal fill:#99ff99,stroke:#000,stroke-width:2px style ResetNodeTranslate fill:#cc99ff,stroke:#000,stroke-width:2px style ResetNodeRotate fill:#99ff99,stroke:#000,stroke-width:2px style EndLoopAttrList fill:#ffcc99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the moveValuesToGrp function:

  1. The process starts by checking if shArgs are provided and updates attrList and grpLevel accordingly.

  2. It loops through each attribute in attrList.

  3. Depending on the attribute type, it handles translation (‘t’) or rotation (‘r’).

  4. The function selects the asNode and loops through the group levels specified in grpLevel.

  5. It retrieves the base value of the attribute

asNode.name(self)#

[shArgs]

Purpose:

:: Retrieves the name of the asNode. If the name is unique, it returns the same as asNode.shortName().

Returns:

<str> #The name of the asNode, equivalent to its short name if unique.

graph TB Start[("fa:fa-play Start")] --> CheckDgNode{{"/fas:fa-question-circle Check if _dgNode exists"}} CheckDgNode --"If _dgNode exists" --> RetrieveNameDgNode["/fas:fa-tag Retrieve Name from _MFnDependencyNode"] CheckDgNode --"If _dgNode does not exist" --> RetrieveNameDgPath["/fas:fa-tag Retrieve Name from _MDagPath"] RetrieveNameDgNode --> CheckComponentNum{{"/fas:fa-code-branch Check if _cNum is specified"}} RetrieveNameDgPath --> CheckComponentNum CheckComponentNum --"If _cNum is specified" --> AppendComponentDetails["/fas:fa-plus Append Component Details to Name"] CheckComponentNum --"If _cNum is not specified" --> AppendUVorPtDetails["/fas:fa-plus Append UV or PT Details if present"] AppendComponentDetails --> ReturnName[("fas:fa-arrow-circle-right Return Node Name")] AppendUVorPtDetails --> ReturnName ReturnName --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckDgNode fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveNameDgNode fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveNameDgPath fill:#99ccff,stroke:#000,stroke-width:2px style CheckComponentNum fill:#ff9999,stroke:#000,stroke-width:2px style AppendComponentDetails fill:#99ff99,stroke:#000,stroke-width:2px style AppendUVorPtDetails fill:#99ff99,stroke:#000,stroke-width:2px style ReturnName fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the name function:

  1. The function begins by checking if _dgNode exists.

  2. If it exists, the name is retrieved from the _MFnDependencyNode.

  3. If _dgNode does not exist, the name is obtained from the _MDagPath.

  4. The function then checks if _cNum is specified.

  5. If _cNum is specified, it appends component details to the name.

  6. If _cNum is not specified but _cType is ‘uv’ or ‘pt’, the corresponding details are appended.

  7. The final node name is returned.

asNode.nearestObj(self, objListOrIter, nearCount=1, excludeList=None, **shArgs)#

[shArgs : oli=objListOrIter, nc=nearCount, el=excludeList]

Purpose:

:: Identifies the nearest object or vertex to the asNode from a given list or iterable. This function is commonly used in modeling and scene layout for proximity-based selections.

Parameters:
  • objListOrIter – <list/iterable> #A list or iterable of objects or positions to compare distances.

  • nearCount – <int, optional> #The number of nearest objects or vertices to identify.

  • excludeList – <list, optional> #A list of objects or vertices to exclude from the comparison.

Returns:

<asNode/list> #The nearest object(s) or vertex(vertices) to the asNode.

Args:#

objListOrIter = nodeList[list] | nodeIter(iter) | posList[listOfLists] nearCount = WIP

Returns:#

[asNode(closestObj)] #_ If its object [x, y, z] #_ If its objPos

Performance:#

List is faster than iterator by 1 min for 5411 vertices ‘’’ #_ Alternate Method: #——————- ‘’’ self._startTime() distanceDict ={} for destObj in objListOrIter:

dist =self.distanceTo(destObj)[0] try:

if dist < distanceDict[‘nearObj’][0]:

distanceDict[‘nearObj’] =[dist, destObj]

except:

distanceDict[‘nearObj’] =[dist, destObj]

print self._computeTime(1) return asNode(distanceDict[‘nearObj’][1])

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> UpdateObjListIter["/fas:fa-list-ol Update objListOrIter"] UpdateObjListIter --> UpdateNearCount["/fas:fa-sort-numeric-up Update nearCount"] UpdateNearCount --> UpdateExcludeList["/fas:fa-filter Update excludeList"] UpdateExcludeList --> SetDistanceDict["/fas:fa-map-marker-alt Set Distance Dictionary"] SetDistanceDict --> LoopObjList{{"/fas:fa-repeat Loop through objList"}} LoopObjList --"For each obj in objList"--> CalculateDistance["/fas:fa-ruler Calculate Distance"] CalculateDistance --"Store distance and obj"--> UpdateDistanceDict["/fas:fa-pencil-alt Update Distance Dictionary"] UpdateDistanceDict --> CheckNearCount{{"/fas:fa-sort-numeric-up-alt Check Near Count"}} CheckNearCount --"If nearCount <= 1"--> DetermineShortestDistance["/fas:fa-compress-arrows-alt Determine Shortest Distance"] CheckNearCount --"If nearCount > 1"--> SortDistanceDict["/fas:fa-sort-alpha-down Sort Distance Dictionary"] DetermineShortestDistance --> CheckPosList{{"/fas:fa-code-branch Check if Pos List"}} SortDistanceDict --> ConvertShortListToNodes["/fas:fa-exchange-alt Convert Short List to Nodes"] CheckPosList --"If Pos List"--> ReturnNearestPos[("fas:fa-arrow-circle-right Return Nearest Position")] CheckPosList --"If not Pos List"--> ReturnNearestNode[("fas:fa-arrow-circle-right Return Nearest Node")] ConvertShortListToNodes --> ReturnTopNearestNodes[("fas:fa-arrow-circle-right Return Top Nearest Nodes")] ReturnNearestPos --> End[("fas:fa-stop End")] ReturnNearestNode --> End ReturnTopNearestNodes --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObjListIter fill:#99ccff,stroke:#000,stroke-width:2px style UpdateNearCount fill:#ff9999,stroke:#000,stroke-width:2px style UpdateExcludeList fill:#cc99ff,stroke:#000,stroke-width:2px style SetDistanceDict fill:#99ff99,stroke:#000,stroke-width:2px style LoopObjList fill:#ffcc99,stroke:#000,stroke-width:2px style CalculateDistance fill:#ccffcc,stroke:#000,stroke-width:2px style UpdateDistanceDict fill:#ff9999,stroke:#000,stroke-width:2px style CheckNearCount fill:#99ccff,stroke:#000,stroke-width:2px style DetermineShortestDistance fill:#cc99ff,stroke:#000,stroke-width:2px style SortDistanceDict fill:#99ff99,stroke:#000,stroke-width:2px style CheckPosList fill:#99ccff,stroke:#000,stroke-width:2px style ConvertShortListToNodes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNearestPos fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNearestNode fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTopNearestNodes fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the nearestObj function:

  1. The function starts by processing any provided shArgs.

  2. The objListOrIter is updated based on the arguments, followed by updates to nearCount and excludeList.

  3. A dictionary is set up to store distances and corresponding objects.

  4. The function then loops through the object list, calculating distances from the asNode to each object.

  5. Distances and objects are stored in the dictionary, which is then checked against the nearCount.

  6. If nearCount is 1 or less, the function determines the shortest distance.

  7. If nearCount is more than 1, the function sorts the dictionary and converts the list of closest objects to nodes.

  8. Based on whether the input was a position list or not, the function returns either the nearest position or node(s).

  9. The function ends by returning either the nearest position, node, or top nearest nodes.

asNode.nearestPointOn(self, curvName, trgtType='crv', getLoc=True, attachToPath=False, **shArgs)#

[shArgs : cn=curvName, tt=trgtType, gl=getLoc, atp=attachToPath]

Purpose:

:: Determines the nearest point on a curve or surface relative to the asNode. This is commonly used in rigging and animation for path constraints and alignment.

Parameters:
  • curvName – <str> #The name of the curve or surface to find the nearest point on.

  • trgtType – <str> #The type of target (‘crv’ for curve, etc.).

  • getLoc – <bool> #Specifies whether to return a locator at the nearest point.

  • attachToPath – <bool> #Determines whether to attach the asNode to the path at the nearest point.

Returns:

<asNode/str> #The nearest point on the curve or surface, or a locator at that point.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CreateAsCurvNode["/fas:fa-sitemap Create AsCurv Node"] ProcessShArgs --> CreateAsCurvNode CreateAsCurvNode --> CreateNPOCNode["/fas:fa-code-branch Create NPOC Node"] CreateNPOCNode --> SetSrcPosAttr["/fas:fa-map-pin Set SrcPos Attributes"] SetSrcPosAttr --> ConnectCurvAttr["/fas:fa-link Connect Curve Attributes"] ConnectCurvAttr --> GetCurvPosAttr["/fas:fa-location-arrow Get Curve Position Attributes"] GetCurvPosAttr --> DeleteNPOCNode["/fas:fa-trash-alt Delete NPOC Node"] DeleteNPOCNode --> CheckGetLoc{{"/fas:fa-search-plus Check getLoc"}} CheckGetLoc --"If getLoc is True" --> CreateDestLoc["/fas:fa-map-marker-alt Create DestLoc"] CheckGetLoc --"If getLoc is False" --> ReturnCurvPos[("fas:fa-location-arrow Return Curve Position")] CreateDestLoc --> CheckAttachPath{{"/fas:fa-paperclip Check AttachToPath"}} CheckAttachPath --"If AttachToPath is True" --> AttachPathAnimation["/fas:fa-route Attach Path Animation"] CheckAttachPath --"If AttachToPath is False" --> ReturnDestLoc[("fas:fa-map-marker Return DestLoc")] AttachPathAnimation --> ReturnDestLoc ReturnCurvPos --> End[("fas:fa-stop End")] ReturnDestLoc --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CreateAsCurvNode fill:#99ccff,stroke:#000,stroke-width:2px style CreateNPOCNode fill:#cc99ff,stroke:#000,stroke-width:2px style SetSrcPosAttr fill:#99ff99,stroke:#000,stroke-width:2px style ConnectCurvAttr fill:#ffcc00,stroke:#000,stroke-width:2px style GetCurvPosAttr fill:#99ccff,stroke:#000,stroke-width:2px style DeleteNPOCNode fill:#ff9999,stroke:#000,stroke-width:2px style CheckGetLoc fill:#ffcc00,stroke:#000,stroke-width:2px style CreateDestLoc fill:#99ff99,stroke:#000,stroke-width:2px style CheckAttachPath fill:#cc99ff,stroke:#000,stroke-width:2px style AttachPathAnimation fill:#99ccff,stroke:#000,stroke-width:2px style ReturnCurvPos fill:#00cc00,stroke:#000,stroke-width:2px style ReturnDestLoc fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the nearestPointOn function:

  1. The process starts with checking if shArgs are provided and updating parameters accordingly.

  2. A node representing the curve or surface (AsCurv Node) is created, followed by the creation of a Nearest Point On Curve (NPOC) Node.

  3. The source position attributes are set, and then these attributes are connected to the curve.

  4. The nearest point’s position attributes on the curve are retrieved, after which the NPOC Node is deleted.

  5. If getLoc is true, a locator (DestLoc) is created at the nearest point.

  6. If attachToPath is true, an animation path is attached to the DestLoc.

  7. Finally, depending on the parameters, either the nearest curve position or the DestLoc is returned.

asNode.nearestVtx_OnMesh(self, trgtMesh, excludeList=None, skipDir=None, **shArgs)#

[shArgs : tm=trgtMesh, el=excludeList, sd=skipDir]

Purpose:

:: Identifies the nearest vertex on a target mesh relative to the asNode. This function is often used in modeling and rigging for precise vertex placement and manipulation.

Parameters:
  • trgtMesh – <str> #The target mesh to find the nearest vertex on.

  • excludeList – <list, optional> #A list of vertices to exclude from the search.

  • skipDir – <str/list, optional> #Direction or list of directions to skip in the search.

Returns:

<str> #The name or position of the nearest vertex on the target mesh.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateParameters["/fas:fa-edit Update Parameters"] UpdateParameters --> CreateMeshIterator["/fas:fa-object-ungroup Create Mesh Vertex Iterator"] CheckShArgs --"If shArgs not provided" --> CreateMeshIterator CreateMeshIterator --> InitializeSearch["/fas:fa-search-plus Initialize Search"] InitializeSearch --> LoopThroughVertices{{"/fas:fa-repeat Loop Through Vertices"}} LoopThroughVertices --"For each vertex" --> CheckExclusionList{{"/fas:fa-ban Check Exclusion List"}} CheckExclusionList --"Vertex in exclusion list" --> ContinueLoop1[("fas:fa-forward Continue Loop")] CheckExclusionList --"Vertex not in exclusion list" --> CheckSkipDirection{{"/fas:fa-arrow-alt-circle-right Check Skip Direction"}} CheckSkipDirection --"Direction matches skipDir" --> ContinueLoop2[("fas:fa-forward Continue Loop")] CheckSkipDirection --"Direction does not match" --> CalculateDistance["/fas:fa-ruler-combined Calculate Distance"] CalculateDistance --> CompareDistance{{"/fas:fa-balance-scale Compare Distance"}} CompareDistance --"New nearest distance" --> UpdateNearestVtx["/fas:fa-arrow-up Update Nearest Vertex"] CompareDistance --"Not nearest" --> ContinueLoop3[("fas:fa-forward Continue Loop")] ContinueLoop1 --> LoopThroughVertices ContinueLoop2 --> LoopThroughVertices UpdateNearestVtx --> ContinueLoop3 ContinueLoop3 --> LoopThroughVertices LoopThroughVertices --"All vertices processed" --> CheckResult{{"/fas:fa-check Check Result"}} CheckResult --"Nearest vertex found" --> SelectNearestVtx["/fas:fa-check-circle Select Nearest Vertex"] CheckResult --"No nearest vertex found" --> ReturnNone[("fas:fa-times-circle Return None")] SelectNearestVtx --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style CreateMeshIterator fill:#99ccff,stroke:#000,stroke-width:2px style InitializeSearch fill:#cc99ff,stroke:#000,stroke-width:2px style LoopThroughVertices fill:#99ff99,stroke:#000,stroke-width:2px style CheckExclusionList fill:#ff9999,stroke:#000,stroke-width:2px style ContinueLoop1 fill:#cccccc,stroke:#000,stroke-width:2px style CheckSkipDirection fill:#99ccff,stroke:#000,stroke-width:2px style ContinueLoop2 fill:#cccccc,stroke:#000,stroke-width:2px style CalculateDistance fill:#99ff99,stroke:#000,stroke-width:2px style CompareDistance fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateNearestVtx fill:#cc99ff,stroke:#000,stroke-width:2px style ContinueLoop3 fill:#cccccc,stroke:#000,stroke-width:2px style CheckResult fill:#ffcc00,stroke:#000,stroke-width:2px style SelectNearestVtx fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the nearestVtx_OnMesh function:

  1. The process begins by checking if shArgs are provided and updating parameters as necessary.

  2. A mesh vertex iterator is created for the target mesh.

  3. The search is initialized, and the function loops through each vertex on the mesh.

  4. For each vertex, it checks against the exclusion list and skip direction criteria.

  5. The distance from the asNode to each vertex is calculated.

  6. The nearest vertex is identified based on the shortest distance.

  7. Once all vertices are processed, the result is checked.

  8. If a nearest vertex is found, it is selected and returned.

  9. If no nearest vertex is found, the function returns None.

asNode.nextSeriesNode(self, fromEnd=True, skipCount=0, versionUpAll=False, **shArgs)#

[shArgs : fe=fromEnd, sc=skipCount, vua=versionUpAll]

Purpose:

:: Determines the next node in a series based on naming conventions, typically used in rigging to organize and navigate through a series of similar nodes.

Parameters:
  • fromEnd – <bool> #Specifies whether to start the search from the end of the node’s name.

  • skipCount – <int> #The number of nodes to skip in the series.

  • versionUpAll – <bool> #Indicates whether to increment the version number for all nodes in the series.

Returns:

<asNode> #The next node in the series following the specified parameters.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> CheckNumberInName{{"/fas:fa-search-plus Check Number in Name"}} ProcessShArgs --> CheckNumberInName CheckNumberInName --"No Number" --> ReturnNone[("fas:fa-times-circle Return None")] CheckNumberInName --"Number Exists" --> CheckVersionUpAll{{"/fas:fa-sync-alt Check versionUpAll"}} CheckVersionUpAll --"If versionUpAll" --> IncrementAllNumbers["/fas:fa-plus-circle Increment All Numbers"] CheckVersionUpAll --"If Not versionUpAll" --> DetermineNextNumber{{"/fas:fa-sort-numeric-up Determine Next Number"}} IncrementAllNumbers --> ConstructNextName["/fas:fa-pencil-alt Construct Next Node Name"] DetermineNextNumber --> ConstructNextName ConstructNextName --> CheckNextNodeExists{{"/fas:fa-binoculars Check Next Node Exists"}} CheckNextNodeExists --"If Exists" --> ReturnNextNode[("fas:fa-arrow-circle-right Return Next Node")] CheckNextNodeExists --"If Not Exists" --> ReturnNone ReturnNextNode --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckNumberInName fill:#99ccff,stroke:#000,stroke-width:2px style IncrementAllNumbers fill:#99ff99,stroke:#000,stroke-width:2px style DetermineNextNumber fill:#cc99ff,stroke:#000,stroke-width:2px style ConstructNextName fill:#99ccff,stroke:#000,stroke-width:2px style CheckNextNodeExists fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnNextNode fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the nextSeriesNode function:

  1. The function begins by checking if shArgs are provided and processing them accordingly.

  2. It then extracts the numerical part from the node’s name.

  3. If no number is found in the name, the function returns None.

  4. If versionUpAll is false, it increments the number by one to determine the next node in the series.

  5. If versionUpAll is true, it increments all numbers in the name.

  6. The function constructs the name of the next node based on the updated number.

  7. It checks if the next node exists in the scene.

  8. If the next node exists, it returns the next node. If not, it returns None.

asNode.nextUniqueName(self, reName=False, fromEnd=True, **shArgs)#

[shArgs : rn=reName, fe=fromEnd]

Purpose:

:: Generates the next unique name for the asNode, often used in scene organization to ensure unique naming for objects.

Parameters:
  • reName – <bool> #Determines whether to rename the asNode to the next unique name.

  • fromEnd – <bool> #Specifies whether to start the search for uniqueness from the end of the node’s name.

Returns:

<str> #The next unique name for the asNode.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs is provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs is not provided" --> ExtractOrigName["/fas:fa-user-tag Extract Original Name"] ProcessShArgs --> ExtractOrigName ExtractOrigName --> GenerateNextName{{"/fas:fa-redo-alt Generate Next Name"}} GenerateNextName --"Generate based on fromEnd" --> CheckNameExists{{"/fas:fa-binoculars Check if Name Exists"}} CheckNameExists --"If Exists" --> FindUniqueName["/fas:fa-search-plus Find Unique Name"] CheckNameExists --"If Not Exists" --> CheckRename{{"/fas:fa-sync-alt Check ReName"}} FindUniqueName --> CheckRename CheckRename --"If ReName" --> RenameNode["/fas:fa-i-cursor Rename Node"] CheckRename --"If Not ReName" --> ReturnUniqueName[("fas:fa-arrow-circle-right Return Unique Name")] RenameNode --> ReturnUniqueName ReturnUniqueName --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ExtractOrigName fill:#99ccff,stroke:#000,stroke-width:2px style GenerateNextName fill:#99ff99,stroke:#000,stroke-width:2px style CheckNameExists fill:#cc99ff,stroke:#000,stroke-width:2px style FindUniqueName fill:#99ccff,stroke:#000,stroke-width:2px style CheckRename fill:#ffcc00,stroke:#000,stroke-width:2px style RenameNode fill:#99ff99,stroke:#000,stroke-width:2px style ReturnUniqueName fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the nextUniqueName function:

  1. The process starts by checking if shArgs are provided and updating parameters accordingly.

  2. The original name of the node is extracted for reference.

  3. A new name is generated based on whether the search starts from the end of the node’s name.

  4. The function checks if the generated name already exists in the scene.

  5. If the name exists, it increments the name to find a unique one.

  6. If the name does not exist, it checks whether renaming is required.

  7. If renaming is required, the node is renamed to the new unique name.

  8. Finally, the function returns the unique name. If renaming was not required, the node retains its original name.

asNode.nextVar(self, fromEnd=True, skipCount=0, versionUpAll=False, **shArgs)#

[shArgs : fe=fromEnd, sc=skipCount, vua=versionUpAll]

Purpose:

:: Computes the next variable in a sequence based on the asNode’s naming convention, typically used in rigging and scripting for iterative processes.

Parameters:
  • fromEnd – <bool> #Determines whether the computation starts from the end of the node’s name.

  • skipCount – <int> #The number of iterations to skip in the sequence.

  • versionUpAll – <bool> #Indicates whether to increment the version for all variables in the sequence.

Returns:

<str> #The next variable in the sequence.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateFromEnd["/fas:fa-edit Update fromEnd"] CheckShArgs --"If shArgs not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] UpdateFromEnd --> UpdateSkipCount["/fas:fa-edit Update skipCount"] UpdateSkipCount --> UpdateVersionUpAll["/fas:fa-edit Update versionUpAll"] UpdateVersionUpAll --> SetNcTypes SetNcTypes --> GetShortName["/fas:fa-compress-arrows-alt Get Short Name"] GetShortName --> CheckVersionUpAll{{"/fas:fa-question Check versionUpAll"}} CheckVersionUpAll --"If not versionUpAll" --> FindAllNumbers["/fas:fa-sort-numeric-up Find All Numbers"] CheckVersionUpAll --"If versionUpAll" --> VersionUpAll["/fas:fa-arrow-up Version Up All"] FindAllNumbers --> CheckFromEnd{{"/fas:fa-question Check fromEnd"}} CheckFromEnd --"If fromEnd" --> ProcessFromEnd["/fas:fa-arrow-right Process From End"] CheckFromEnd --"If not fromEnd" --> ProcessNotFromEnd["/fas:fa-arrow-left Process Not From End"] ProcessFromEnd --> CheckObjExistsFromEnd{{"/fas:fa-search-plus Check Obj Exists (From End)"}} ProcessNotFromEnd --> CheckObjExistsNotFromEnd{{"/fas:fa-search-plus Check Obj Exists (Not From End)"}} CheckObjExistsFromEnd --"If Obj Exists" --> ReturnFromEnd["/fas:fa-check Return From End"] CheckObjExistsNotFromEnd --"If Obj Exists" --> ReturnNotFromEnd["/fas:fa-check Return Not From End"] CheckObjExistsFromEnd --"If Obj Does Not Exist" --> ReturnNameFromEnd["/fas:fa-check Return Name From End"] CheckObjExistsNotFromEnd --"If Obj Does Not Exist" --> ReturnNameNotFromEnd["/fas:fa-check Return Name Not From End"] VersionUpAll --> End[("fas:fa-stop End")] ReturnFromEnd --> End ReturnNotFromEnd --> End ReturnNameFromEnd --> End ReturnNameNotFromEnd --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateFromEnd fill:#ff9999,stroke:#000,stroke-width:2px style UpdateSkipCount fill:#99ccff,stroke:#000,stroke-width:2px style UpdateVersionUpAll fill:#cc99ff,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ff99,stroke:#000,stroke-width:2px style GetShortName fill:#ff9999,stroke:#000,stroke-width:2px style CheckVersionUpAll fill:#ffcc00,stroke:#000,stroke-width:2px style FindAllNumbers fill:#99ccff,stroke:#000,stroke-width:2px style CheckFromEnd fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessFromEnd fill:#99ff99,stroke:#000,stroke-width:2px style ProcessNotFromEnd fill:#99ff99,stroke:#000,stroke-width:2px style CheckObjExistsFromEnd fill:#ffcc00,stroke:#000,stroke-width:2px style CheckObjExistsNotFromEnd fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFromEnd fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNotFromEnd fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNameFromEnd fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNameNotFromEnd fill:#99ccff,stroke:#000,stroke-width:2px style VersionUpAll fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the nextVar function:

  1. The process begins by checking if shArgs are provided and updating the parameters accordingly.

  2. The numbers are extracted from the asNode’s name.

  3. The function checks if the versionUpAll parameter is true.

  4. If true, all numbers in the name are incremented.

  5. If not, the function processes a specific number based on fromEnd and skipCount.

  6. A next name is generated and checked for existence in the scene.

  7. If the generated name exists, the function increments the number further.

  8. The function returns either the next name or the name with all numbers incremented.

asNode.nodeType(self, transformCheck=False, *args, **kwargs)#

[shArgs : tc=transformCheck]

Purpose:

:: Identifies the type of the asNode within the Maya scene. This function is crucial for scripts that need to handle different node types differently.

Parameters:

transformCheck – <bool, optional> #A flag to check if the node should be considered a transform node.

Returns:

<str> #The type of the asNode.

graph TB Start[("(fa:fa-play Start)")] --> CheckTransformCheck{{"/fas:fa-question Check transformCheck"}} CheckTransformCheck --"If not transformCheck" --> CheckHasShape{{"/fas:fa-search-plus Check hasShape"}} CheckHasShape --"If hasShape" --> GetShapeNodeType["/fas:fa-sitemap Get Shape Node Type"] CheckHasShape --"If not hasShape" --> GetNameNodeType["/fas:fa-sitemap Get Name Node Type"] CheckTransformCheck --"If transformCheck" --> GetNameNodeTypeTransform["/fas:fa-sitemap Get Name Node Type (Transform)"] GetShapeNodeType --"Return nodeType of getShape()" --> End[("fas:fa-stop End")] GetNameNodeType --"Return nodeType of name()" --> End GetNameNodeTypeTransform --"Return nodeType of name() (Transform)" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckTransformCheck fill:#ffcc00,stroke:#000,stroke-width:2px style CheckHasShape fill:#ff9999,stroke:#000,stroke-width:2px style GetShapeNodeType fill:#99ccff,stroke:#000,stroke-width:2px style GetNameNodeType fill:#cc99ff,stroke:#000,stroke-width:2px style GetNameNodeTypeTransform fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the nodeType function:

  1. The process starts by determining if transformCheck is set.

  2. If transformCheck is not set, it checks if the asNode has a shape.

  3. If the asNode has a shape, it returns the node type of the shape.

  4. If the asNode does not have a shape, it returns the node type based on the node’s name.

  5. If transformCheck is set, it directly returns the node type based on the node’s name.

asNode.numChildren(self, type=None, chdImplied=False, **kwargs)#

[shArgs : t=type, ci=chdImplied, **kwargs]

Purpose:

:: Counts the number of children of the asNode, often used in rigging and scene organization to manage hierarchical structures.

Parameters:
  • type – <str, optional> #The type of children to count (e.g., ‘transform’, ‘mesh’).

  • chdImplied – <bool> #Indicates whether to count implied children.

Kwargs:

Additional keyword arguments for specifying the count criteria.

Returns:

<int> #The number of children of the specified type under the asNode.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateType["/fas:fa-pencil-alt Update Type"] CheckShArgs --"If shArgs not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] UpdateType --> UpdateChdImplied["/fas:fa-pencil-alt Update chdImplied"] UpdateChdImplied --> SetNcTypes SetNcTypes --> GetName["/fas:fa-tag GetName"] GetName --> CheckChdImplied{{"/fas:fa-check-circle Check chdImplied"}} CheckChdImplied --"If chdImplied" --> CheckImpliedAttr["/fas:fa-search-plus Check Implied Attr"] CheckChdImplied --"If not chdImplied" --> GetChildren["/fas:fa-users Get Children"] CheckImpliedAttr --"Attr Exists" --> CountImplied["/fas:fa-calculator Count Implied"] CheckImpliedAttr --"Attr Not Exists" --> GetChildren CountImplied --> GetChildren GetChildren --"List Children" --> CheckType{{"/fas:fa-filter Check Type"}} CheckType --"If Type Provided" --> FilterByType["/fas:fa-tasks Filter By Type"] CheckType --"If No Type" --> CountAllChildren["/fas:fa-calculator Count All Children"] FilterByType --"Filtered Children" --> CountTypeChildren["/fas:fa-calculator Count Type Children"] CountAllChildren --"Return Total Count" --> ReturnTotal[("fas:fa-arrow-circle-right Return Total Count")] CountTypeChildren --"Return Type Count" --> ReturnTypeCount[("fas:fa-arrow-circle-right Return Type Count")] ReturnTotal --> End[("fas:fa-stop End")] ReturnTypeCount --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateType fill:#ff9999,stroke:#000,stroke-width:2px style UpdateChdImplied fill:#99ccff,stroke:#000,stroke-width:2px style SetNcTypes fill:#cc99ff,stroke:#000,stroke-width:2px style GetName fill:#99ff99,stroke:#000,stroke-width:2px style CheckChdImplied fill:#ffcc00,stroke:#000,stroke-width:2px style CheckImpliedAttr fill:#99ccff,stroke:#000,stroke-width:2px style CountImplied fill:#ff9999,stroke:#000,stroke-width:2px style GetChildren fill:#99ff99,stroke:#000,stroke-width:2px style CheckType fill:#ffcc00,stroke:#000,stroke-width:2px style FilterByType fill:#cc99ff,stroke:#000,stroke-width:2px style CountAllChildren fill:#99ff99,stroke:#000,stroke-width:2px style CountTypeChildren fill:#99ccff,stroke:#000,stroke-width:2px style ReturnTotal fill:#00cc00,stroke:#000,stroke-width:2px style ReturnTypeCount fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the numChildren function:

  1. The process starts with checking if shArgs are provided and updating the parameters accordingly.

  2. It then sets the node categories (ncTypes) and retrieves the name of the asNode.

  3. If chdImplied is true, it checks for the existence of an implied children attribute and counts any implied children.

  4. The function lists all children of the asNode.

  5. If a specific type is provided, it filters the children by that type and counts them.

  6. If no type is provided, it counts all children of the asNode.

  7. Finally, it returns the count of children, either of a specific type or the total count.

asNode.old_getPos(self, objType='obj', vtxOrNum=None, **shArgs)#

Objective:

To return the world position of an object, meshVtx or curveCV

Returns:#

[objPos] if objType==’obj’, [vtxPos] if objType==’vtx’, [cvPos] if objType==’cv’

asNode.old_grpIt(self, grpLevel=1, snapPiv=True, grpSufxList=None, snapRot=False)#

Returns:(asNodes)#

return grpList [lsitOfGrps(asNodes)]

asNode.old_isShape(self)#
asNode.old_nodeType(self, objType=None, **shArgs)#

doc

asNode.openAttrs(self, attrList=None, keyable=True, **shArgs)#

[shArgs : al=attrList, k=keyable]

Purpose:

:: Unlocks and makes specified attributes of the asNode keyable, commonly used in rigging to enable animators to keyframe those attributes.

Parameters:
  • attrList – <list> #The list of attributes to make keyable. attrList = ‘t’ | ‘tx’ | ‘v’ | [‘t’, ‘r’] | [‘translateX’, ‘r’] etc

  • keyable – <bool> #Determines whether the attributes should be keyable.

Returns:

<None> #No return value, specified attributes are made keyable.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateAttrList["/fas:fa-pencil-alt Update AttrList"] CheckShArgs --"If shArgs not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] UpdateAttrList --> UpdateKeyable["/fas:fa-pencil-alt Update Keyable"] UpdateKeyable --> SetNcTypes SetNcTypes --> ConvertToList{{"/fas:fa-list-ol Convert AttrList to List"}} ConvertToList --"AttrList as List" --> LoopAttrList{{"/fas:fa-repeat Loop through AttrList"}} LoopAttrList --"For each attribute in AttrList"--> CheckAttrType{{"/fas:fa-tags Check AttrType"}} CheckAttrType --"If double3" --> ProcessDouble3["/fas:fa-cogs Process double3 Attr"] CheckAttrType --"Else" --> ProcessOtherAttr["/fas:fa-cogs Process Other Attr"] ProcessDouble3 --"Unlock & Set Keyable" --> ReturnNone1[("fas:fa-check-circle Return None")] ProcessOtherAttr --"Unlock & Set Keyable" --> ReturnNone2[("fas:fa-check-circle Return None")] ReturnNone1 --> End[("fas:fa-stop End")] ReturnNone2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAttrList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateKeyable fill:#99ccff,stroke:#000,stroke-width:2px style SetNcTypes fill:#cc99ff,stroke:#000,stroke-width:2px style ConvertToList fill:#99ff99,stroke:#000,stroke-width:2px style LoopAttrList fill:#ffcc00,stroke:#000,stroke-width:2px style CheckAttrType fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessDouble3 fill:#99ccff,stroke:#000,stroke-width:2px style ProcessOtherAttr fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNone1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnNone2 fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the openAttrs function:

  1. The function starts by checking if shArgs are provided and updates attrList and keyable accordingly.

  2. It converts attrList to a list if it is not already.

  3. For each attribute in attrList, the function determines its type.

  4. If the attribute is of type ‘double3’, it processes the attribute and its sub-attributes, unlocking them and setting them as keyable.

  5. For other attribute types, it unlocks them and sets them as keyable.

  6. The function concludes without a return value, having modified the attributes as specified.

asNode.parent(self, numParent=1, allParents=False, nType=None, prntImplied=True, **shArgs)#

[shArgs : np=numParent, ap=allParents, nt=nType, pi=prntImplied]

Purpose:

:: Retrieves the parent node(s) of the asNode, used in rigging and scene organization to navigate and manipulate node hierarchies.

Parameters:
  • numParent – <int> #The number of parent levels to retrieve.

  • allParents – <bool> #Indicates whether to retrieve all parent nodes.

  • nType – <str, optional> #The type of parent nodes to retrieve.

  • prntImplied – <bool> #Determines whether to include implied parent nodes in the retrieval.

Returns:

<asNode/list> #The parent node(s) of the asNode.

nType =nodeType #_ It is used when allParents is True

allParents & numParent:#

if allParents == True and numParent=0:

#_ returns all parents

elif allParents == True and numParent=> 1:

#_ returns all parents upto numParent

elif allParents == False and numParent=> 1:

#_ Returns perticular parent at numParent (parent, grndParent Etc)

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateNumParent["/fas:fa-pencil-alt Update NumParent"] CheckShArgs --"If shArgs not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] UpdateNumParent --> UpdateAllParents["/fas:fa-pencil-alt Update AllParents"] UpdateAllParents --> UpdateNType["/fas:fa-pencil-alt Update NType"] UpdateNType --> UpdatePrntImplied["/fas:fa-pencil-alt Update PrntImplied"] UpdatePrntImplied --> SetNcTypes SetNcTypes --> CheckPrntImplied{{"/fas:fa-question-circle Check PrntImplied"}} CheckPrntImplied --"If PrntImplied" --> CheckAllParents1{{"/fas:fa-question-circle Check AllParents"}} CheckPrntImplied --"If not PrntImplied" --> CheckAllParents2{{"/fas:fa-question-circle Check AllParents"}} CheckAllParents1 --"If AllParents & NumParent > 1" --> GetAllParentsLimited["/fas:fa-sitemap Get All Parents (Limited)"] CheckAllParents1 --"If AllParents & NumParent == 0" --> GetAllParents["/fas:fa-sitemap Get All Parents"] CheckAllParents1 --"If not AllParents" --> GetSingleParent["/fas:fa-sitemap Get Single Parent"] CheckAllParents2 --"Same as Above" --> ProcessParents["/fas:fa-sitemap Process Parents"] GetAllParentsLimited --> ReturnParentList1[("fas:fa-arrow-circle-right Return Parent List")] GetAllParents --> ReturnParentList2[("fas:fa-arrow-circle-right Return Parent List")] GetSingleParent --> ReturnParent[("fas:fa-arrow-circle-right Return Parent")] ProcessParents --> ReturnParents[("fas:fa-arrow-circle-right Return Parents")] ReturnParentList1 --> End[("fas:fa-stop End")] ReturnParentList2 --> End ReturnParent --> End ReturnParents --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateNumParent fill:#ff9999,stroke:#000,stroke-width:2px style UpdateAllParents fill:#99ccff,stroke:#000,stroke-width:2px style UpdateNType fill:#cc99ff,stroke:#000,stroke-width:2px style UpdatePrntImplied fill:#99ff99,stroke:#000,stroke-width:2px style SetNcTypes fill:#ffcc00,stroke:#000,stroke-width:2px style CheckPrntImplied fill:#cc99ff,stroke:#000,stroke-width:2px style CheckAllParents1 fill:#99ccff,stroke:#000,stroke-width:2px style CheckAllParents2 fill:#99ccff,stroke:#000,stroke-width:2px style GetAllParentsLimited fill:#99ff99,stroke:#000,stroke-width:2px style GetAllParents fill:#ffcc00,stroke:#000,stroke-width:2px style GetSingleParent fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessParents fill:#99ccff,stroke:#000,stroke-width:2px style ReturnParentList1 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnParentList2 fill:#00cc00,stroke:#000,stroke-width:2px style ReturnParent fill:#00cc00,stroke:#000,stroke-width:2px style ReturnParents fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the parent function:

  1. The function starts by checking if shArgs are provided and updates parameters accordingly.

  2. It then checks for implied parent and processes based on allParents and numParent parameters.

  3. If implied parent is true, it retrieves the parent based on the conditions of all parents and numParent.

  4. If allParents and numParent are set, it retrieves all parents up to a specified level or all parents if numParent is 0.

  5. For not allParents, it retrieves a specific parent based on numParent.

  6. The function returns the parent node(s) based on the given conditions and parameters.

asNode.parentTo(self, parentNode=None, **shArgs)#

[shArgs : pn=parentNode]

Purpose:

:: Parents the asNode to a specified node or to the world if no parent node is provided.

Parameters:

parentNode – <asNode, optional> #The node to parent the asNode to. If not provided, parents to the world.

Returns:

<None> #No return value, the asNode is parented as specified.

Example:

if parentNode:

parent(asNode, parentNode)

else:

parent(asNode, w=1) #_ Parents to world if parentNode is not given

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs not provided" --> SetNcTypes["/fas:fa-stream Set ncTypes"] ProcessShArgs --> SetNcTypes SetNcTypes --> CheckParentNode{{"/fas:fa-search-plus Check Parent Node"}} CheckParentNode --"If Parent Node Provided" --> CheckParentExists{{"/fas:fa-binoculars Check if Parent Exists"}} CheckParentNode --"If No Parent Node" --> ParentToWorld["/fas:fa-globe Parent to World"] CheckParentExists --"If Parent Exists" --> CheckIsChild{{"/fas:fa-sitemap Check if isChild"}} CheckParentExists --"If Parent Does Not Exist" --> Warning1[("fas:fa-exclamation-triangle Warning: Parent Not Found")] CheckIsChild --"If isChild" --> Warning2[("fas:fa-exclamation-triangle Warning: Already a Child")] CheckIsChild --"If Not isChild" --> PerformParenting["/fas:fa-link Perform Parenting"] PerformParenting --> End[("fas:fa-stop End")] ParentToWorld --> End Warning1 --> End Warning2 --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckParentNode fill:#cc99ff,stroke:#000,stroke-width:2px style CheckParentExists fill:#99ff99,stroke:#000,stroke-width:2px style CheckIsChild fill:#ffcc00,stroke:#000,stroke-width:2px style PerformParenting fill:#99ccff,stroke:#000,stroke-width:2px style ParentToWorld fill:#99ff99,stroke:#000,stroke-width:2px style Warning1 fill:#ff9999,stroke:#000,stroke-width:2px style Warning2 fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the parentTo function:

  1. The function starts by checking if shArgs are provided and updates parameters accordingly.

  2. It checks if a parentNode is provided.

  3. If parentNode exists, it checks whether the asNode is already a child of the parentNode.

  4. If the asNode is not a child, it performs the parenting process.

  5. If no parentNode is provided, the asNode is parented to the world.

  6. The function ends with the asNode parented as specified.

asNode.pickWalkDown(self, pickCount=1, nodeType=None, selectAll=True, includeSrc=False, childImplied=True, **shArgs)#

[shArgs : pc=pickCount, nt=nodeType, sa=selectAll, is=includeSrc, ci=childImplied]

Purpose:

:: Performs a pick walk down from the asNode, selecting nodes based on specified criteria.

Parameters:
  • pickCount – <int> #The number of nodes to pick walk down.

  • nodeType – <str, optional> #The type of nodes to select during the pick walk.

  • selectAll – <bool> #Determines whether to select all nodes encountered.

  • includeSrc – <bool> #Specifies whether to include the source node in the selection.

  • childImplied – <bool> #Considers implied child nodes in the selection.

Returns:

<asNode/list> #The selected node or list of nodes from the pick walk.

Example:

if pickList:
if len(pickList) == 1:

return pickList[0] #_ asNode

else:

return pickList #_ asNode(s)

else:

return None

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdatePickCount["/fas:fa-edit Update pickCount"] UpdatePickCount --> UpdateNodeType["/fas:fa-edit Update nodeType"] UpdateNodeType --> UpdateSelectAll["/fas:fa-edit Update selectAll"] UpdateSelectAll --> UpdateIncludeSrc["/fas:fa-edit Update includeSrc"] UpdateIncludeSrc --> UpdateChildImplied["/fas:fa-edit Update childImplied"] UpdateChildImplied --> CheckSpecialCase{{"/fas:fa-question Check Special Case"}} CheckShArgs --"If shArgs not provided" --> CheckSpecialCase CheckSpecialCase --"If Special Case Conditions Met" --> ReturnSpecialCase["/fas:fa-check Return Special Case"] CheckSpecialCase --"If Not Special Case" --> SelectReset["/fas:fa-times-circle Select Reset"] SelectReset --> InitializePickList["/fas:fa-list-ul Initialize Pick List"] InitializePickList --> LoopPickWalk{{"/fas:fa-repeat Loop Pick Walk"}} LoopPickWalk --> GetPickListFunc["/fas:fa-code Get Pick List Function"] GetPickListFunc --> CheckPickListNotEmpty{{"/fas:fa-question Check Pick List Not Empty"}} CheckPickListNotEmpty --"If Pick List Not Empty" --> CheckIncludeSrc{{"/fas:fa-question Check Include Src"}} CheckIncludeSrc --"If Include Src" --> IncludeSource["/fas:fa-plus Include Source"] CheckIncludeSrc --"If Not Include Src" --> CheckSelectAll{{"/fas:fa-question Check Select All"}} IncludeSource --> CheckSelectAll CheckSelectAll --"If Select All" --> SelectAllNodes["/fas:fa-mouse-pointer Select All Nodes"] CheckSelectAll --"If Not Select All" --> ReturnPickList{{"/fas:fa-check Return Pick List"}} SelectAllNodes --> ReturnPickList CheckPickListNotEmpty --"If Pick List Empty" --> ClearSelection["/fas:fa-ban Clear Selection"] ClearSelection --> ReturnNone["/fas:fa-times-circle Return None"] ReturnSpecialCase --> End[("fas:fa-stop End")] ReturnPickList --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdatePickCount fill:#ff9999,stroke:#000,stroke-width:2px style UpdateNodeType fill:#99ccff,stroke:#000,stroke-width:2px style UpdateSelectAll fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateIncludeSrc fill:#99ff99,stroke:#000,stroke-width:2px style UpdateChildImplied fill:#ff9999,stroke:#000,stroke-width:2px style CheckSpecialCase fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnSpecialCase fill:#99ccff,stroke:#000,stroke-width:2px style SelectReset fill:#cc99ff,stroke:#000,stroke-width:2px style InitializePickList fill:#99ff99,stroke:#000,stroke-width:2px style LoopPickWalk fill:#ff9999,stroke:#000,stroke-width:2px style GetPickListFunc fill:#99ccff,stroke:#000,stroke-width:2px style CheckPickListNotEmpty fill:#cc99ff,stroke:#000,stroke-width:2px style CheckIncludeSrc fill:#99ff99,stroke:#000,stroke-width:2px style IncludeSource fill:#ff9999,stroke:#000,stroke-width:2px style CheckSelectAll fill:#ffcc00,stroke:#000,stroke-width:2px style SelectAllNodes fill:#99ccff,stroke:#000,stroke-width:2px style ReturnPickList fill:#cc99ff,stroke:#000,stroke-width:2px style ClearSelection fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNone fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the pickWalkDown function:

  1. The function begins by checking if shArgs are provided, and processes them if so.

  2. It checks for any special cases where simple logic can be applied directly.

  3. If no special case is met, it starts a loop for pick walking down the node hierarchy.

  4. During each iteration, it gathers a list of nodes based on the pick walk.

  5. If the pick list is not empty, it checks if the source node should be included.

  6. Depending on the selectAll parameter, either all nodes in the pick list are selected or a specific pick list is returned.

  7. If the pick list is empty, it clears the selection and returns None.

  8. The function concludes by returning the relevant node(s) based on the parameters and conditions met.

asNode.pickWalkLeft(self, pickCount=1, nodeType=None, selectAll=True, includeSrc=False, **shArgs)#

[shArgs : pc=pickCount, nt=nodeType, sa=selectAll, is=includeSrc]

Purpose:

:: Performs a pick walk to the left from the asNode, selecting nodes based on specified criteria.

Parameters:
  • pickCount – <int> #The number of nodes to pick walk left.

  • nodeType – <str, optional> #The type of nodes to select during the pick walk.

  • selectAll – <bool> #Determines whether to select all nodes encountered.

  • includeSrc – <bool> #Specifies whether to include the source node in the selection.

Returns:

<asNode/list> #The selected node or list of nodes from the pick walk.

Example:

if pickList:
if len(pickList) == 1:

return pickList[0] #_ asNode

else:

return pickList #_ asNode(s)

else:

return None

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs not provided" --> InitPickWalk{{"/fas:fa-arrow-left Init Pick Walk Left"}} ProcessShArgs --> InitPickWalk InitPickWalk --> LoopPickWalk{{"/fas:fa-repeat Loop Pick Walk Left"}} LoopPickWalk --> GetPickList["/fas:fa-code Get Pick List"] GetPickList --> CheckPickListNotEmpty{{"/fas:fa-question Check Pick List Not Empty"}} CheckPickListNotEmpty --"If Pick List Not Empty" --> CheckIncludeSrc{{"/fas:fa-question Check Include Src"}} CheckIncludeSrc --"If Include Src" --> IncludeSrcInList["/fas:fa-plus Include Src in List"] CheckIncludeSrc --"If Not Include Src" --> ProcessSelectAll{{"/fas:fa-check-circle Process Select All"}} IncludeSrcInList --> ProcessSelectAll ProcessSelectAll --"If Select All" --> SelectAllNodes["/fas:fa-mouse-pointer Select All Nodes"] ProcessSelectAll --"If Not Select All" --> ReturnPickList[("fas:fa-check Return Pick List")] SelectAllNodes --> ReturnPickList CheckPickListNotEmpty --"If Pick List Empty" --> ClearSelection["/fas:fa-ban Clear Selection"] ClearSelection --> ReturnNone[("fas:fa-times-circle Return None")] ReturnPickList --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitPickWalk fill:#99ccff,stroke:#000,stroke-width:2px style LoopPickWalk fill:#cc99ff,stroke:#000,stroke-width:2px style GetPickList fill:#99ff99,stroke:#000,stroke-width:2px style CheckPickListNotEmpty fill:#ff9999,stroke:#000,stroke-width:2px style CheckIncludeSrc fill:#cc99ff,stroke:#000,stroke-width:2px style IncludeSrcInList fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessSelectAll fill:#99ccff,stroke:#000,stroke-width:2px style SelectAllNodes fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnPickList fill:#99ff99,stroke:#000,stroke-width:2px style ClearSelection fill:#ff9999,stroke:#000,stroke-width:2px style ReturnNone fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the pickWalkLeft function:

  1. The function begins by checking if shArgs are provided and processes them if necessary.

  2. It initiates the pick walk to the left from the asNode.

  3. During each iteration, a list of nodes based on the pick walk is gathered.

  4. If the pick list is not empty, it checks if the source node should be included.

  5. Depending on the selectAll parameter, either all nodes in the pick list are selected or a specific pick list is returned.

  6. If the pick list is empty, the selection is cleared, and None is returned.

  7. The function concludes by returning the relevant node(s) based on the parameters and conditions met.

asNode.pickWalkRight(self, pickCount=1, nodeType=None, selectAll=True, includeSrc=False, **shArgs)#

[shArgs : pc=pickCount, nt=nodeType, sa=selectAll, is=includeSrc]

Purpose:

:: Performs a pick walk to the right from the asNode, selecting nodes based on specified criteria.

Parameters:
  • pickCount – <int> #The number of nodes to pick walk right.

  • nodeType – <str, optional> #The type of nodes to select during the pick walk.

  • selectAll – <bool> #Determines whether to select all nodes encountered.

  • includeSrc – <bool> #Specifies whether to include the source node in the selection.

Returns:

<asNode/list> #The selected node or list of nodes from the pick walk.

Example:

if pickList:
if len(pickList) == 1:

return pickList[0] #_ asNode

else:

return pickList #_ asNode(s)

else:

return None

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs not provided" --> InitPickWalk{{"/fas:fa-arrow-right Init Pick Walk Right"}} ProcessShArgs --> InitPickWalk InitPickWalk --> LoopPickWalk{{"/fas:fa-repeat Loop Pick Walk Right"}} LoopPickWalk --> GetPickList["/fas:fa-code Get Pick List"] GetPickList --> CheckPickListNotEmpty{{"/fas:fa-question Check Pick List Not Empty"}} CheckPickListNotEmpty --"If Pick List Not Empty" --> CheckIncludeSrc{{"/fas:fa-question Check Include Src"}} CheckIncludeSrc --"If Include Src" --> IncludeSrcInList["/fas:fa-plus Include Src in List"] CheckIncludeSrc --"If Not Include Src" --> ProcessSelectAll{{"/fas:fa-check-circle Process Select All"}} IncludeSrcInList --> ProcessSelectAll ProcessSelectAll --"If Select All" --> SelectAllNodes["/fas:fa-mouse-pointer Select All Nodes"] ProcessSelectAll --"If Not Select All" --> ReturnPickList[("fas:fa-check Return Pick List")] SelectAllNodes --> ReturnPickList CheckPickListNotEmpty --"If Pick List Empty" --> ClearSelection["/fas:fa-ban Clear Selection"] ClearSelection --> ReturnNone[("fas:fa-times-circle Return None")] ReturnPickList --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitPickWalk fill:#99ccff,stroke:#000,stroke-width:2px style LoopPickWalk fill:#cc99ff,stroke:#000,stroke-width:2px style GetPickList fill:#99ff99,stroke:#000,stroke-width:2px style CheckPickListNotEmpty fill:#ff9999,stroke:#000,stroke-width:2px style CheckIncludeSrc fill:#cc99ff,stroke:#000,stroke-width:2px style IncludeSrcInList fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessSelectAll fill:#99ccff,stroke:#000,stroke-width:2px style SelectAllNodes fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnPickList fill:#99ff99,stroke:#000,stroke-width:2px style ClearSelection fill:#ff9999,stroke:#000,stroke-width:2px style ReturnNone fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the pickWalkRight function:

  1. The function starts by checking if shArgs are provided and processes them if necessary.

  2. It initiates the pick walk to the right from the asNode.

  3. During each iteration, a list of nodes based on the pick walk is compiled.

  4. If the pick list is not empty, the function checks if the source node should be included.

  5. Depending on the selectAll parameter, either all nodes in the pick list are selected or a specific pick list is returned.

  6. If the pick list is empty, the selection is cleared, and None is returned.

  7. The function concludes by returning the relevant node(s) based on the parameters and conditions met.

asNode.pickWalkUp(self, pickCount=1, nodeType=None, selectAll=True, includeSrc=False, parentImplied=False, **shArgs)#

[shArgs : pc=pickCount, nt=nodeType, sa=selectAll, is=includeSrc, pi=parentImplied]

Purpose:

:: Performs a pick walk up from the asNode, selecting nodes based on specified criteria.

Parameters:
  • pickCount – <int> #The number of nodes to pick walk up.

  • nodeType – <str, optional> #The type of nodes to select during the pick walk.

  • selectAll – <bool> #Determines whether to select all nodes encountered.

  • includeSrc – <bool> #Specifies whether to include the source node in the selection.

  • parentImplied – <bool> #Considers implied parent nodes in the selection.

Returns:

<asNode/list> #The selected node or list of nodes from the pick walk.

Example:

if pickList:
if len(pickList) == 1:

return pickList[0] #_ asNode

else:

return pickList #_ asNode(s)

else:

return None

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> ProcessShArgs["/fas:fa-cogs Process shArgs"] CheckShArgs --"If shArgs not provided" --> InitPickWalk{{"/fas:fa-arrow-up Init Pick Walk Up"}} ProcessShArgs --> InitPickWalk InitPickWalk --> LoopPickWalk{{"/fas:fa-repeat Loop Pick Walk Up"}} LoopPickWalk --> GetPickList["/fas:fa-code Get Pick List"] GetPickList --> CheckPickListNotEmpty{{"/fas:fa-question Check Pick List Not Empty"}} CheckPickListNotEmpty --"If Pick List Not Empty" --> CheckIncludeSrc{{"/fas:fa-question Check Include Src"}} CheckIncludeSrc --"If Include Src" --> IncludeSrcInList["/fas:fa-plus Include Src in List"] CheckIncludeSrc --"If Not Include Src" --> ProcessSelectAll{{"/fas:fa-check-circle Process Select All"}} IncludeSrcInList --> ProcessSelectAll ProcessSelectAll --"If Select All" --> SelectAllNodes["/fas:fa-mouse-pointer Select All Nodes"] ProcessSelectAll --"If Not Select All" --> ReturnPickList[("fas:fa-check Return Pick List")] SelectAllNodes --> ReturnPickList CheckPickListNotEmpty --"If Pick List Empty" --> ClearSelection["/fas:fa-ban Clear Selection"] ClearSelection --> ReturnNone[("fas:fa-times-circle Return None")] ReturnPickList --> End[("fas:fa-stop End")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitPickWalk fill:#99ccff,stroke:#000,stroke-width:2px style LoopPickWalk fill:#cc99ff,stroke:#000,stroke-width:2px style GetPickList fill:#99ff99,stroke:#000,stroke-width:2px style CheckPickListNotEmpty fill:#ff9999,stroke:#000,stroke-width:2px style CheckIncludeSrc fill:#cc99ff,stroke:#000,stroke-width:2px style IncludeSrcInList fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessSelectAll fill:#99ccff,stroke:#000,stroke-width:2px style SelectAllNodes fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnPickList fill:#99ff99,stroke:#000,stroke-width:2px style ClearSelection fill:#ff9999,stroke:#000,stroke-width:2px style ReturnNone fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the pickWalkUp function:

  1. The process starts by checking if shArgs are provided and processing them if necessary.

  2. It initiates the pick walk up from the asNode.

  3. During each iteration, a list of nodes based on the pick walk is compiled.

  4. If the pick list is not empty, the function checks if the source node should be included.

  5. Depending on the selectAll parameter, either all nodes in the pick list are selected or a specific pick list is returned.

  6. If the pick list is empty, the selection is cleared, and None is returned.

  7. The function concludes by returning the relevant node(s) based on the parameters and conditions met.

asNode.prefixHI(self, prefix, topSelect=True, selectHI=True, excludeShapes=1, **shArgs)#

[shArgs : p=prefix, ts=topSelect, si=selectHI, es=excludeShapes]

Purpose:

:: Adds a prefix to all nodes in the hierarchy of the asNode, useful in rigging and scene organization for consistent naming conventions.

Parameters:
  • prefix – <str> #The prefix to add to each node in the hierarchy.

  • topSelect – <bool> #Specifies whether to include the top node in the prefixing process.

  • selectHI – <bool> #Determines whether to select the entire hierarchy during the process.

  • excludeShapes – <bool> #Specifies whether to exclude shape nodes from being prefixed.

Returns:

<list> #A list of nodes with the prefix applied.

List of Lists [[asNode1]] or [[asNode1, asNode2], [asNode3, asNode4]] etc

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdatePrefix["/fas:fa-edit Update Prefix"] UpdatePrefix --> UpdateTopSelect["/fas:fa-edit Update Top Select"] UpdateTopSelect --> UpdateSelectHI["/fas:fa-edit Update Select Hierarchy"] UpdateSelectHI --> UpdateExcludeShapes["/fas:fa-edit Update Exclude Shapes"] UpdateExcludeShapes --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> SelectReset["/fas:fa-times-circle Select Reset"] SelectReset --> CheckSelectHI{{"/fas:fa-question Check Select Hierarchy"}} CheckSelectHI --"If Select Hierarchy" --> SelectHierarchy["/fas:fa-sitemap Select Hierarchy"] CheckSelectHI --"If Not Select Hierarchy" --> CheckTopSelect{{"/fas:fa-question Check Top Select"}} SelectHierarchy --> CheckTopSelect CheckTopSelect --"If Not Top Select" --> DeselectTop["/fas:fa-minus-circle Deselect Top"] CheckTopSelect --"If Top Select" --> PrefixNodes["/fas:fa-tag Prefix Nodes"] DeselectTop --> CheckSelected{{"/fas:fa-question Check Selected"}} CheckSelected --"If Selected" --> PrefixNodes CheckSelected --"If Not Selected" --> ClearSelection["/fas:fa-ban Clear Selection"] PrefixNodes --> ProcessNodes["/fas:fa-cogs Process Nodes"] ProcessNodes --> BuildFinalList["/fas:fa-list-ul Build Final List"] BuildFinalList --> ClearSelect["/fas:fa-ban Clear Selection"] ClearSelect --> AddSelectNodes["/fas:fa-plus-circle Add Selected Nodes"] AddSelectNodes --> ReturnFinalList["/fas:fa-check-circle Return Final List"] ClearSelection --> ReturnEmptyList["/fas:fa-check-circle Return Empty List"] ReturnFinalList --> End[("fas:fa-stop End")] ReturnEmptyList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdatePrefix fill:#ff9999,stroke:#000,stroke-width:2px style UpdateTopSelect fill:#99ccff,stroke:#000,stroke-width:2px style UpdateSelectHI fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateExcludeShapes fill:#99ff99,stroke:#000,stroke-width:2px style SetNcTypes fill:#ff9999,stroke:#000,stroke-width:2px style SelectReset fill:#cc99ff,stroke:#000,stroke-width:2px style CheckSelectHI fill:#99ff99,stroke:#000,stroke-width:2px style SelectHierarchy fill:#ff9999,stroke:#000,stroke-width:2px style CheckTopSelect fill:#ffcc00,stroke:#000,stroke-width:2px style DeselectTop fill:#99ccff,stroke:#000,stroke-width:2px style CheckSelected fill:#cc99ff,stroke:#000,stroke-width:2px style PrefixNodes fill:#99ff99,stroke:#000,stroke-width:2px style ProcessNodes fill:#ff9999,stroke:#000,stroke-width:2px style BuildFinalList fill:#99ccff,stroke:#000,stroke-width:2px style ClearSelect fill:#cc99ff,stroke:#000,stroke-width:2px style AddSelectNodes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFinalList fill:#ff9999,stroke:#000,stroke-width:2px style ClearSelection fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEmptyList fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the prefixHI function:

  1. The process starts by checking if shArgs are provided and updating parameters accordingly.

  2. It initializes the selection process based on the select hierarchy and top select options.

  3. If the top node is not selected, it is deselected from the hierarchy.

  4. The hierarchy is then processed to prefix nodes, considering the excludeShapes parameter.

  5. The final list of prefixed nodes is built and selected.

  6. The function concludes by returning the final list of nodes with the applied prefix.

asNode.rNode(self, srcWord='L_', replaceWord='R_', repCount=1, replaceAtEnd=False, **shArgs)#

[shArgs : sw=srcWord, rw=replaceWord, rc=repCount, re=replaceAtEnd]

Purpose:

:: Renames the asNode by replacing a specified word with another, typically used in rigging for creating opposite side nodes.

Parameters:
  • srcWord – <str> #The source word to replace in the asNode’s name.

  • replaceWord – <str> #The word to replace the source word with.

  • repCount – <int> #The number of occurrences to replace.

  • replaceAtEnd – <bool> #Determines whether to replace at the end of the name.

Returns:

<asNode> #The asNode with the replaced name. Returns opp side node with replaceWord ‘R_’ from srcWord ‘L_

Flow Chart Description:

This flowchart illustrates the rNode function:

  1. The function begins by checking if shArgs are provided and updates parameters like srcWord, replaceWord, repCount, and replaceAtEnd.

  2. It then checks if the node’s name starts with the srcWord.

  3. If the name starts with the srcWord, it performs the replacement with replaceWord.

  4. If the name does not start with srcWord but starts with replaceWord, it performs a reverse replacement to get the opposite side node.

  5. The function checks if the resulting object exists in the scene.

  6. If the object exists, it returns the renamed node; otherwise, it returns None.

asNode.rename(self, newName=None, renameGrps=None, renameChd=None, renameSibs=None, nodesList=None, nextUniqueName=None, **shortArgs)#

[shArgs : nn=newName, rg=renameGrps, rc=renameChd, rs=renameSibs, nl=nodesList, nu=nextUniqueName]

Purpose:

:: Renames the asNode or a group of nodes according to various criteria. Useful for batch renaming and organizing nodes in the scene.

Parameters:
  • newName – <str, optional> #The new name for the asNode.

  • renameGrps – <int/list, optional> #Specifies parents to rename, either by index or list of names.

  • renameChd – <int/list, optional> #Specifies children to rename, either by index or list of names.

  • renameSibs – <int/list, optional> #Specifies siblings to rename, either by index or list of names.

  • nodesList – <dict, optional> #A dictionary of nodes and their new names for batch renaming.

  • nextUniqueName – <bool, optional> #Determines whether to generate a unique name for the asNode.

Returns:

<None> #No return value, nodes are renamed as specified.

Args:

newName = nameStr - Rename the object to given newName. And updates the name of instance.. renameGrps = None | int | [name1, name2, .. etc] - Renames parents at given index or for given no of names renameChd(WIP) = None | int | [num] | [name1, name2, .. etc] - Renames Children at given index or for given no of names

  • [num] : Renames list of given number of nodes

  • num : Renames parent node at given number

renameSibs(WIP) = None | int | [name1, name2, .. etc] - Renames Siblings at given index or for given no of names nodeList(WIP) = None | {node1:name1, node2: name2, .. etc} - Renames nodes as given in dict nextUniqueName(WIP) = self.asObj() updated with next unique name

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateArgs["/fas:fa-edit Update Arguments"] UpdateArgs --> CheckNewName{{"/fas:fa-search-plus Check New Name"}} CheckNewName --"If newName" --> RenameNode["/fas:fa-i-cursor Rename Node"] CheckNewName --"If no newName" --> CheckRenameGroups{{"/fas:fa-code-branch Check Rename Groups"}} RenameNode --> CheckRenameGroups CheckRenameGroups --"If renameGrps" --> ProcessRenameGroups["/fas:fa-cogs Process Rename Groups"] CheckRenameGroups --"If no renameGrps" --> CheckRenameChildren{{"/fas:fa-users Check Rename Children"}} ProcessRenameGroups --> CheckRenameChildren CheckRenameChildren --"If renameChd" --> RenameChildren["/fas:fa-user-plus Rename Children"] CheckRenameChildren --"If no renameChd" --> CheckRenameSiblings{{"/fas:fa-user-friends Check Rename Siblings"}} RenameChildren --> CheckRenameSiblings CheckRenameSiblings --"If renameSibs" --> RenameSiblings["/fas:fa-users-cog Rename Siblings"] CheckRenameSiblings --"If no renameSibs" --> CheckNodesList{{"/fas:fa-list Check Nodes List"}} RenameSiblings --> CheckNodesList CheckNodesList --"If nodesList" --> BatchRenameNodes["/fas:fa-list-ol Batch Rename Nodes"] CheckNodesList --"If no nodesList" --> CheckNextUniqueName{{"/fas:fa-search-plus Check Next Unique Name"}} BatchRenameNodes --> CheckNextUniqueName CheckNextUniqueName --"If nextUniqueName" --> GenerateUniqueName["/fas:fa-random Generate Unique Name"] CheckNextUniqueName --"If no nextUniqueName" --> End[("fas:fa-stop End")] GenerateUniqueName --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateArgs fill:#ff9999,stroke:#000,stroke-width:2px style CheckNewName fill:#99ccff,stroke:#000,stroke-width:2px style RenameNode fill:#cc99ff,stroke:#000,stroke-width:2px style CheckRenameGroups fill:#99ff99,stroke:#000,stroke-width:2px style ProcessRenameGroups fill:#ff9999,stroke:#000,stroke-width:2px style CheckRenameChildren fill:#99ccff,stroke:#000,stroke-width:2px style RenameChildren fill:#cc99ff,stroke:#000,stroke-width:2px style CheckRenameSiblings fill:#99ff99,stroke:#000,stroke-width:2px style RenameSiblings fill:#ff9999,stroke:#000,stroke-width:2px style CheckNodesList fill:#99ccff,stroke:#000,stroke-width:2px style BatchRenameNodes fill:#cc99ff,stroke:#000,stroke-width:2px style CheckNextUniqueName fill:#99ff99,stroke:#000,stroke-width:2px style GenerateUniqueName fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the rename function:

  1. The process starts by checking if shArgs are provided and updating arguments accordingly.

  2. It checks for the newName parameter and renames the node if provided.

  3. The function then checks for renameGrps, renameChd, and renameSibs parameters to rename groups, children, and siblings, respectively.

  4. If nodesList is provided, it performs batch renaming of nodes as specified in the dictionary.

  5. If nextUniqueName is true, the function generates a unique name for the asNode.

  6. The process ends after executing the appropriate renaming actions based on the provided parameters.

asNode.reorderDeformers(self, deformTypes=None, **shArgs)#

[shArgs : dt=deformTypes]

Purpose:

:: Reorders the deformers applied to the asNode, allowing for customized deformation stacking order.

Parameters:

deformTypes – <list, optional> #A list of deformer types to reorder (e.g., ‘skinCluster’, ‘blendShape’). deformTypes =[‘sculpt’, ‘skinCluster’, ‘cMuscleRelative’, ‘nonLinear’, ‘cluster’, ‘blendShape’, ‘ffd’, ‘wrap’, ‘tweak’]

Returns:

<None> #No return value, deformers are reordered as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateDeformTypes["/fas:fa-edit Update Deform Types"] UpdateDeformTypes --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetDefaultDeformTypes["/fas:fa-list-ul Set Default Deform Types"] SetDefaultDeformTypes --> SetNcTypes SetNcTypes --> InitializeDeformList["/fas:fa-list-ul Initialize Deform List"] InitializeDeformList --> LoopDeformTypes{{"/fas:fa-repeat Loop Deform Types"}} LoopDeformTypes --> CollectDeformers["/fas:fa-cogs Collect Deformers"] CollectDeformers --> CheckDeformListNotEmpty{{"/fas:fa-question Check Deform List Not Empty"}} CheckDeformListNotEmpty --"If Deform List Not Empty" --> CheckMultipleDeformers{{"/fas:fa-question Check Multiple Deformers"}} CheckDeformListNotEmpty --"If Deform List Empty" --> PrintDeformTypes["/fas:fa-print Print Deform Types"] CheckMultipleDeformers --"If Multiple Deformers" --> ReorderAllDeformers["/fas:fa-sort Reorder All Deformers"] ReorderAllDeformers --> CheckFirstListMultiple{{"/fas:fa-question Check First List Multiple"}} CheckMultipleDeformers --"If Single Deformer" --> CheckFirstListMultiple CheckFirstListMultiple --"If First List Multiple" --> ReorderFirstList["/fas:fa-sort Reorder First List"] CheckFirstListMultiple --"If First List Single" --> PrintDeformTypes ReorderFirstList --> PrintDeformTypes PrintDeformTypes --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateDeformTypes fill:#ff9999,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultDeformTypes fill:#cc99ff,stroke:#000,stroke-width:2px style InitializeDeformList fill:#99ff99,stroke:#000,stroke-width:2px style LoopDeformTypes fill:#ff9999,stroke:#000,stroke-width:2px style CollectDeformers fill:#99ccff,stroke:#000,stroke-width:2px style CheckDeformListNotEmpty fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMultipleDeformers fill:#99ff99,stroke:#000,stroke-width:2px style ReorderAllDeformers fill:#ff9999,stroke:#000,stroke-width:2px style CheckFirstListMultiple fill:#ffcc00,stroke:#000,stroke-width:2px style ReorderFirstList fill:#99ccff,stroke:#000,stroke-width:2px style PrintDeformTypes fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the reorderDeformers function:

  1. The process starts by checking if shArgs are provided and updating deform types accordingly.

  2. ncTypes are set, followed by initializing a list of deformers.

  3. The function loops through the deform types, collecting deformers for each type.

  4. If the deform list is not empty, the function checks for multiple deformers.

  5. All deformers are reordered if multiple are found, and the first list of deformers is reordered if it contains multiple deformers.

  6. Finally, the types of deformers processed are printed, concluding the function.

asNode.reverseConnect(self, srcAttr, trgtObj, trgtAttr=None, zeroToOne=False, **kwargs)#

[shArgs : sa=srcAttr, to=trgtObj, ta=trgtAttr, zto=zeroToOne]

Purpose:

:: Creates a reversed connection from a source attribute to a target object or attribute.

Parameters:
  • srcAttr – <str> #The source attribute to reverse connect from.

  • trgtObj – <asNode> #The target object for the connection.

  • trgtAttr – <str, optional> #The target attribute for the connection.

  • zeroToOne – <bool> #Determines whether to reverse the connection from 0 to 1.

Returns:

<None> #No return value, a reverse connection is established.

_images/reverseConnect.jpg
Flow Chart Description:

This flowchart illustrates the reverseConnect function:

  1. The function begins by checking shArgs and updating the source attribute, target object, target attribute, and zeroToOne flag.

  2. Based on the zeroToOne flag, it either sets up a Multiply Divide Node or a Reverse Node.

  3. It then checks if the source attribute is a Double3 attribute and connects accordingly to the appropriate node.

  4. The output from the MD or Reverse Node is then connected to the target attribute.

  5. The process concludes once the connection is established.

asNode.reverseCurve(self, keepHistory=0, **shArgs)#

[shArgs : kh=keepHistory]

Purpose:

:: Reverses the direction of a curve, commonly used in rigging and animation for directional consistency.

Parameters:

keepHistory – <bool> #Determines whether to keep the construction history on the curve.

Returns:

<None> #No return value, the curve direction is reversed.

Flow Chart Description:

This flowchart illustrates the reverseCurve function:

  1. The process begins by checking if shArgs are provided and updates the keepHistory flag accordingly.

  2. The function then selects the curve to be reversed.

  3. The Maya command reverseCurve is executed with the option for keeping history based on the keepHistory flag.

  4. The function concludes after reversing the direction of the curve.

asNode.root(self)#

[shArgs]

Purpose:

:: Retrieves the root node of the asNode, especially useful in rigging to find the base of joint chains or hierarchies.

Returns:

<asNode> #The root node of the asNode.

graph TB Start[("(fa:fa-play Start)")] --> SetNcTypes["/fas:fa-stream Set ncTypes"] SetNcTypes --> CheckParentExists{{"/fas:fa-question Check if Parent Exists"}} CheckParentExists --"If Parent Exists" --> RetrieveRootNode["/fas:fa-tree Retrieve Root Node"] CheckParentExists --"If No Parent" --> ReturnSelf["/fas:fa-arrow-circle-right Return Self as Root"] RetrieveRootNode --> End[("fas:fa-stop End")] ReturnSelf --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SetNcTypes fill:#99ccff,stroke:#000,stroke-width:2px style CheckParentExists fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveRootNode fill:#99ff99,stroke:#000,stroke-width:2px style ReturnSelf fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the root function:

  1. The function begins by setting the necessary node types.

  2. It checks if the asNode has a parent.

  3. If the asNode has a parent, the function retrieves the root node of the hierarchy.

  4. If the asNode does not have a parent, it returns the asNode itself as the root node.

asNode.rotateBy(self, valList=[0, 90, 0], rAttr=None, mSpace=1, **shArgs)#

[shArgs : vl=valList, ra=rAttr, ms=mSpace]

Purpose:

:: Rotates the asNode by specified values in either object or world space.

Parameters:
  • valList – <list> #The rotation values to apply (e.g., [0, 90, 0]).

  • rAttr – <str, optional> #A specific rotation attribute to rotate by. rAttr =[‘ry’, val], if rAttr is given, valList will be neglected ..

  • mSpace – <int> #Determines the space (‘0’ for Object, ‘1’ for World) for the rotation. mSpace ==0 : ‘Object Space’ mSpace ==1 : ‘World Space’

Returns:

<None> #No return value, the asNode is rotated as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateValList["/fas:fa-edit Update valList"] UpdateValList --> UpdateRAttr["/fas:fa-edit Update rAttr"] UpdateRAttr --> UpdateMSpace["/fas:fa-edit Update mSpace"] UpdateMSpace --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> CheckRAttr{{"/fas:fa-search-plus Check rAttr"}} CheckRAttr --"If rAttr" --> RotateByRAttr["/fas:fa-sync-alt Rotate By rAttr"] CheckRAttr --"If No rAttr" --> DetermineSpace{{"/fas:fa-globe Determine Space"}} RotateByRAttr --> RefreshView["/fas:fa-refresh Refresh View"] DetermineSpace --"If mSpace is 0" --> SetObjectSpace["/fas:fa-cube Set Object Space"] DetermineSpace --"If mSpace is 1" --> SetWorldSpace["/fas:fa-globe Set World Space"] SetObjectSpace --> PerformRotation["/fas:fa-redo-alt Perform Rotation"] SetWorldSpace --> PerformRotation PerformRotation --> RefreshView RefreshView --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateValList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateRAttr fill:#99ccff,stroke:#000,stroke-width:2px style UpdateMSpace fill:#cc99ff,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ff99,stroke:#000,stroke-width:2px style CheckRAttr fill:#ff9999,stroke:#000,stroke-width:2px style RotateByRAttr fill:#99ccff,stroke:#000,stroke-width:2px style DetermineSpace fill:#cc99ff,stroke:#000,stroke-width:2px style RefreshView fill:#99ff99,stroke:#000,stroke-width:2px style SetObjectSpace fill:#ff9999,stroke:#000,stroke-width:2px style SetWorldSpace fill:#99ccff,stroke:#000,stroke-width:2px style PerformRotation fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the rotateBy function:

  1. The function starts with checking if any shArgs are provided and updates parameters accordingly.

  2. It sets the necessary node types for the operation.

  3. The function checks if rAttr is provided to perform rotation on a specific attribute.

  4. If rAttr is not provided, it determines the space (Object or World) for the rotation.

  5. The asNode is rotated by the specified values in either object or world space.

  6. Finally, the view is refreshed to reflect the rotation change on the asNode.

asNode.scaleBy(self, valList=[1, 1, 1], freezeIt=False, asIncrement=False, refreshView=True, **shArgs)#

[shArgs : vl=valList, fi=freezeIt, ai=asIncrement, rv=refreshView]

Purpose:

:: Scales the asNode by specified values, with options for freezing transformations and incrementally applying the scale.

Parameters:
  • valList – <list> #The scale values to apply (e.g., [1, 1, 1]).

  • freezeIt – <bool> #Determines whether to freeze the transformations after scaling.

  • asIncrement – <bool> #Specifies whether to apply the scale as an increment.

  • refreshView – <bool> #Determines whether to refresh the view after scaling.

Returns:

<None> #No return value, the asNode is scaled as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateValList["/fas:fa-edit Update valList"] UpdateValList --> UpdateFreezeIt["/fas:fa-snowflake-o Update freezeIt"] UpdateFreezeIt --> UpdateAsIncrement["/fas:fa-plus-circle Update asIncrement"] UpdateAsIncrement --> UpdateRefreshView["/fas:fa-refresh Update refreshView"] UpdateRefreshView --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> CheckValListType{{"/fas:fa-question Check valList Type"}} CheckValListType --"If valList is List" --> ScaleNodeList["/fas:fa-arrows-alt Scale Node (List)"] CheckValListType --"If valList is Number" --> CheckAsIncrement{{"/fas:fa-question Check asIncrement"}} CheckAsIncrement --"If asIncrement" --> ScaleNodeIncrement["/fas:fa-arrows-alt-h Scale Node (Increment)"] CheckAsIncrement --"If not asIncrement" --> ConvertToList["/fas:fa-list-ol Convert to List"] ConvertToList --> ScaleNodeList ScaleNodeIncrement --> CheckRefreshView{{"/fas:fa-question Check Refresh View"}} ScaleNodeList --> CheckFreezeIt{{"/fas:fa-question Check Freeze It"}} CheckFreezeIt --"If Freeze It" --> FreezeTransformations["/fas:fa-ice-cream Freeze Transformations"] CheckFreezeIt --"If not Freeze It" --> CheckRefreshView FreezeTransformations --> CheckRefreshView CheckRefreshView --"If Refresh View" --> RefreshView["/fas:fa-sync-alt Refresh View"] CheckRefreshView --"If not Refresh View" --> End[("fas:fa-stop End")] RefreshView --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateValList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateFreezeIt fill:#99ccff,stroke:#000,stroke-width:2px style UpdateAsIncrement fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateRefreshView fill:#99ff99,stroke:#000,stroke-width:2px style SetNcTypes fill:#ff9999,stroke:#000,stroke-width:2px style CheckValListType fill:#cc99ff,stroke:#000,stroke-width:2px style ScaleNodeList fill:#99ccff,stroke:#000,stroke-width:2px style CheckAsIncrement fill:#99ff99,stroke:#000,stroke-width:2px style ScaleNodeIncrement fill:#ff9999,stroke:#000,stroke-width:2px style ConvertToList fill:#99ccff,stroke:#000,stroke-width:2px style CheckFreezeIt fill:#cc99ff,stroke:#000,stroke-width:2px style FreezeTransformations fill:#99ff99,stroke:#000,stroke-width:2px style CheckRefreshView fill:#ff9999,stroke:#000,stroke-width:2px style RefreshView fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the scaleBy function:

  1. The function begins by checking if any shArgs are provided and updates parameters accordingly.

  2. It sets necessary node types for the operation.

  3. The function then checks the type of valList (whether it’s a list or a number).

  4. If valList is a number, it determines if scaling should be applied incrementally.

  5. The asNode is scaled by the specified values.

  6. If freezeIt is true, the transformations on the node are frozen.

  7. Finally, if refreshView is true, the view is refreshed to reflect the scale change on the asNode.

asNode.searchReplaceHI(self, searchWord, replaceWord, topSelect=True, selectHI=True, **shArgs)#

[shArgs : sw=searchWord, rw=replaceWord, ts=topSelect, si=selectHI]

Purpose:

:: Searches and replaces words in the names of nodes under the asNode, useful in renaming and organizing large hierarchies.

Parameters:
  • searchWord – <str> #The word to search for in the node names.

  • replaceWord – <str> #The word to replace the search word with.

  • topSelect – <bool> #Determines whether to include the top node in the process.

  • selectHI – <bool> #Specifies whether to select the entire hierarchy during the process.

Returns:

<list> #A list of nodes with replaced or renamed words.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateSearchWord["/fas:fa-edit Update Search Word"] UpdateSearchWord --> UpdateReplaceWord["/fas:fa-edit Update Replace Word"] UpdateReplaceWord --> UpdateTopSelect["/fas:fa-edit Update Top Select"] UpdateTopSelect --> UpdateSelectHI["/fas:fa-edit Update Select Hierarchy"] UpdateSelectHI --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> SelectTopNode["/fas:fa-mouse-pointer Select Top Node"] SelectTopNode --> SelectHierarchy["/fas:fa-sitemap Select Hierarchy"] SelectHierarchy --> DeselectShapes["/fas:fa-times-circle Deselect Shapes"] DeselectShapes --> ReverseNodeList["/fas:fa-undo-alt Reverse Node List"] ReverseNodeList --> LoopThroughNodes{{"/fas:fa-repeat Loop Through Nodes"}} LoopThroughNodes --> CheckNodeShape{{"/fas:fa-question Check Node Shape"}} CheckNodeShape --"If Not Shape Node" --> RenameNode["/fas:fa-i-cursor Rename Node"] CheckNodeShape --"If Shape Node" --> SkipNode["/fas:fa-forward Skip Node"] RenameNode --> AddToFinalList["/fas:fa-plus-circle Add to Final List"] SkipNode --> LoopThroughNodes AddToFinalList --> CheckMoreNodes{{"/fas:fa-question Check More Nodes"}} CheckMoreNodes --"If More Nodes" --> LoopThroughNodes CheckMoreNodes --"If No More Nodes" --> FinalizeList["/fas:fa-check-circle Finalize List"] FinalizeList --> ReturnFinalList["/fas:fa-check-circle Return Final List"] ReturnFinalList --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSearchWord fill:#ff9999,stroke:#000,stroke-width:2px style UpdateReplaceWord fill:#99ccff,stroke:#000,stroke-width:2px style UpdateTopSelect fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateSelectHI fill:#99ff99,stroke:#000,stroke-width:2px style SetNcTypes fill:#ff9999,stroke:#000,stroke-width:2px style SelectTopNode fill:#cc99ff,stroke:#000,stroke-width:2px style SelectHierarchy fill:#99ff99,stroke:#000,stroke-width:2px style DeselectShapes fill:#ff9999,stroke:#000,stroke-width:2px style ReverseNodeList fill:#99ccff,stroke:#000,stroke-width:2px style LoopThroughNodes fill:#cc99ff,stroke:#000,stroke-width:2px style CheckNodeShape fill:#99ff99,stroke:#000,stroke-width:2px style RenameNode fill:#ff9999,stroke:#000,stroke-width:2px style SkipNode fill:#99ccff,stroke:#000,stroke-width:2px style AddToFinalList fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMoreNodes fill:#99ff99,stroke:#000,stroke-width:2px style FinalizeList fill:#ff9999,stroke:#000,stroke-width:2px style ReturnFinalList fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the searchReplaceHI function:

  1. The process begins by checking if any shArgs are provided and updating parameters accordingly.

  2. The necessary node types are set.

  3. The top node is selected, and then the entire hierarchy under it is selected.

  4. Shape nodes are deselected from the hierarchy.

  5. The node list is reversed to start renaming from the bottom of the hierarchy.

  6. A loop is initiated to go through each node.

  7. For each node, if it’s not a shape node, it’s renamed based on the search and replace words.

  8. Renamed nodes are added to the final list.

  9. The process continues until all nodes are processed.

  10. Finally, the final list of renamed nodes is returned.

asNode.select(self, addNext=None, *args, **kwargs)#

[shArgs : an=addNext, *args, **kwargs]

Purpose:

:: Selects the asNode with various options for modifying the selection set.

Parameters:

addNext – <bool, optional> #Determines whether to add the next node in the sequence to the selection.

Args, kwargs:

Additional arguments for more complex selection criteria.

Flags:

Available flags : ‘r’, ‘relative’, ‘add’, ‘af’, ‘addFirst’, ‘d’, ‘deselect’, ‘tgl’, ‘toggle’

Returns:

<None> #No return value, the asNode is selected as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckKwargs{{"/fas:fa-question Check kwargs"}} CheckKwargs --"If kwargs provided" --> UpdateAddNext["/fas:fa-edit Update AddNext"] UpdateAddNext --> SetDefaultSelectMode["/fas:fa-check-circle Set Default Select Mode"] CheckKwargs --"If kwargs not provided" --> SetReplaceSelectMode["/fas:fa-times-circle Set Replace Select Mode"] SetDefaultSelectMode --> PerformSelect["/fas:fa-mouse-pointer Perform Select"] SetReplaceSelectMode --> PerformSelect PerformSelect --> CheckAddNext{{"/fas:fa-question Check AddNext"}} CheckAddNext --"If AddNext" --> ProcessAddNext["/fas:fa-plus-square Process AddNext"] CheckAddNext --"If Not AddNext" --> End[("fas:fa-stop End")] ProcessAddNext --> AddNextNodes["/fas:fa-plus Add Next Nodes"] AddNextNodes --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckKwargs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAddNext fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultSelectMode fill:#99ccff,stroke:#000,stroke-width:2px style SetReplaceSelectMode fill:#cc99ff,stroke:#000,stroke-width:2px style PerformSelect fill:#99ff99,stroke:#000,stroke-width:2px style CheckAddNext fill:#ff9999,stroke:#000,stroke-width:2px style ProcessAddNext fill:#99ccff,stroke:#000,stroke-width:2px style AddNextNodes fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the select function:

  1. The process starts by checking if additional keyword arguments (kwargs) are provided.

  2. If kwargs are provided, it updates the addNext parameter and sets the default selection mode.

  3. If kwargs are not provided, it sets the selection mode to replace.

  4. The function then performs the selection of the asNode based on the specified mode.

  5. If addNext is specified, it processes additional nodes to be added to the selection.

  6. The function adds the specified addNext nodes to the current selection.

  7. The selection process is then completed.

asNode.selectHI(self, objType='jnt', topSelect=True, includeShapes=False, childImplied=1, getNodes=1, startsWith=None, endsWith=None, **shArgs)#

[shArgs : ot=objType, ts=topSelect, ish=includeShapes, ci=childImplied, gn=getNodes, sw=startsWith, ew=endsWith]

Purpose:

:: Selects all objects of a given type or excludes a specific type under the asNode. This function is pivotal in scene management for selective hierarchy operations.

Parameters:
  • objType – <str> #The type of objects to select or exclude (e.g., ‘jnt’, ‘mesh’).

  • topSelect – <bool> #Determines whether to include the top node in the selection.

  • includeShapes – <bool> #Specifies whether to include shape nodes in the selection.

  • childImplied – <bool> #Considers implied child nodes in the selection.

  • getNodes – <bool> #Specifies whether to return the selected nodes.

  • startsWith – <str, optional> #Selects nodes that start with the specified string.

  • endsWith – <str, optional> #Selects nodes that end with the specified string.

Returns:

<list> #A list of selected nodes based on the criteria. return nselected() #_ asNodes

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateObjType["/fas:fa-edit Update objType"] UpdateObjType --> UpdateTopSelect["/fas:fa-edit Update topSelect"] UpdateTopSelect --> UpdateIncludeShapes["/fas:fa-edit Update includeShapes"] UpdateIncludeShapes --> UpdateChildImplied["/fas:fa-edit Update childImplied"] UpdateChildImplied --> UpdateGetNodes["/fas:fa-edit Update getNodes"] UpdateGetNodes --> UpdateStartsWith["/fas:fa-edit Update startsWith"] UpdateStartsWith --> UpdateEndsWith["/fas:fa-edit Update endsWith"] UpdateEndsWith --> SetNcTypes["/fas:fa-stream Set ncTypes"] CheckShArgs --"If shArgs not provided" --> SetNcTypes SetNcTypes --> SelectTopNode["/fas:fa-mouse-pointer Select Top Node"] SelectTopNode --> SelectHierarchy["/fas:fa-sitemap Select Hierarchy"] SelectHierarchy --> CheckChildImplied{{"/fas:fa-question Check childImplied"}} CheckChildImplied --"If childImplied" --> SelectChildImplied["/fas:fa-child Select Child Implied"] CheckChildImplied --"If Not childImplied" --> ProcessSelection["/fas:fa-cogs Process Selection"] SelectChildImplied --> ProcessSelection ProcessSelection --> CheckObjType{{"/fas:fa-question Check objType"}} CheckObjType --"If objType Specified" --> FilterObjType["/fas:fa-filter Filter by objType"] CheckObjType --"If No objType" --> CheckTopSelect{{"/fas:fa-question Check Top Select"}} FilterObjType --> CheckExclude{{"/fas:fa-question Check Exclude"}} CheckExclude --"If Exclude Shapes" --> ExcludeShapes["/fas:fa-times-circle Exclude Shapes"] CheckExclude --"If Include Shapes" --> CheckTopSelect ExcludeShapes --> CheckTopSelect CheckTopSelect --"If Not Top Select" --> DeselectTop["/fas:fa-minus-circle Deselect Top"] CheckTopSelect --"If Top Select" --> CheckStartsWith{{"/fas:fa-question Check startsWith"}} DeselectTop --> CheckStartsWith CheckStartsWith --"If startsWith" --> FilterStartsWith["/fas:fa-filter Filter by startsWith"] CheckStartsWith --"If No startsWith" --> CheckEndsWith{{"/fas:fa-question Check endsWith"}} FilterStartsWith --> CheckEndsWith CheckEndsWith --"If endsWith" --> FilterEndsWith["/fas:fa-filter Filter by endsWith"] CheckEndsWith --"If No endsWith" --> FinalizeSelection["/fas:fa-check-circle Finalize Selection"] FilterEndsWith --> FinalizeSelection FinalizeSelection --> CheckGetNodes{{"/fas:fa-question Check getNodes"}} CheckGetNodes --"If getNodes" --> ReturnSelectedNodes["/fas:fa-check-circle Return Selected Nodes"] CheckGetNodes --"If Not getNodes" --> End[("fas:fa-stop End")] ReturnSelectedNodes --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObjType fill:#ff9999,stroke:#000,stroke-width:2px style UpdateTopSelect fill:#99ccff,stroke:#000,stroke-width:2px style UpdateIncludeShapes fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateChildImplied fill:#99ff99,stroke:#000,stroke-width:2px style UpdateGetNodes fill:#ff9999,stroke:#000,stroke-width:2px style UpdateStartsWith fill:#99ccff,stroke:#000,stroke-width:2px style UpdateEndsWith fill:#cc99ff,stroke:#000,stroke-width:2px style SetNcTypes fill:#99ff99,stroke:#000,stroke-width:2px style SelectTopNode fill:#ff9999,stroke:#000,stroke-width:2px style SelectHierarchy fill:#99ccff,stroke:#000,stroke-width:2px style CheckChildImplied fill:#cc99ff,stroke:#000,stroke-width:2px style SelectChildImplied fill:#99ff99,stroke:#000,stroke-width:2px style ProcessSelection fill:#ff9999,stroke:#000,stroke-width:2px style CheckObjType fill:#99ccff,stroke:#000,stroke-width:2px style FilterObjType fill:#cc99ff,stroke:#000,stroke-width:2px style CheckExclude fill:#99ff99,stroke:#000,stroke-width:2px style ExcludeShapes fill:#ff9999,stroke:#000,stroke-width:2px style CheckTopSelect fill:#99ccff,stroke:#000,stroke-width:2px style DeselectTop fill:#cc99ff,stroke:#000,stroke-width:2px style CheckStartsWith fill:#99ff99,stroke:#000,stroke-width:2px style FilterStartsWith fill:#ff9999,stroke:#000,stroke-width:2px style CheckEndsWith fill:#99ccff,stroke:#000,stroke-width:2px style FilterEndsWith fill:#cc99ff,stroke:#000,stroke-width:2px style FinalizeSelection fill:#99ff99,stroke:#000,stroke-width:2px style CheckGetNodes fill:#ff9999,stroke:#000,stroke-width:2px style ReturnSelectedNodes fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the selectHI function:

  1. The function begins by checking if any shArgs are provided and updates parameters accordingly.

  2. It sets necessary node types for the operation.

  3. The asNode is selected and the entire hierarchy under it is selected.

  4. If childImplied is true, any implied child nodes are also selected.

  5. The selection is then processed based on objType, startsWith, endsWith, and whether to include or exclude shapes.

  6. If topSelect is false, the top node is deselected from the hierarchy.

  7. The selection is finalized, and if getNodes is true, the selected nodes are returned.

asNode.selectSeries(self, srRange=None, fromEnd=True, skipCount=0, selectNodes=True, autoNext=True, **shArgs)#

[shArgs : sr=srRange, fe=fromEnd, sc=skipCount, sn=selectNodes, an=autoNext]

Purpose:

:: Selects a series of nodes based on a range, direction, and other criteria, primarily used in sequential operations in rigging and animation.

Parameters:
  • srRange – <list, optional> #The range for selecting nodes.

  • fromEnd – <bool> #Determines whether to start the selection from the end.

  • skipCount – <int> #The number of nodes to skip in each step of the selection.

  • selectNodes – <bool> #Specifies whether to select the nodes.

  • autoNext – <bool> #Automatically moves to the next set of nodes in the series.

Returns:

<list/None> #A list of selected nodes or None if no nodes are selected.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateSrRange["/fas:fa-edit Update SrRange"] UpdateSrRange --> UpdateFromEnd["/fas:fa-edit Update FromEnd"] UpdateFromEnd --> UpdateSkipCount["/fas:fa-edit Update SkipCount"] UpdateSkipCount --> UpdateSelectNodes["/fas:fa-edit Update SelectNodes"] UpdateSelectNodes --> UpdateAutoNext["/fas:fa-edit Update AutoNext"] UpdateAutoNext --> ExtractNum["/fas:fa-cogs Extract Number"] ExtractNum --> CheckSrRange{{"/fas:fa-question Check SrRange"}} CheckSrRange --"If SrRange" --> GetAllNodes["/fas:fa-sitemap Get All Nodes"] CheckSrRange --"If No SrRange" --> SelectPatternNodes["/fas:fa-mouse-pointer Select Pattern Nodes"] GetAllNodes --> CheckSelectNodes{{"/fas:fa-question Check SelectNodes"}} SelectPatternNodes --> CheckSelectNodes CheckSelectNodes --"If SelectNodes" --> SelectNodes["/fas:fa-mouse-pointer Select Nodes"] CheckSelectNodes --"If Not SelectNodes" --> End[("fas:fa-stop End")] SelectNodes --> CheckAutoNext{{"/fas:fa-question Check AutoNext"}} CheckAutoNext --"If AutoNext" --> ProcessAutoNext["/fas:fa-repeat Process AutoNext"] CheckAutoNext --"If Not AutoNext" --> End ProcessAutoNext --> ReturnNodesList["/fas:fa-check-circle Return Nodes List"] ReturnNodesList --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSrRange fill:#ff9999,stroke:#000,stroke-width:2px style UpdateFromEnd fill:#99ccff,stroke:#000,stroke-width:2px style UpdateSkipCount fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateSelectNodes fill:#99ff99,stroke:#000,stroke-width:2px style UpdateAutoNext fill:#ff9999,stroke:#000,stroke-width:2px style ExtractNum fill:#99ccff,stroke:#000,stroke-width:2px style CheckSrRange fill:#cc99ff,stroke:#000,stroke-width:2px style GetAllNodes fill:#99ff99,stroke:#000,stroke-width:2px style SelectPatternNodes fill:#ff9999,stroke:#000,stroke-width:2px style CheckSelectNodes fill:#ffcc00,stroke:#000,stroke-width:2px style SelectNodes fill:#99ccff,stroke:#000,stroke-width:2px style CheckAutoNext fill:#cc99ff,stroke:#000,stroke-width:2px style ProcessAutoNext fill:#99ff99,stroke:#000,stroke-width:2px style ReturnNodesList fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the selectSeries function:

  1. The process begins by checking if additional keyword arguments (shArgs) are provided and updates various parameters such as srRange, fromEnd, and skipCount.

  2. The function then extracts a number from the node’s name and checks if a specific range (srRange) is provided for selection.

  3. If a range is provided, it gets all nodes within that range; otherwise, it selects nodes based on a pattern.

  4. The function then checks if nodes should be selected (selectNodes) and proceeds to select them if required.

  5. If autoNext is enabled, the function automatically processes the next set of nodes in the series.

  6. Finally, the function returns a list of selected nodes and the total number of nodes selected.

asNode.setAttr(self, attr, *args, **kwargs)#

[shArgs: attr, *args, **kwargs]

Purpose:

:: Sets the value of an attribute on the asNode. This function is critical in rigging and animation for modifying attribute values.

Parameters:

attr – <str/list> #The name of the attribute to set. List of attrs can be provided at a time.

Args:

Additional arguments for setting the attribute.

Kwargs:

Additional keyword arguments for setting the attribute.

Returns:

<None> #No return value, the attribute is set to the specified value.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateAttr["/fas:fa-edit Update Attribute"] UpdateAttr --> InitializeAttrList["/fas:fa-list-ul Initialize Attribute List"] InitializeAttrList --> LoopAttrList{{"/fas:fa-repeat Loop Through Attribute List"}} LoopAttrList --> SetEachAttr["/fas:fa-tag Set Each Attribute"] SetEachAttr --> HandleTypeError{{"/fas:fa-exclamation-triangle Handle Type Error"}} SetEachAttr --"No Error" --> ContinueLoop{{"/fas:fa-arrow-right Continue Loop"}} HandleTypeError --> AdjustAttrType["/fas:fa-wrench Adjust Attribute Type"] AdjustAttrType --> RetrySetAttr["/fas:fa-redo Retry Set Attribute"] RetrySetAttr --> ContinueLoop ContinueLoop --"Continue Loop" --> LoopAttrList ContinueLoop --"End Loop" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateAttr fill:#ff9999,stroke:#000,stroke-width:2px style InitializeAttrList fill:#99ccff,stroke:#000,stroke-width:2px style LoopAttrList fill:#cc99ff,stroke:#000,stroke-width:2px style SetEachAttr fill:#99ff99,stroke:#000,stroke-width:2px style HandleTypeError fill:#ff9999,stroke:#000,stroke-width:2px style AdjustAttrType fill:#99ccff,stroke:#000,stroke-width:2px style RetrySetAttr fill:#cc99ff,stroke:#000,stroke-width:2px style ContinueLoop fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setAttr function:

  1. The process starts by checking if additional keyword arguments are provided and updates the attribute name.

  2. It initializes a list of attributes to be set.

  3. The function then loops through each attribute in the list.

  4. For each attribute, it attempts to set the attribute with the provided value(s).

  5. If a TypeError occurs, indicating a mismatch in attribute type, the function adjusts the attribute type and retries setting the attribute.

  6. The loop continues until all attributes in the list are processed.

  7. Finally, the function ends after processing all attributes.

asNode.setDisplayType(self, valOrAttr=0, addAttrDivider=0, refreshView=True, **shArgs)#

[shArgs: va=valOrAttr, ad=addAttrDivider, rv=refreshView]

Purpose:

:: Adjusts the display type of the asNode, often used in modeling and animation for visual clarity.

Parameters:
  • valOrAttr – <int/str> #The display type or attribute to set (0: Normal, 1: Template, 2: Reference). valOrAttr : 0 (Normal) | 1 (Template) | 2 (Reference) | srcAttr | srcObj

  • addAttrDivider – <bool> #Adds an attribute divider to the driver object if valOrAttr is an object. addAttrDivider : Adds attrDivider to driver object if valOrAttr is object

  • refreshView – <bool> #Determines whether to refresh the view after setting the display type.

Returns:

<None> #No return value, the display type is adjusted as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateValOrAttr["/fas:fa-edit Update valOrAttr"] UpdateValOrAttr --> UpdateAddAttrDivider["/fas:fa-edit Update addAttrDivider"] UpdateAddAttrDivider --> CheckHasShape{{"/fas:fa-search-plus Check Has Shape"}} CheckHasShape --"If Has Shape" --> DisconnectShapeOverrides["/fas:fa-unlink Disconnect Shape Overrides"] DisconnectShapeOverrides --> DisconnectTransformOverrides["/fas:fa-unlink Disconnect Transform Overrides"] CheckHasShape --"If No Shape" --> DisconnectTransformOverrides DisconnectTransformOverrides --> EnableOverrides["/fas:fa-toggle-on Enable Overrides"] EnableOverrides --> DetermineValueType{{"/fas:fa-question Determine Value Type"}} DetermineValueType --"If Integer" --> SetDisplayTypeInt["/fas:fa-pencil-alt Set Display Type (Int)"] DetermineValueType --"If String/Object" --> CheckObjExists{{"/fas:fa-search-plus Check Object Exists"}} SetDisplayTypeInt --> CheckRefreshView{{"/fas:fa-refresh Check Refresh View"}} CheckObjExists --"If Object Exists" --> ConnectDisplayType["/fas:fa-link Connect Display Type"] CheckObjExists --"If Object Not Exists" --> WarningObjectNotExist["/fas:fa-exclamation-triangle Warning: Object Not Exist"] ConnectDisplayType --> CheckRefreshView WarningObjectNotExist --> CheckRefreshView CheckRefreshView --"If Refresh View" --> RefreshView["/fas:fa-sync-alt Refresh View"] CheckRefreshView --"If Not Refresh View" --> End[("fas:fa-stop End")] RefreshView --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateValOrAttr fill:#ff9999,stroke:#000,stroke-width:2px style UpdateAddAttrDivider fill:#99ccff,stroke:#000,stroke-width:2px style CheckHasShape fill:#cc99ff,stroke:#000,stroke-width:2px style DisconnectShapeOverrides fill:#99ff99,stroke:#000,stroke-width:2px style DisconnectTransformOverrides fill:#ff9999,stroke:#000,stroke-width:2px style EnableOverrides fill:#99ccff,stroke:#000,stroke-width:2px style DetermineValueType fill:#cc99ff,stroke:#000,stroke-width:2px style SetDisplayTypeInt fill:#99ff99,stroke:#000,stroke-width:2px style CheckObjExists fill:#ff9999,stroke:#000,stroke-width:2px style ConnectDisplayType fill:#99ccff,stroke:#000,stroke-width:2px style WarningObjectNotExist fill:#cc99ff,stroke:#000,stroke-width:2px style CheckRefreshView fill:#99ff99,stroke:#000,stroke-width:2px style RefreshView fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setDisplayType function:

  1. The process begins by checking for additional keyword arguments and updating the value or attribute (valOrAttr).

  2. It then checks if the asNode has a shape and disconnects any existing shape overrides.

  3. The function proceeds to disconnect transform overrides and enables override settings.

  4. Based on the type of valOrAttr (integer or string/object), the function either sets the display type directly or checks if the object exists for a connection.

  5. If an integer is used, the display type is set directly. If a string/object is provided, the function connects the display type attribute.

  6. The function concludes by checking if a view refresh is required and executing it if needed.

asNode.setName(self, newName, **shArgs)#

[shArgs: nn=newName]

Purpose:

:: Renames the asNode to a new name, used in organizing and identifying nodes in the scene.

Parameters:

newName – <str> #The new name for the asNode.

Returns:

<None> #No return value, the asNode is renamed.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateNewName["/fas:fa-edit Update newName"] UpdateNewName --> RenameNode["/fas:fa-i-cursor Rename Node"] CheckShArgs --"If shArgs not provided" --> RenameNode RenameNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateNewName fill:#ff9999,stroke:#000,stroke-width:2px style RenameNode fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setName function:

  1. The process begins by checking for additional keyword arguments and updating the new name for the asNode.

  2. It then proceeds to rename the asNode to the specified new name.

  3. The function concludes its operation with the node successfully renamed.

asNode.setPos(self, posList=[0, 0, 0], **shArgs)#

[shArgs: pl=posList]

Purpose:

:: Sets the position of the asNode in 3D space, essential for precise placement in rigging and animation.

Parameters:

posList – <list> #A list defining the new position [x, y, z].

Returns:

<None> #No return value, the asNode’s position is updated.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdatePosList["/fas:fa-edit Update posList"] UpdatePosList --> SelectNode["/fas:fa-mouse-pointer Select Node"] CheckShArgs --"If shArgs not provided" --> SelectNode SelectNode --> MoveNode["/fas:fa-arrows-alt Move Node"] MoveNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdatePosList fill:#ff9999,stroke:#000,stroke-width:2px style SelectNode fill:#99ff99,stroke:#000,stroke-width:2px style MoveNode fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setPos function:

  1. The process begins by checking if additional keyword arguments are provided, and updates the position list accordingly.

  2. The asNode is then selected.

  3. The asNode’s position is set to the new values specified in the position list.

  4. The function concludes with the asNode positioned at the new coordinates.

asNode.setPreferedAngle(self, poleLoc=None, poleDir='z', extnDist=2, **shArgs)#

[shArgs: pl=poleLoc, pd=poleDir, ed=extnDist]

Purpose:

:: Sets the preferred angle for joint rotation, crucial in rigging for defining default joint orientations.

Parameters:
  • poleLoc – <asNode, optional> #The locator node to define the preferred angle.

  • poleDir – <str> #The direction for the preferred angle (‘z’, ‘y’, etc.).

  • extnDist – <float> #The extension distance for setting the angle.

Returns:

<None> #No return value, the preferred angle is set.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdatePoleLoc["/fas:fa-edit Update Pole Location"] UpdatePoleLoc --> UpdatePoleDir["/fas:fa-edit Update Pole Direction"] UpdatePoleDir --> UpdateExtnDist["/fas:fa-edit Update Extension Distance"] CheckShArgs --"If shArgs not provided" --> SetDefaultPoleLoc["/fas:fa-location-arrow Set Default Pole Location"] SetDefaultPoleLoc --> UpdatePoleDir UpdatePoleDir --> GetPoleJoint["/fas:fa-sitemap Get Pole Joint"] GetPoleJoint --> CheckPoleLoc{{"/fas:fa-search-plus Check Pole Location"}} CheckPoleLoc --"If no Pole Location" --> GetPoleCtrl["/fas:fa-crosshairs Get Pole Control"] CheckPoleLoc --"If Pole Location exists" --> DetermineJointAxis["/fas:fa-arrows-alt Determine Joint Axis"] GetPoleCtrl --> DetermineJointAxis DetermineJointAxis --> SetRotationList["/fas:fa-sync-alt Set Rotation List"] SetRotationList --> CompareDistance{{"/fas:fa-ruler-combined Compare Distance"}} CompareDistance --"If test distance > original distance" --> SetPreferredAngle["/fas:fa-angle-double-right Set Preferred Angle"] CompareDistance --"If test distance <= original distance" --> RotateInverse["/fas:fa-undo-alt Rotate Inverse"] RotateInverse --> CompareDistanceInverse{{"/fas:fa-ruler-combined Compare Distance Inverse"}} CompareDistanceInverse --"If test distance > original distance" --> SetPreferredAngle CompareDistanceInverse --"If test distance <= original distance" --> RotateBack["/fas:fa-undo-alt Rotate Back"] SetPreferredAngle --> DeletePoleLoc["/fas:fa-trash-alt Delete Pole Location"] RotateBack --> DeletePoleLoc DeletePoleLoc --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdatePoleLoc fill:#ff9999,stroke:#000,stroke-width:2px style UpdatePoleDir fill:#99ccff,stroke:#000,stroke-width:2px style UpdateExtnDist fill:#cc99ff,stroke:#000,stroke-width:2px style SetDefaultPoleLoc fill:#99ff99,stroke:#000,stroke-width:2px style GetPoleJoint fill:#ff9999,stroke:#000,stroke-width:2px style CheckPoleLoc fill:#ffcc00,stroke:#000,stroke-width:2px style GetPoleCtrl fill:#99ccff,stroke:#000,stroke-width:2px style DetermineJointAxis fill:#cc99ff,stroke:#000,stroke-width:2px style SetRotationList fill:#99ff99,stroke:#000,stroke-width:2px style CompareDistance fill:#ff9999,stroke:#000,stroke-width:2px style SetPreferredAngle fill:#99ccff,stroke:#000,stroke-width:2px style RotateInverse fill:#cc99ff,stroke:#000,stroke-width:2px style CompareDistanceInverse fill:#99ff99,stroke:#000,stroke-width:2px style RotateBack fill:#ff9999,stroke:#000,stroke-width:2px style DeletePoleLoc fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setPreferedAngle function:

  1. The process begins by checking if specific arguments are provided and updates the pole location, direction, and extension distance.

  2. If no pole location is given, a default pole control is generated based on the extension distance and direction.

  3. The joint axis and twist axis are determined, and a rotation list is set for testing the preferred angle.

  4. The distance between the child joint and pole control is compared before and after applying the rotation list.

  5. Based on the comparison, the preferred angle is set, ensuring optimal joint rotation.

  6. Finally, any temporary pole control used for the process is deleted, completing the set up of the preferred angle.

asNode.setRot(self, rotList=[0, 0, 0], **shArgs)#

[shArgs: rl=rotList]

Purpose:

:: Sets the rotation of the asNode in 3D space, important in rigging and animation for orienting objects and characters.

Parameters:

rotList – <list> #A list defining the new rotation [x, y, z].

Returns:

<None> #No return value, the asNode’s rotation is updated.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateRotList["/fas:fa-edit Update Rotation List"] UpdateRotList --> SetRotation["/fas:fa-sync-alt Set Rotation"] CheckShArgs --"If shArgs not provided" --> SetDefaultRotList["/fas:fa-list-ol Set Default Rotation List"] SetDefaultRotList --> SetRotation SetRotation --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateRotList fill:#ff9999,stroke:#000,stroke-width:2px style SetRotation fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultRotList fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setRot function:

  1. The process begins by checking if specific arguments are provided and updates the rotation list accordingly.

  2. If no specific rotation list is provided, a default rotation list of [0, 0, 0] is set.

  3. The asNode’s rotation is then updated to match the specified or default rotation list, completing the orientation update.

asNode.setScale(self, refObj=None, refAttr=None, ratio=1.0, refVal=None, freezeIt=True, **shortArgs)#

[shArgs : ro=refObj, ra=refAttr, r=ratio, rv=refVal, fi=freezeIt]

Purpose:

:: Sets the scale of the asNode, often used in rigging and modeling to adjust the size of objects and characters.

Parameters:
  • refObj – <asNode, optional> #Reference object for scaling.

  • refAttr – <str, optional> #Attribute on the reference object for scaling.

  • ratio – <float> #Scaling ratio.

  • refVal – <float> #Reference value for scaling.

  • freezeIt – <bool> #Determines whether to freeze transformations after scaling.

Returns:

<None> #No return value, the asNode’s scale is adjusted.

Args: [**shortArgs : refObj =ro, refAttr =ra, ratio =r, refVal =rv, freezeIt=fi]:

ctrlList : strList                      #_ if ctrlList is None, ctrlList will be taken from selection.
refObj : str                                    #_ Reference object for reference Attribute. if refVal is given, it's neglected.
refAttr : str(Attr)                             #_ Reference Attr from refObj, if refVal is given, it's neglected.
ratio : int | float                     #_ Ratio will be taken from refVal or attrValue (from attribute)
refVal : int | float | posList  #_ If refObj and refAttr is not available, then refVal can be provided.

Usage:

eCtrl.setScale(ctrlName)[0]

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateRefObjAttr["/fas:fa-edit Update Reference Object/Attribute"] UpdateRefObjAttr --> CheckRefValRatio["/fas:fa-balance-scale-alt Check Reference Value and Ratio"] CheckShArgs --"If shArgs not provided" --> SetDefaultScale["/fas:fa-list-ol Set Default Scale"] CheckRefValRatio --"If RefVal and Ratio provided" --> CalculateScaleValList["/fas:fa-calculator Calculate Scale Value List"] CheckRefValRatio --"If Only RefVal or Only Ratio provided" --> SetScaleValList["/fas:fa-sliders-h Set Scale Value List"] SetDefaultScale --> SetScaleValList CalculateScaleValList --> ApplyScale["/fas:fa-expand-arrows-alt Apply Scale"] SetScaleValList --> ApplyScale ApplyScale --> CheckFreezeTransformations{{"/fas:fa-snowflake Check Freeze Transformations"}} CheckFreezeTransformations --"If Freeze Transformations" --> FreezeTransforms["/fas:fa-icicles Freeze Transformations"] CheckFreezeTransformations --"If Not Freeze Transformations" --> End[("fas:fa-stop End")] FreezeTransforms --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateRefObjAttr fill:#ff9999,stroke:#000,stroke-width:2px style CheckRefValRatio fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultScale fill:#cc99ff,stroke:#000,stroke-width:2px style CalculateScaleValList fill:#99ff99,stroke:#000,stroke-width:2px style SetScaleValList fill:#ff9999,stroke:#000,stroke-width:2px style ApplyScale fill:#99ccff,stroke:#000,stroke-width:2px style CheckFreezeTransformations fill:#ffcc00,stroke:#000,stroke-width:2px style FreezeTransforms fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setScale function:

  1. The function starts by checking if specific arguments are provided, updating reference object or attribute as needed.

  2. If reference value and ratio are provided, it calculates the scale value list based on these parameters.

  3. In cases where only reference value or ratio is provided, or neither, it sets a default or calculated scale value list.

  4. The scale is then applied to the asNode, adjusting its size in the scene.

  5. Finally, it checks if transformations should be frozen post-scaling, applying freeze transformations if needed.

asNode.setSibIndex(self, indexNum=0, prntImplied=True, **shArgs)#

[shArgs: in=indexNum, pi=prntImplied]

Purpose:

:: Sets the sibling index of the asNode, useful in scene organization for ordering objects within their hierarchy.

Parameters:
  • indexNum – <int> #The index number to set the asNode at amongst its siblings.

  • prntImplied – <bool> #Determines whether parent nodes are considered in setting the index.

Returns:

<None> #No return value, the sibling index is set.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateIndexNum["/fas:fa-edit Update Index Number"] UpdateIndexNum --> CheckPrntImplied{{"/fas:fa-question Check Parent Implied"}} CheckShArgs --"If shArgs not provided" --> SetDefaultPrntImplied["/fas:fa-check-square Set Default Parent Implied"] SetDefaultPrntImplied --> CheckPrntImplied CheckPrntImplied --"If Parent Implied" --> CheckAttributeQuery{{"/fas:fa-search-plus Check Attribute Query"}} CheckPrntImplied --"If Not Parent Implied" --> GetSibParent["/fas:fa-sitemap Get Sibling Parent"] CheckAttributeQuery --"Attribute Exists" --> CompareParents{{"/fas:fa-balance-scale Compare Parents"}} CompareParents --"Parents Match" --> SetIndexInParent["/fas:fa-sort-numeric-up Set Index In Parent"] CompareParents --"Parents Don't Match" --> ReturnTrue[("/fas:fa-check Return True")] GetSibParent --> CheckSibParentExists{{"/fas:fa-question Check Sibling Parent Exists"}} CheckSibParentExists --"If Sibling Parent Exists" --> GetSibCount["/fas:fa-list-ol Get Sibling Count"] CheckSibParentExists --"If No Sibling Parent" --> ReturnFalse[("/fas:fa-times-circle Return False")] GetSibCount --> AdjustIndexNum{{"/fas:fa-arrows-alt Adjust Index Number"}} AdjustIndexNum --> LoopCheckIndex{{"/fas:fa-repeat Loop Check Index"}} LoopCheckIndex --> GetCurrentSibIndex["/fas:fa-code-branch Get Current Sibling Index"] GetCurrentSibIndex --> CompareIndexNum{{"/fas:fa-balance-scale Compare Index Number"}} CompareIndexNum --"Index Match" --> End[("fas:fa-stop End")] CompareIndexNum --"Index Mismatch" --> ReorderSib["/fas:fa-random Reorder Sibling"] ReorderSib --> LoopCheckIndex ReturnTrue --> End ReturnFalse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateIndexNum fill:#ff9999,stroke:#000,stroke-width:2px style CheckPrntImplied fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultPrntImplied fill:#cc99ff,stroke:#000,stroke-width:2px style CheckAttributeQuery fill:#99ff99,stroke:#000,stroke-width:2px style CompareParents fill:#ff9999,stroke:#000,stroke-width:2px style SetIndexInParent fill:#99ccff,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:2px style GetSibParent fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSibParentExists fill:#ff9999,stroke:#000,stroke-width:2px style GetSibCount fill:#99ccff,stroke:#000,stroke-width:2px style AdjustIndexNum fill:#cc99ff,stroke:#000,stroke-width:2px style LoopCheckIndex fill:#99ff99,stroke:#000,stroke-width:2px style GetCurrentSibIndex fill:#ff9999,stroke:#000,stroke-width:2px style CompareIndexNum fill:#99ccff,stroke:#000,stroke-width:2px style ReorderSib fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setSibIndex function:

  1. The function begins by checking if specific arguments are provided, updating the index number accordingly.

  2. It then determines whether parent nodes are implied in the sibling index setting process.

  3. If parent nodes are implied, it checks for the presence of a specific attribute query.

  4. Depending on the comparison of parents, it either sets the index in the parent or returns true.

  5. If parent nodes are not implied, it gets the sibling parent and checks if it exists.

  6. The index number is then adjusted based on the sibling count, and a loop begins to check and set the correct index.

  7. The function concludes by either reordering the sibling or returning a false outcome if no sibling parent exists.

asNode.setSkinWeights(self, jntValDict, skinClust=None, **shArgs)#

[shArgs: jvd=jntValDict, sc=skinClust]

Purpose:

:: Assigns skin weights to joints, a key process in character rigging to control mesh deformation.

Parameters:
  • jntValDict – <dict> #Dictionary mapping joints to their corresponding weight values.

  • skinClust – <asNode, optional> #Skin cluster node to apply the weights to.

Returns:

<None> #No return value, the skin weights are assigned.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateJntValDict["/fas:fa-edit Update Joint-Value Dictionary"] UpdateJntValDict --> CheckSkinClust{{"/fas:fa-search-plus Check Skin Cluster"}} CheckShArgs --"If shArgs not provided" --> SetDefaultSkinClust["/fas:fa-check-square Set Default Skin Cluster"] SetDefaultSkinClust --> CheckSkinClust CheckSkinClust --"If Skin Cluster provided" --> AssignSkinWeights["/fas:fa-user-md Assign Skin Weights"] CheckSkinClust --"If No Skin Cluster" --> GetVtxMesh["/fas:fa-cube Get Vertex Mesh"] GetVtxMesh --> CheckVtxMeshShape{{"/fas:fa-question Check Vertex Mesh Shape"}} CheckVtxMeshShape --"If Mesh is Shape" --> GetMeshParent["/fas:fa-arrow-up Get Mesh Parent"] CheckVtxMeshShape --"If Mesh is not Shape" --> GetMeshSkinCluster["/fas:fa-sitemap Get Mesh Skin Cluster"] GetMeshParent --> GetMeshSkinCluster GetMeshSkinCluster --> CheckMeshSkinCluster{{"/fas:fa-question Check Mesh Skin Cluster"}} CheckMeshSkinCluster --"If Skin Cluster Exists" --> AssignSkinWeights CheckMeshSkinCluster --"If No Skin Cluster" --> End[("fas:fa-stop End")] AssignSkinWeights --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateJntValDict fill:#ff9999,stroke:#000,stroke-width:2px style CheckSkinClust fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultSkinClust fill:#cc99ff,stroke:#000,stroke-width:2px style AssignSkinWeights fill:#99ff99,stroke:#000,stroke-width:2px style GetVtxMesh fill:#ff9999,stroke:#000,stroke-width:2px style CheckVtxMeshShape fill:#99ccff,stroke:#000,stroke-width:2px style GetMeshParent fill:#cc99ff,stroke:#000,stroke-width:2px style GetMeshSkinCluster fill:#99ff99,stroke:#000,stroke-width:2px style CheckMeshSkinCluster fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setSkinWeights function:

  1. The process begins with checking if specific arguments are provided and updating the joint-value dictionary accordingly.

  2. It then verifies if a skin cluster is provided. If not, the function determines the vertex mesh and checks if it is a shape.

  3. Depending on whether the mesh is a shape or not, the function either gets the mesh parent or directly proceeds to get the skin cluster of the mesh.

  4. The presence of a skin cluster is checked. If it exists, skin weights are assigned using the joint-value dictionary.

  5. If no skin cluster is found, the function concludes without performing any action.

asNode.setSkinWeights_Jnt(self, vtx2JntValDict, forJnt, jntSuffix='_Dup', **shArgs)#

[shArgs: vjv=vtx2JntValDict, fj=forJnt, js=jntSuffix]

Purpose:

:: Sets skin weights for a specific joint, critical in refining rigging and skinning for character animation.

Parameters:
  • vtx2JntValDict – <dict> #Dictionary mapping vertices to weight values for the joint.

  • forJnt – <asNode> #The joint to set skin weights for.

  • jntSuffix – <str> #Suffix to append to the joint name.

Returns:

<None> #No return value, skin weights are set for the specified joint.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateVtx2JntValDict["/fas:fa-edit Update Vertex-Joint Value Dictionary"] UpdateVtx2JntValDict --> CheckForJnt{{"/fas:fa-search-plus Check for Joint"}} CheckForJnt --"If forJoint provided" --> GetSkinWeights["/fas:fa-balance-scale Get Skin Weights"] CheckForJnt --"If No forJoint" --> End[("fas:fa-stop End")] GetSkinWeights --> LoopThroughVtx{"Loop Through Vertices"} LoopThroughVtx --> CheckJntInDict{{"/fas:fa-question Check Joint in Dictionary"}} CheckJntInDict --"If Joint in Dict" --> CheckJntSuffix{{"/fas:fa-question Check Joint Suffix"}} CheckJntSuffix --"If Suffix Matches" --> UpdateOrigJnt["/fas:fa-pencil-alt Update Original Joint"] CheckJntSuffix --"If No Suffix Match" --> UpdateWithSuffix["/fas:fa-pencil-alt Update With Suffix"] UpdateOrigJnt --> SetWeightsPerVtx["/fas:fa-hand-holding Set Weights Per Vertex"] UpdateWithSuffix --> SetWeightsPerVtx SetWeightsPerVtx --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateVtx2JntValDict fill:#ff9999,stroke:#000,stroke-width:2px style CheckForJnt fill:#99ccff,stroke:#000,stroke-width:2px style GetSkinWeights fill:#cc99ff,stroke:#000,stroke-width:2px style LoopThroughVtx fill:#99ff99,stroke:#000,stroke-width:2px style CheckJntInDict fill:#ff9999,stroke:#000,stroke-width:2px style CheckJntSuffix fill:#99ccff,stroke:#000,stroke-width:2px style UpdateOrigJnt fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateWithSuffix fill:#99ff99,stroke:#000,stroke-width:2px style SetWeightsPerVtx fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setSkinWeights_Jnt function:

  1. The process starts by checking if specific arguments are provided and updating the vertex-joint value dictionary.

  2. It then verifies if a target joint is provided. If not, the function ends.

  3. For each vertex, it checks if the joint is present in the dictionary.

  4. If the joint is present, it checks for the presence of a suffix in the joint name.

  5. Depending on whether the suffix matches or not, the function updates the original joint or appends the suffix.

  6. Finally, it sets the skin weights per vertex according to the updated dictionary.

asNode.setTransforms(self, valList=[[0, 0, 0], [0, 0, 0], [1, 1, 1]], worldSpace=0, **shArgs)#

[shArgs: vl=valList, ws=worldSpace]

Purpose:

:: Sets the transformation values (translation, rotation, scale) of the asNode, crucial in animation and rigging for positioning and orienting objects.

Parameters:
  • valList – <list> #A list of transformation values [[translate], [rotate], [scale]].

  • worldSpace – <bool> #Determines whether to apply transformations in world space.

Returns:

<None> #No return value, transformations are applied as specified.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateValList["/fas:fa-edit Update Value List"] UpdateValList --> UpdateWorldSpace["/fas:fa-edit Update World Space"] CheckShArgs --"If shArgs not provided" --> SetDefaultVals["/fas:fa-list-ul Set Default Values"] SetDefaultVals --> UpdateWorldSpace UpdateWorldSpace --> SetPosition["/fas:fa-arrows-alt Set Position"] SetPosition --> SetRotation["/fas:fa-sync-alt Set Rotation"] SetRotation --> SetScale["/fas:fa-expand-arrows-alt Set Scale"] SetScale --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateValList fill:#ff9999,stroke:#000,stroke-width:2px style UpdateWorldSpace fill:#99ccff,stroke:#000,stroke-width:2px style SetDefaultVals fill:#cc99ff,stroke:#000,stroke-width:2px style SetPosition fill:#99ff99,stroke:#000,stroke-width:2px style SetRotation fill:#ff9999,stroke:#000,stroke-width:2px style SetScale fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the setTransforms function:

  1. The process begins by checking if specific arguments are provided and updates the value list and world space settings.

  2. It then sets the position of the asNode using the values from the value list.

  3. Next, it sets the rotation of the asNode.

  4. Finally, it sets the scale of the asNode, completing the transformation process.

asNode.shape(self, multiShapes=False, excludeOrigShp=True, getOrigShp=False, **shArgs)#

[shArgs: ms=multiShapes, eos=excludeOrigShp, gos=getOrigShp]

Purpose:

:: Retrieves the shape node of the asNode, commonly used in modeling and rigging to access geometry data.

Parameters:
  • multiShapes – <bool> #Determines whether to return multiple shape nodes if present.

  • excludeOrigShp – <bool> #Specifies whether to exclude original shapes (often created during deformation).

  • getOrigShp – <bool> #Indicates whether to return the original shape nodes.

Returns:

<str> #The name of the shape node associated with the asNode.

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateMultiShapes["/fas:fa-edit Update MultiShapes"] UpdateMultiShapes --> UpdateExcludeOrigShp["/fas:fa-edit Update ExcludeOrigShp"] UpdateExcludeOrigShp --> UpdateGetOrigShp["/fas:fa-edit Update GetOrigShp"] CheckShArgs --"If shArgs not provided" --> SetDefaultParams["/fas:fa-list-ul Set Default Params"] SetDefaultParams --> GetShapeNode["/fas:fa-sitemap Get Shape Node"] UpdateGetOrigShp --> GetShapeNode GetShapeNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateMultiShapes fill:#ff9999,stroke:#000,stroke-width:2px style UpdateExcludeOrigShp fill:#99ccff,stroke:#000,stroke-width:2px style UpdateGetOrigShp fill:#cc99ff,stroke:#000,stroke-width:2px style SetDefaultParams fill:#99ff99,stroke:#000,stroke-width:2px style GetShapeNode fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the shape function:

  1. The process starts by checking if specific arguments are provided and updates the parameters for multiple shapes, exclusion of original shapes, and retrieving original shapes.

  2. It then retrieves the shape node of the asNode based on the updated parameters.

asNode.shapeCtrl(self, trgt, **shArgs)#

[shArgs: t=trgt]

Purpose:

:: Creates a control shape for the asNode, typically used in rigging to provide animators with intuitive control interfaces.

Parameters:

trgt – <asNode> #The target node to apply the control shape to.

Returns:

<None> #No return value, a control shape is created for the specified target.

Args:

shapeObj or asNode : nurbs ctrl trgt : cluster or joint

graph TB Start[("(fa:fa-play Start)")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateTarget["/fas:fa-edit Update Target"] UpdateTarget --> RetrieveShapeObj["/fas:fa-sitemap Retrieve Shape Object"] CheckShArgs --"If shArgs not provided" --> RetrieveShapeObj RetrieveShapeObj --> CheckTargetShape{{"/fas:fa-search-plus Check Target Shape"}} CheckTargetShape --"If Target Has Shape" --> SetShapeTypeOne["/fas:fa-toggle-on Set ShapeType: 1"] CheckTargetShape --"If No Shape" --> SetShapeTypeZero["/fas:fa-toggle-off Set ShapeType: 0"] SetShapeTypeOne --> ParentShapeToOne["/fas:fa-object-group Parent Shape To Target (Type 1)"] SetShapeTypeZero --> ParentShapeToZero["/fas:fa-object-group Parent Shape To Target (Type 0)"] ParentShapeToOne --> SetVisibilityOne["/fas:fa-eye-slash Set Visibility (Type 1)"] ParentShapeToZero --> SetVisibilityZero["/fas:fa-eye Set Visibility (Type 0)"] SetVisibilityOne --> DeleteShapeObj["/fas:fa-trash Delete Shape Object"] SetVisibilityZero --> DeleteShapeObj DeleteShapeObj --> RenameTarget["/fas:fa-i-cursor Rename Target"] RenameTarget --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateTarget fill:#ff9999,stroke:#000,stroke-width:2px style RetrieveShapeObj fill:#99ccff,stroke:#000,stroke-width:2px style CheckTargetShape fill:#cc99ff,stroke:#000,stroke-width:2px style SetShapeTypeOne fill:#99ff99,stroke:#000,stroke-width:2px style SetShapeTypeZero fill:#ff9999,stroke:#000,stroke-width:2px style ParentShapeToOne fill:#99ccff,stroke:#000,stroke-width:2px style ParentShapeToZero fill:#cc99ff,stroke:#000,stroke-width:2px style SetVisibilityOne fill:#99ff99,stroke:#000,stroke-width:2px style SetVisibilityZero fill:#ff9999,stroke:#000,stroke-width:2px style DeleteShapeObj fill:#99ccff,stroke:#000,stroke-width:2px style RenameTarget fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the shapeCtrl function:

  1. The process begins by checking for arguments and updates the target node.

  2. Retrieves the shape object and determines if the target node already has a shape.

  3. Depending on whether the target has a shape, it sets the shape type accordingly (1 or 0).

  4. Parents the shape object to the target node based on the determined shape type.

  5. Sets the visibility of the shape node based on its type.

  6. Deletes the original shape object and renames the target node to match the control name.

asNode.shortName(self, **shArgs)#

Purpose:

:: Returns the short name of the asNode, an essential function in scripting and automation for referencing nodes without their full path. MFnDependencyNode.name() #_ shortName | Exact Name | Only Name of the asNode

Returns:

<str> #The short name of the asNode.

graph TB Start[("(fa:fa-play Start)")] --> CheckComponentIndex{{"/fas:fa-question Check Component Index"}} CheckComponentIndex --"If Component Index Exists" --> GetParentName["/fas:fa-sitemap Get Parent Name"] GetParentName --> ReturnComponentName["/fas:fa-tag Return Component Name"] CheckComponentIndex --"If No Component Index" --> ReturnNodeName["/fas:fa-tag Return Node Name"] ReturnComponentName --> End[("fas:fa-stop End")] ReturnNodeName --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckComponentIndex fill:#ffcc00,stroke:#000,stroke-width:2px style GetParentName fill:#99ccff,stroke:#000,stroke-width:2px style ReturnComponentName fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnNodeName fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the shortName function:

  1. The process starts by checking if the asNode has a component index.

  2. If a component index exists, it retrieves the parent name and returns the component name in the format parentName.componentType[index].

  3. If no component index exists, it simply returns the node’s name.

asNode.show(self, useParents=True, **shArgs)#

[shArgs: up=useParents]

Purpose:

:: Makes the asNode visible in the scene, a common operation in scene setup and during animation to reveal hidden objects.

Parameters:

useParents – <bool> #Determines whether to also show parent nodes.

Returns:

<None> #No return value, the asNode (and optionally its parents) are made visible.

graph TB Start["(fa:fa-play Start show)"] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> IsVisibleCheck["(fas:fa-eye Is Visible Check)"] IsVisibleCheck --"Check if the object is already visible" --> ShowObjFunction["(fas:fa-lightbulb-o Show Object Function)"] ShowObjFunction --"Define showObj function to make object visible" --> UseParentsCheck["(fas:fa-users Use Parents Check)"] UseParentsCheck --"Check if parents should be shown" --> ShowSingleObj["(fas:fa-object-ungroup Show Single Object)"] ShowSingleObj --"Show only the current object" --> End["(fas:fa-stop End)"] UseParentsCheck --"If parents are to be shown" --> ForLoop["(fas:fa-repeat For Each Parent)"] ForLoop --"Iterate through each parent" --> ShowParentObj["(fas:fa-object-group Show Parent Object)"] ShowParentObj --"Show each parent object" --> IsVisibleAfter["(fas:fa-eye Is Visible After)"] IsVisibleAfter --"Check if object is visible after showing parents" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style IsVisibleCheck fill:#99cc99,stroke:#000,stroke-width:3px style ShowObjFunction fill:#ff99cc,stroke:#000,stroke-width:3px style UseParentsCheck fill:#99cc99,stroke:#000,stroke-width:3px style ShowSingleObj fill:#99cc99,stroke:#000,stroke-width:3px style ForLoop fill:#99cc99,stroke:#000,stroke-width:3px style ShowParentObj fill:#99cc99,stroke:#000,stroke-width:3px style IsVisibleAfter fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px; linkStyle 5 stroke:#2ecd71,stroke-width:2px; linkStyle 6 stroke:#2ecd71,stroke-width:2px; linkStyle 7 stroke:#2ecd71,stroke-width:2px; linkStyle 8 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the show function:

  1. The process starts by checking if shArgs are provided and updates parameters accordingly.

  2. It checks if the object is already visible. If so, the process ends.

  3. If not visible, it defines the showObj function to make objects visible.

  4. It checks if parents should be shown based on the useParents flag.

  5. If not using parents, it shows only the current object and ends.

  6. If using parents, it iterates through each parent and shows them.

  7. After showing parents, it checks again if the object is visible. If so, the process ends; otherwise, it repeats for each parent.

asNode.snapOrientTo(self, destObj=None, dirUpObj=None, aimAxis=None, upAxis=None, worldSpace=False, **shArgs)#

[shArgs: do=destObj, duo=dirUpObj, aa=aimAxis, ua=upAxis, ws=worldSpace]

Purpose:

:: Snaps the orientation of the asNode to another object or position, used in rigging and animation for alignment purposes.

Parameters:
  • destObj – <asNode> #The target object to align to.

  • dirUpObj – <asNode, optional> #An up vector reference object for alignment.

  • aimAxis – <str> #The axis along which to aim.

  • upAxis – <str> #The up axis for alignment.

  • worldSpace – <bool> #Specifies whether to use world space coordinates for alignment.

Returns:

<None> #No return value, the asNode’s orientation is snapped to the target.

graph TB Start[("(fa:fa-play Start)")] --> CheckJointType{{"/fas:fa-bone Check if Joint"}} CheckJointType --"If not a joint" --> End[("fas:fa-stop End")] CheckJointType --"If a joint" --> CheckDestObj{{"/fas:fa-crosshairs Check Destination Object"}} CheckDestObj --"If destination object is given" --> AssignDestObj["/fas:fa-map-pin Assign Destination Object"] CheckDestObj --"If no destination object" --> ResetRotateAxis["/fas:fa-undo Reset Rotate Axis"] AssignDestObj --> CheckDirUpObj{{"/fas:fa-arrow-up Check Direction Up Object"}} CheckDirUpObj --"If direction up object not given" --> SetJointOrient["/fas:fa-sync-alt Set Joint Orientation"] CheckDirUpObj --"If direction up object given" --> FreezeTransforms["/fas:fa-snowflake Freeze Transforms"] FreezeTransforms --> SnapRotation["/fas:fa-magnet Snap Rotation"] SnapRotation --> ExtractRotationValues["/fas:fa-arrows-alt Extract Rotation Values"] ExtractRotationValues --> SetRotateToZero["/fas:fa-times-circle Set Rotate to Zero"] SetRotateToZero --> ApplyJointOrient["/fas:fa-repeat Apply Joint Orientation"] ResetRotateAxis --> End SetJointOrient --> ReattachChildren["/fas:fa-link Reattach Children"] ApplyJointOrient --> ReattachChildren ReattachChildren --> SelectJoint["/fas:fa-mouse-pointer Select Joint"] SelectJoint --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckJointType fill:#ffcc00,stroke:#000,stroke-width:2px style CheckDestObj fill:#99ccff,stroke:#000,stroke-width:2px style AssignDestObj fill:#cc99ff,stroke:#000,stroke-width:2px style CheckDirUpObj fill:#ffcc00,stroke:#000,stroke-width:2px style FreezeTransforms fill:#99ff99,stroke:#000,stroke-width:2px style SnapRotation fill:#ff9999,stroke:#000,stroke-width:2px style ExtractRotationValues fill:#99ccff,stroke:#000,stroke-width:2px style SetRotateToZero fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyJointOrient fill:#99ff99,stroke:#000,stroke-width:2px style ResetRotateAxis fill:#ff9999,stroke:#000,stroke-width:2px style ReattachChildren fill:#99ccff,stroke:#000,stroke-width:2px style SelectJoint fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the snapOrientTo function:

  1. The process starts by checking if the object is a joint.

  2. If not a joint, the process ends.

  3. If it’s a joint, it checks if a destination object is provided.

  4. If a destination object is given, it assigns the destination object.

  5. It then checks if a direction up object is provided.

  6. If no direction up object is given, it sets the joint orientation directly from the destination object.

  7. If a direction up object is given, it freezes transformations and snaps the rotation accordingly.

  8. After snapping rotation, it extracts rotation values and applies them to the joint orientation.

  9. If no destination object is provided, it resets the rotate axis.

  10. Finally, the function reattaches any children nodes and selects the joint, concluding the process.

asNode.snapPivTo(self, destObj=[0, 0, 0], multiTargets=False, **shArgs)#

[shArgs: do=destObj, mt=multiTargets]

Purpose:

:: Snaps the pivot of the asNode to a specified object or position, commonly used in rigging for precise pivot placement.

Parameters:
  • destObj – <asNode/position> #The target object or position to snap the pivot to. destObj = destObj | destPos[0, 1, 0]

  • multiTargets – <bool> #Determines whether to snap to multiple targets.

Returns:

<None> #No return value, the pivot of the asNode is snapped to the target.

graph TB Start[("(fa:fa-play Start)")] --> CheckDestObjType{{"/fas:fa-question-circle Check Destination Object Type"}} CheckDestObjType --"If destination object is a string" --> CheckObjExists{{"/fas:fa-search Check if Object Exists"}} CheckObjExists --"If object exists" --> AssignDestObj["/fas:fa-map-pin Assign Destination Object"] CheckObjExists --"If object does not exist" --> ErrorMsg["/fas:fa-exclamation-triangle Error Message"] CheckDestObjType --"If destination object is a list" --> CheckMultiTargets{{"/fas:fa-th-list Check Multi Targets"}} CheckMultiTargets --"If not multi targets" --> AssignDestPos["/fas:fa-map-marker-alt Assign Destination Position"] CheckMultiTargets --"If multi targets" --> ProcessTargetNodes["/fas:fa-cogs Process Target Nodes"] ProcessTargetNodes --> CalculateMeanPosition["/fas:fa-calculator Calculate Mean Position"] CalculateMeanPosition --> AssignDestPos AssignDestObj --> GetDestPos["/fas:fa-location-arrow Get Destination Position"] GetDestPos --> MovePivot["/fas:fa-arrows-alt Move Pivot"] AssignDestPos --> MovePivot ErrorMsg --> End[("fas:fa-stop End")] MovePivot --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckDestObjType fill:#ffcc00,stroke:#000,stroke-width:2px style CheckObjExists fill:#99ccff,stroke:#000,stroke-width:2px style AssignDestObj fill:#cc99ff,stroke:#000,stroke-width:2px style ErrorMsg fill:#ff6666,stroke:#000,stroke-width:3px style CheckMultiTargets fill:#ffcc00,stroke:#000,stroke-width:2px style AssignDestPos fill:#99ccff,stroke:#000,stroke-width:2px style ProcessTargetNodes fill:#cc99ff,stroke:#000,stroke-width:2px style CalculateMeanPosition fill:#99ff99,stroke:#000,stroke-width:2px style GetDestPos fill:#ff9999,stroke:#000,stroke-width:2px style MovePivot fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the snapPivTo function:

  1. The process starts by checking the type of the destination object.

  2. If the destination object is a string, it checks if the object exists.

  3. If the object exists, it assigns the destination object and retrieves its position.

  4. If the object does not exist, an error message is shown and the process ends.

  5. If the destination object is a list, it checks if multiple targets are specified.

  6. If not multiple targets, it directly assigns the destination position.

  7. If multiple targets are specified, it processes the target nodes and calculates their mean position.

  8. The calculated position is then assigned as the destination position.

  9. Finally, the pivot of the source object is moved to the destination position, concluding the process.

asNode.snapPosTo(self, destPosOrObj=[0, 0, 0], snapRot=False, shapePos=False, **shArgs)#

[shArgs: dpo=destPosOrObj, sr=snapRot, sp=shapePos]

Purpose:

:: Snaps the position of the asNode to a specified object or position, a fundamental operation in rigging and scene layout.

Parameters:
  • destPosOrObj – <asNode/position> #The target object or position to snap to. destObjOrPos = strObj | asNode | objPos[0,0,0]

  • snapRot – <bool> #Determines whether to also snap the rotation. if snapRot : snaps asNode’s rotation to destObj

  • shapePos – <bool> #Specifies whether to snap to the shape position of the target object. if shapePos : snaps asNode’s position to destObj’s shapePos

Returns:

<None> #No return value, the asNode’s position is snapped to the target.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> GetTargetPosition{"/fas:fa-crosshairs Get Target Position"} GetTargetPosition --> CheckObjectType{"/fas:fa-question-circle Check Object Type"} CheckObjectType --"If Target is asNode"--> GetAsNodePosition["/fas:fa-crosshairs Get asNode Position"] CheckObjectType --"If Target is a Position List"--> UsePositionList["/fas:fa-check-square Use Position List"] UsePositionList --> CalculateMeanPosition{"/fas:fa-calculator Calculate Mean Position"} CalculateMeanPosition --> MoveToMeanPosition["/fas:fa-arrows-alt Move to Mean Position"] CheckObjectType --"If Target is a strObj"--> GetObjectPosition["/fas:fa-crosshairs Get Object Position"] GetObjectPosition --> MoveToObjectPosition["/fas:fa-arrows-alt Move to Object Position"] MoveToObjectPosition --> End["/fas:fa-stop End"] MoveToMeanPosition --> End GetAsNodePosition --> MoveToAsNodePosition["/fas:fa-arrows-alt Move to asNode Position"] MoveToAsNodePosition --> End ParseShArgs --> CheckSnapRot{"/fas:fa-question-circle Check Snap Rotation"} CheckSnapRot --"If snapRot is True"--> SnapRotation["/fas:fa-sync-alt Snap Rotation"] CheckSnapRot --"If snapRot is False"--> SkipSnapRotation["/fas:fa-minus Skip Snap Rotation"] SnapRotation --> End SkipSnapRotation --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitializeParameters fill:#99ccff,stroke:#000,stroke-width:2px style GetTargetPosition fill:#cc99ff,stroke:#000,stroke-width:2px style CheckObjectType fill:#99ff99,stroke:#000,stroke-width:2px style GetAsNodePosition fill:#ffcc99,stroke:#000,stroke-width:2px style UsePositionList fill:#ccffcc,stroke:#000,stroke-width:2px style CalculateMeanPosition fill:#ffcc99,stroke:#000,stroke-width:2px style MoveToMeanPosition fill:#ccffcc,stroke:#000,stroke-width:2px style GetObjectPosition fill:#ffcc99,stroke:#000,stroke-width:2px style MoveToObjectPosition fill:#ccffcc,stroke:#000,stroke-width:2px style MoveToAsNodePosition fill:#ffcc99,stroke:#000,stroke-width:2px style SnapRotation fill:#99ff99,stroke:#000,stroke-width:2px style SkipSnapRotation fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the snapPosTo function:

  1. Checks if shArgs exist, and if so, parses the dpo, sr, and sp from it.

  2. If shArgs do not exist, initializes parameters with default values.

  3. Gets the target position based on the type of the destination object or position.

  4. If the target is an asNode, gets its position.

  5. If the target is a position list, calculates the mean position.

  6. If the target is a string object, gets its position.

  7. Moves the source object to the calculated or retrieved position.

  8. Checks if snapRot is True, and if so, snaps the rotation of the source object to the destination object.

asNode.snapRotTo(self, destObj=None, dirUpObj=None, aimAxis=None, upAxis=None, worldSpace=False, mirrBehaviour=0, **shArgs)#

[shArgs: do=destObj, duo=dirUpObj, aa=aimAxis, ua=upAxis, ws=worldSpace, mb=mirrBehaviour]

Purpose:

:: Aligns the rotation of the asNode to a target object or direction, essential in rigging for orienting joints and controls.

Parameters:
  • destObj – <asNode> #The target object to align rotation to. destObj =target object to aim to

  • dirUpObj – <asNode, optional> #An up vector reference object for alignment. dirUpObj =target Up Object to up axis

  • aimAxis – <str> #The axis along which to aim. aimAxis =’x’ | ‘X’ | ‘-x’ | ‘-X’ | [1, 0, 0] | [-1, 0, 0] etc

  • upAxis – <str> #The up axis for alignment. upAxis =’y’ | ‘Y’ | ‘-y’ | ‘-Y’ | [0, 1, 0] | [0, -1, 0]etc

  • worldSpace – <bool> #Specifies whether to use world space coordinates for alignment. worldSpace =False|True

  • mirrBehaviour – <int> #Determines the behavior of mirrored objects. mirrBehaviour =0 | 1

Returns:

<None> #No return value, the asNode’s rotation is aligned to the target.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> CheckDestinationObject{"/fas:fa-question-circle Check Destination Object"} CheckDestinationObject --"If Destination Object is None"--> CreateTempLocator["/fas:fa-plus Create Temp Locator"] CheckDestinationObject --"If Destination Object is Not None"--> ProcessRotationAlignment["/fas:fa-sync-alt Process Rotation Alignment"] ProcessRotationAlignment --> End["/fas:fa-stop End"] CreateTempLocator --> End ParseShArgs --> SetParameters["/fas:fa-cogs Set Parameters"] SetParameters --> CheckMirrorBehaviour{"/fas:fa-question-circle Check Mirror Behaviour"} CheckMirrorBehaviour --"If MirrBehaviour is True"--> ProcessMirrorBehaviour["/fas:fa-sync-alt Process Mirror Behaviour"] ProcessMirrorBehaviour --> End CheckMirrorBehaviour --"If MirrBehaviour is False"--> SetOrientationConstraint["/fas:fa-link Set Orientation Constraint"] SetOrientationConstraint --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitializeParameters fill:#99ccff,stroke:#000,stroke-width:2px style CheckDestinationObject fill:#cc99ff,stroke:#000,stroke-width:2px style CreateTempLocator fill:#99ff99,stroke:#000,stroke-width:2px style ProcessRotationAlignment fill:#ffcc99,stroke:#000,stroke-width:2px style SetParameters fill:#ccffcc,stroke:#000,stroke-width:2px style CheckMirrorBehaviour fill:#99ccff,stroke:#000,stroke-width:2px style ProcessMirrorBehaviour fill:#ffcc99,stroke:#000,stroke-width:2px style SetOrientationConstraint fill:#ccffcc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the snapRotTo function:

  1. Checks if shArgs exist, and if so, parses the do, duo, aa, ua, ws, and mb from it.

  2. If shArgs do not exist, initializes parameters with default values.

  3. Checks if the destination object is None.

  4. If the destination object is None, creates a temporary locator and aligns the rotation to it.

  5. If the destination object is not None, processes the rotation alignment.

  6. Sets the parameters based on the parsed arguments.

  7. Checks the mirror behavior.

  8. If mirror behavior is True, processes the mirror behavior.

  9. If mirror behavior is False, sets the orientation constraint.

asNode.snapShpTo(self, destPosOrObj=[0, 0, 0], shapePos=False, **shArgs)#

[shArgs: dpo=destPosOrObj, sp=shapePos]

Purpose:

:: Snaps the shape of the asNode to a specified object or position, used in modeling and rigging for precise shape alignment.

Parameters:
  • destPosOrObj – <asNode/position> #The target object or position for snapping the shape.

  • shapePos – <bool> #Specifies whether to snap to the shape position of the target object.

Returns:

<None> #No return value, the shape of the asNode is snapped to the target.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> GetDestinationPosition{"/fas:fa-check-square Get Destination Position"} GetDestinationPosition --> SnapShapePosition["/fas:fa-mouse-pointer Snap Shape Position"] SnapShapePosition --> End["/fas:fa-stop End"] ParseShArgs --> SetParameters["/fas:fa-cogs Set Parameters"] SetParameters --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitializeParameters fill:#99ccff,stroke:#000,stroke-width:2px style GetDestinationPosition fill:#cc99ff,stroke:#000,stroke-width:2px style SnapShapePosition fill:#99ff99,stroke:#000,stroke-width:2px style SetParameters fill:#ccffcc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the snapShpTo function:

  1. Checks if shArgs exist, and if so, parses the dpo and sp from it.

  2. If shArgs do not exist, initializes parameters with default values.

  3. Gets the destination position based on the specified object or position.

  4. Snaps the shape position of the source object to the destination position.

  5. Sets the parameters based on the parsed arguments.

asNode.splitCurv(self, endDir='+', axis='x', epNum=None, **shArgs)#

[shArgs: ed=endDir, ax=axis, en=epNum]

Purpose:

:: Splits a curve at a specified point or direction, a critical operation in curve-based modeling and rigging.

Parameters:
  • endDir – <str> #The direction to split the curve (‘+’ or ‘-‘).

  • axis – <str> #The axis along which to split the curve.

  • epNum – <int, optional> #The edit point number where the curve should be split.

Returns:

<None> #No return value, the curve is split as specified.

asNode.startswith(self, *args, **kwargs)#

Purpose:

:: Checks if the name of the asNode starts with a specified string, useful in scripting for sorting and organizing nodes.

Parameters:

args – Additional arguments for specifying the start string.

Kwargs:

Additional keyword arguments.

Returns:

<bool> #Returns True if the asNode’s name starts with the specified string, False otherwise.

asNode.stripNum(self, **shArgs)#

Purpose:

:: Removes numerical suffixes from the asNode’s name, used in scene cleanup and organization to standardize node names.

Returns:

<str> #The name of the asNode with numerical suffixes removed.

graph TB Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-check-square-o Check shArgs"} CheckShArgs -- Yes --> ExtractName{"Extract Name"} ExtractName --> End["/fas:fa-stop End"] CheckShArgs -- No --> GetObjName{"Get Object Name"} GetObjName --> DefineRegex{"Define Regex"} DefineRegex --> RemoveSuffix{"Remove Suffix"} RemoveSuffix --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractName fill:#99ccff,stroke:#000,stroke-width:2px style GetObjName fill:#99ccff,stroke:#000,stroke-width:2px style DefineRegex fill:#99ccff,stroke:#000,stroke-width:2px style RemoveSuffix fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the stripNum function:

  • Checks if shArgs are provided.

  • If shArgs are provided, it extracts the name directly.

  • If shArgs are not provided, it gets the name of the object.

  • Defines a regular expression pattern to identify numerical suffixes.

  • Removes the numerical suffixes from the object’s name.

  • Concludes the process by returning the modified name.

asNode.stripSuffix(self, delineator='_', **shArgs)#

[shArgs: d=delineator]

Purpose:

:: Strips the suffix from the asNode’s name based on a delineator, aiding in node naming conventions and organization.

Parameters:

delineator – <str> #The delineator used to identify the suffix in the node’s name.

Returns:

<str> #The name of the asNode with the suffix removed.

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> CheckDelineator{"/fas:fa-question-circle Check Delineator"} CheckDelineator --"If Delineator Found"--> SplitName["/fas:fa-arrow-right Split Name"] CheckDelineator --"If Delineator Not Found"--> End["/fas:fa-stop End"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitializeParameters fill:#99ccff,stroke:#000,stroke-width:2px style CheckDelineator fill:#cc99ff,stroke:#000,stroke-width:2px style SplitName fill:#ffcc99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the stripSuffix function:

  1. Checks if shArgs exist, and if so, parses the delineator from it.

  2. If shArgs do not exist, initializes parameters with default values.

  3. Checks if the delineator exists in the node’s name.

  4. If the delineator is found, splits the name based on the delineator.

  5. If the delineator is not found, the function ends.

asNode.suffixHI(self, suffix='_BS', topSelect=True, selectHI=True, excludeShapes=True, **shArgs)#

[shArgs: s=suffix, ts=topSelect, si=selectHI, es=excludeShapes]

Purpose:

:: Appends a suffix to all hierarchy nodes under the asNode, commonly used in rigging to maintain naming conventions.

Parameters:
  • suffix – <str> #The suffix to append to each node in the hierarchy.

  • topSelect – <bool> #Determines whether to include the top node in the suffix operation.

  • selectHI – <bool> #Specifies whether to operate on the entire hierarchy.

  • excludeShapes – <bool> #Indicates whether to exclude shape nodes from the suffix operation.

Returns:

<list> #A list of nodes with the suffix appended. List of Lists [[asNode1]] or [[asNode1, asNode2], [asNode3, asNode4]] etc

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> SelectHierarchyNodes{"/fas:fa-check-square Select Hierarchy Nodes"} SelectHierarchyNodes --"If Top Select"--> IncludeTopNode["/fas:fa-check-square Include Top Node"] SelectHierarchyNodes --"If Not Top Select"--> ExcludeTopNode["/fas:fa-times Exclude Top Node"] IncludeTopNode --> SelectAllNodes{"/fas:fa-check-square Select All Nodes"} ExcludeTopNode --> DeselectTopNode{"/fas:fa-times Deselect Top Node"} SelectAllNodes --> CheckNodeShape{"/fas:fa-question-circle Check Node Shape"} CheckNodeShape --"If Shape Node Excluded"--> SkipShapeNode["/fas:fa-arrow-right Skip Shape Node"] CheckNodeShape --"If Shape Node Not Excluded"--> RenameNode["/fas:fa-arrow-right Rename Node"] SkipShapeNode --> CheckNextNode{"/fas:fa-question-circle Check Next Node"} RenameNode --> CheckNextNode CheckNextNode --"If More Nodes Exist"--> IterateNextNode["/fas:fa-arrow-right Iterate Next Node"] CheckNextNode --"If No More Nodes"--> End["/fas:fa-stop End"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style InitializeParameters fill:#99ccff,stroke:#000,stroke-width:2px style SelectHierarchyNodes fill:#cc99ff,stroke:#000,stroke-width:2px style IncludeTopNode fill:#99ff99,stroke:#000,stroke-width:2px style ExcludeTopNode fill:#99ff99,stroke:#000,stroke-width:2px style SelectAllNodes fill:#99ff99,stroke:#000,stroke-width:2px style DeselectTopNode fill:#ff9999,stroke:#000,stroke-width:2px style CheckNodeShape fill:#cc99ff,stroke:#000,stroke-width:2px style SkipShapeNode fill:#99ccff,stroke:#000,stroke-width:2px style RenameNode fill:#99ccff,stroke:#000,stroke-width:2px style CheckNextNode fill:#cc99ff,stroke:#000,stroke-width:2px style IterateNextNode fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the suffixHI function:

  1. Checks if shArgs exist, and if so, parses the suffix, top select, select HI, and exclude shapes from it.

  2. If shArgs do not exist, initializes parameters with default values.

  3. Selects hierarchy nodes based on the specified parameters.

  4. If top select is enabled, includes the top node in the selection.

  5. If top select is disabled, excludes the top node from the selection.

  6. Selects all nodes in the hierarchy.

  7. Checks each node’s shape to determine if it should be excluded.

  8. If the node is a shape and shapes are excluded, skips renaming.

  9. If the node is not a shape or shapes are not excluded, renames the node with the specified suffix.

  10. Iterates through each node in the hierarchy.

  11. Ends the function once all nodes have been processed.

asNode.swapNames(self, trgtNode, **shArgs)#

[shArgs: tn=trgtNode]

Purpose:

:: Swaps the name of the asNode with another node, a utility in scene management for reorganizing node hierarchies.

Parameters:

trgtNode – <asNode> #The target node with which to swap names.

Returns:

<None> #No return value, the names of the asNode and target node are swapped.

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> ContinueExecution["/fas:fa-wrench Continue Execution"] ParseShArgs --> ContinueExecution ContinueExecution --> RenameSelfNode{"/fas:fa-arrow-right Rename Self Node"} RenameSelfNode --> RenameTargetNode{"/fas:fa-arrow-right Rename Target Node"} RenameTargetNode --> RenameSelfWithTarget{"/fas:fa-arrow-right Rename Self With Target"} RenameSelfWithTarget --> End["/fas:fa-stop End"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ContinueExecution fill:#99ccff,stroke:#000,stroke-width:2px style RenameSelfNode fill:#99ff99,stroke:#000,stroke-width:2px style RenameTargetNode fill:#99ff99,stroke:#000,stroke-width:2px style RenameSelfWithTarget fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the swapNames function:

  1. Checks if shArgs exist, and if so, parses the target node from it.

  2. If shArgs do not exist, continues with the execution.

  3. Renames the current node with a temporary name.

  4. Renames the target node with the current node’s original name.

  5. Renames the current node with the target node’s original name.

  6. Ends the function.

asNode.template(self, refreshView=True, **shArgs)#

[shArgs: rv=refreshView]

Purpose:

:: Sets the asNode’s display mode to template, commonly used in rigging and modeling to provide a non-selectable reference.

Parameters:

refreshView – <bool> #Determines whether to refresh the view after setting the template mode.

Returns:

<None> #No return value, the asNode is set to template display mode.

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> ContinueExecution["/fas:fa-wrench Continue Execution"] ParseShArgs --> ContinueExecution ContinueExecution --> SelectNode{"/fas:fa-mouse-pointer Select Node"} SelectNode --> SetTemplateMode{"/fas:fa-pencil Set Template Mode"} SetTemplateMode --> RefreshView{"/fas:fa-sync Refresh View"} RefreshView --> End["/fas:fa-stop End"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ContinueExecution fill:#99ccff,stroke:#000,stroke-width:2px style SelectNode fill:#99ff99,stroke:#000,stroke-width:2px style SetTemplateMode fill:#99ff99,stroke:#000,stroke-width:2px style RefreshView fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the template function:

  1. Checks if shArgs exist, and if so, parses the refreshView flag from it.

  2. If shArgs do not exist, continues with the execution.

  3. Selects the current node.

  4. Sets the display mode of the node to template.

  5. If refreshView is True, refreshes the view.

  6. Ends the function.

asNode.transferAnimTo(self, dest, attr='r', move=False, **shArgs)#

[shArgs: d=dest, a=attr, m=move]

Purpose:

:: Transfers animation data from the asNode to a destination node, used in animation workflows for re-targeting motion.

Parameters:
  • dest – <asNode> #The destination node to transfer animation to.

  • attr – <str> #The attribute type to transfer (e.g., ‘r’ for rotation).

  • move – <bool> #Determines whether to remove the animation from the asNode after transfer.

Returns:

<None> #No return value, animation is transferred as specified.

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> ContinueExecution["/fas:fa-wrench Continue Execution"] ParseShArgs --> ContinueExecution ContinueExecution --> SelectSourceNode{"/fas:fa-mouse-pointer Select Source Node"} SelectSourceNode --> CheckAnimation{"/fas:fa-search Check Animation"} CheckAnimation --"If Animation Exists"--> TransferAnimation["/fas:fa-exchange-alt Transfer Animation"] TransferAnimation --> RemoveAnimation{"/fas:fa-cut Remove Animation"} RemoveAnimation --"If Move Flag is True"--> SetDefaultValue["/fas:fa-undo Set Default Value"] RemoveAnimation --"If Move Flag is False"--> End["/fas:fa-stop End"] CheckAnimation --"If No Animation Exists"--> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ContinueExecution fill:#99ccff,stroke:#000,stroke-width:2px style SelectSourceNode fill:#99ff99,stroke:#000,stroke-width:2px style CheckAnimation fill:#ff9999,stroke:#000,stroke-width:2px style TransferAnimation fill:#99ff99,stroke:#000,stroke-width:2px style RemoveAnimation fill:#99ff99,stroke:#000,stroke-width:2px style SetDefaultValue fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferAnimTo function:

  1. Checks if shArgs exist, and if so, parses the dest, attr, and move flags from it.

  2. If shArgs do not exist, continues with the execution.

  3. Selects the source node.

  4. Checks if animation exists on the specified attribute.

  5. If animation exists:
    • Transfers animation data to the destination node.

    • Removes animation from the source node if the move flag is True.

  6. Ends the function if no animation exists.

asNode.transferAnimToGrp(self, attr='r', **shArgs)#

[shArgs: a=attr]

Purpose:

:: Transfers animation data from the asNode to a group node, often used in rigging to organize and consolidate animations.

>>>Moves animation from ctrls to grp :param attr: <str> #The attribute type to transfer (e.g., ‘r’ for rotation). :return: <None> #No return value, animation is transferred to the group node.

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> ContinueExecution["/fas:fa-wrench Continue Execution"] ParseShArgs --> ContinueExecution ContinueExecution --> SelectSourceNodes{"/fas:fa-mouse-pointer Select Source Nodes"} SelectSourceNodes --> IterateEachCtrl{"/fas:fa-redo Iterate Each Ctrl"} IterateEachCtrl --> GetCtrlGrp{"/fas:fa-object-group Get Ctrl Group"} GetCtrlGrp --> GetAttributes{"/fas:fa-search Get Attributes"} GetAttributes --> TransferAnimation{"/fas:fa-exchange-alt Transfer Animation"} TransferAnimation --> ResetCtrl{"/fas:fa-undo Reset Ctrl"} ResetCtrl --> SelectSourceNodes IterateEachCtrl --"If No More Controls"--> End["/fas:fa-stop End"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ContinueExecution fill:#99ccff,stroke:#000,stroke-width:2px style SelectSourceNodes fill:#99ff99,stroke:#000,stroke-width:2px style IterateEachCtrl fill:#99ccff,stroke:#000,stroke-width:2px style GetCtrlGrp fill:#ff9999,stroke:#000,stroke-width:2px style GetAttributes fill:#99ff99,stroke:#000,stroke-width:2px style TransferAnimation fill:#99ff99,stroke:#000,stroke-width:2px style ResetCtrl fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferAnimToGrp function:

  1. Checks if shArgs exist, and if so, parses the attr flag from it.

  2. If shArgs do not exist, continues with the execution.

  3. Selects the source nodes.

  4. Iterates through each selected control node.

  5. Retrieves the group node of each control.

  6. Gets attributes from the control and group nodes.

  7. Transfers animation data from the control to the group node.

  8. Resets the animation values of the control node.

  9. Iterates until there are no more control nodes selected.

asNode.translateBy(self, valList=[0, 0, 0], freezeIt=False, mSpace=1, transList=None, refreshView=False, **shArgs)#

[shArgs: vl=valList, fi=freezeIt, ms=mSpace, tl=transList, rv=refreshView]

Purpose:

:: Translates the asNode by specified values in either local or world space, crucial for animation and scene layout adjustments.

Parameters:

valList – <list> #Values for translation [x, y, z].

>>>valList =[x, y, z] Ex: [1, 0, 0] | [0, 1, 0] | [1, 10, 5] :param freezeIt: <bool> #Determines whether to freeze transformations after translation. >>>freezeIt =self will be freezed after translated :param mSpace: <int> #0 for Local Space, 1 for World Space. >>>mSpace =0: Local, 1 =World :param transList: <list, optional> #Specific translation values for axes. >>>transList =None | [‘x’, 10] | [‘y’, -5] | [‘-x’, 5] | [‘-y’, -10.5] #_ if transList, valList is ignored :param refreshView: <bool> #Determines whether to refresh the view after translation. :return: <None> #No return value, the asNode is translated as specified.

graph TD Start["fa:fa-play Start"] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> ContinueExecution["/fas:fa-wrench Continue Execution"] ParseShArgs --> ContinueExecution ContinueExecution --> DetermineTransformationSpace{"/fas:fa-arrows-alt Determine Transformation Space"} DetermineTransformationSpace --> TranslateInWorldSpace{"/fas:fa-globe-americas Translate in World Space"} DetermineTransformationSpace --> TranslateInLocalSpace{"/fas:fa-map Translate in Local Space"} TranslateInWorldSpace --> FreezeTransformations{"/fas:fa-snowflake Freeze Transformations"} TranslateInWorldSpace --> RefreshView{"/fas:fa-sync-alt Refresh View"} TranslateInLocalSpace --> FreezeTransformations TranslateInLocalSpace --> RefreshView RefreshView --> End["/fas:fa-stop End"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ParseShArgs fill:#ff9999,stroke:#000,stroke-width:2px style ContinueExecution fill:#99ccff,stroke:#000,stroke-width:2px style DetermineTransformationSpace fill:#99ff99,stroke:#000,stroke-width:2px style TranslateInWorldSpace fill:#99ccff,stroke:#000,stroke-width:2px style TranslateInLocalSpace fill:#99ccff,stroke:#000,stroke-width:2px style FreezeTransformations fill:#99ff99,stroke:#000,stroke-width:2px style RefreshView fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the translateBy function:

  1. Checks if shArgs exist, and if so, parses the valList, freezeIt, mSpace, transList, and refreshView flags from it.

  2. If shArgs do not exist, continues with the execution.

  3. Determines the transformation space based on the value of mSpace (0 for local space, 1 for world space).

  4. If in world space, translates the node accordingly.

  5. Freezes transformations if specified.

  6. Refreshes the view if specified.

asNode.unfreezeRotation(self, grpLevel, vtxNumOrObj, trgtType='vtx', **shArgs)#

[shArgs: gl=grpLevel, vno=vtxNumOrObj, tt=trgtType]

Purpose:

:: Unfreezes the rotation transformations on the asNode, allowing further adjustments, typically used in rigging.

Parameters:
  • grpLevel – <int> #Group level for the unfreeze operation.

  • vtxNumOrObj – <int/asNode> #Vertex number or object to target.

  • trgtType – <str> #The target type (e.g., ‘vtx’ for vertex).

Returns:

<None> #No return value, rotation transformations are unfrozen.

graph TB Start["(fa:fa-play Start unfreezeRotation)"] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Update parameters if shArgs provided" --> SelectObject["(fas:fa-mouse-pointer Select Object)"] SelectObject --"Select the current object" --> RefreshView["(fas:fa-sync-alt Refresh View)"] RefreshView --"Refresh the view for updates" --> GroupLevel["(fas:fa-layer-group Check Group Level)"] GroupLevel --"Determine the group level" --> PositionQuery["(fas:fa-ruler-combined Query Position)"] PositionQuery --"Query top group position" --> LocatorSetup["(fas:fa-map-marker-alt Setup Locators)"] LocatorSetup --"Setup direction and vertex locators" --> DestinationPos["(fas:fa-location-arrow Get Destination Position)"] DestinationPos --"Get position of the object" --> TargetType["(fas:fa-crosshairs Check Target Type)"] TargetType --"Determine the target type" --> FinalRotation["(fas:fa-redo-alt Calculate Final Rotation)"] FinalRotation --"Calculate the final rotation" --> RotationAdjust["(fas:fa-tools Adjust Rotation)"] RotationAdjust --"Adjust rotation to zero" --> FinalSetup["(fas:fa-check-double Final Setup)"] FinalSetup --"Set final rotation values" --> Cleanup["(fas:fa-broom Cleanup)"] Cleanup --"Delete temporary locators" --> End["(fas:fa-stop End)"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style SelectObject fill:#99cc99,stroke:#000,stroke-width:3px style RefreshView fill:#ff99cc,stroke:#000,stroke-width:3px style GroupLevel fill:#99cc99,stroke:#000,stroke-width:3px style PositionQuery fill:#99cc99,stroke:#000,stroke-width:3px style LocatorSetup fill:#99cc99,stroke:#000,stroke-width:3px style DestinationPos fill:#99cc99,stroke:#000,stroke-width:3px style TargetType fill:#99cc99,stroke:#000,stroke-width:3px style FinalRotation fill:#99cc99,stroke:#000,stroke-width:3px style RotationAdjust fill:#99cc99,stroke:#000,stroke-width:3px style FinalSetup fill:#99cc99,stroke:#000,stroke-width:3px style Cleanup fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px; linkStyle 5 stroke:#2ecd71,stroke-width:2px; linkStyle 6 stroke:#2ecd71,stroke-width:2px; linkStyle 7 stroke:#2ecd71,stroke-width:2px; linkStyle 8 stroke:#2ecd71,stroke-width:2px; linkStyle 9 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart depicts the process of unfreezing rotation transformations on the given node in Maya. The steps include: 1. Starting the unfreeze rotation process. 2. Checking if optional arguments are provided and updating parameters accordingly. 3. Selecting the current object in the scene. 4. Refreshing the view for updates. 5. Determining the group level for the unfreeze operation. 6. Querying the top group position to use later. 7. Setting up direction and vertex locators. 8. Getting the position of the object. 9. Determining the target type (e.g., vertex or object). 10. Calculating the final rotation. 11. Adjusting rotation to zero. 12. Setting final rotation values. 13. Cleaning up by deleting temporary locators. 14. Ending the process.

asNode.unfreezeTrans(self)#

Purpose:

:: Unfreezes the translation transformations on the asNode, a common step in rigging and animation to reset transformations.

Returns:

<None> #No return value, translation transformations are unfrozen.

graph TB Start["(fa:fa-play Start unfreezeTrans)"] --> CheckNodeType["(fas:fa-layer-group Check Node Type)"] CheckNodeType --"Check if node type is applicable" --> ResetPosition["(fas:fa-crosshairs Reset Position)"] ResetPosition --"Reset position to origin" --> FreezeTransformations["(fas:fa-snowflake Freeze Transformations)"] FreezeTransformations --"Freeze transformations" --> RestorePosition["(fas:fa-undo Restore Position)"] RestorePosition --"Restore initial position" --> SelectNode["(fas:fa-mouse-pointer Select Node)"] SelectNode --"Select the node" --> End["(fas:fa-stop End)"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#99cc99,stroke:#000,stroke-width:3px style ResetPosition fill:#99cc99,stroke:#000,stroke-width:3px style FreezeTransformations fill:#99cc99,stroke:#000,stroke-width:3px style RestorePosition fill:#99cc99,stroke:#000,stroke-width:3px style SelectNode fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px; linkStyle 5 stroke:#2ecd71,stroke-width:2px; linkStyle 6 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart demonstrates the process of unfreezing translation transformations on the specified node in Maya: 1. The process starts with the execution of the unfreezeTrans function. 2. It checks if the node type is applicable for unfreezing translation transformations. 3. If applicable, it resets the position of the node to the origin (0,0,0). 4. It then freezes the transformations (translation, rotation, and scale) of the node. 5. After freezing, it restores the node to its initial position. 6. Finally, it selects the node to indicate the completion of the process.

asNode.unparent(self)#

Purpose:

:: Removes the asNode from its current parent, effectively unparenting it, a necessary step in reorganizing node hierarchies.

>>>Parents asNode to world :return: <None> #No return value, the asNode is unparented.

graph TB Start["(fa:fa-play Start unparent)"] --> CheckParent["(fas:fa-search Check Parent)"] CheckParent --"Check if the node has a parent" --> UnparentNode["(fas:fa-unlink Unparent Node)"] UnparentNode --"Unparent the node from its current parent" --> End["(fas:fa-stop End)"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckParent fill:#99cc99,stroke:#000,stroke-width:3px style UnparentNode fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the process of unparenting a node in Maya: 1. The process begins with the execution of the unparent function. 2. It checks if the node currently has a parent. 3. If the node has a parent, it unparents the node from its current parent. 4. The process concludes after unparenting the node.

asNode.untemplate(self, refreshView=True, **shArgs)#

[shArgs: rv=refreshView]

Purpose:

:: Removes the template display mode from the asNode, typically used in rigging and modeling to revert back to selectable mode.

>>>Use asN.setDisplayType :param refreshView: <bool> #Determines whether to refresh the view after removing the template mode. :return: <None> #No return value, the template mode is removed from the asNode.

graph TB Start["(fa:fa-play Start untemplate)"] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Check if shArgs provided" --> UntemplateNode["(fas:fa-window-close Remove Template Mode)"] UntemplateNode --"Remove template display mode from the node" --> RefreshView["(fas:fa-sync-alt Refresh View)"] RefreshView --"Refresh the view if specified" --> End["(fas:fa-stop End)"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style UntemplateNode fill:#99cc99,stroke:#000,stroke-width:3px style RefreshView fill:#ff99cc,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the process of untemplating a node in Maya: 1. The process starts with the execution of the untemplate function. 2. It checks if additional arguments (shArgs) are provided. 3. If shArgs are provided, it extracts the refreshView parameter; otherwise, it defaults to True. 4. It removes the template display mode from the node. 5. If refreshView is set to True, it refreshes the view. 6. The process concludes after untemplating the node and refreshing the view if necessary.

asNode.vtx(self, num=0, getNode=1, checkCount=1, onMesh=None, **shArgs)#

[shArgs: n=num, gn=getNode, cc=checkCount, om=onMesh]

Purpose:

:: Retrieves the vertex information of the asNode, used extensively in modeling and rigging for vertex-level operations.

>>>Returns asNode for vtx :param num: <int> #The vertex number to retrieve information for. :param getNode: <bool> #Determines whether to return the node associated with the vertex. :param checkCount: <bool> #Specifies whether to check and return the count of vertices. :param onMesh: <asNode, optional> #The mesh node to perform the vertex operation on. :return: <various> #Returns vertex information or the associated node.

graph TB Start["(fa:fa-play Start vtx)"] --> CheckArgs["(fas:fa-sliders-h Check shArgs)"] CheckArgs --"Check if shArgs provided" --> ExtractParameters["Extract Parameters"] ExtractParameters --"Extract parameters if provided, else use defaults" --> CheckCount["(fas:fa-check-square-o Check Count)"] CheckCount --"Check if count checking is enabled" --> GetVtxCount["(fas:fa-calculator Get Vertex Count)"] GetVtxCount --"Retrieve the count of vertices" --> CheckVertexNum["(fas:fa-check-square-o Check Vertex Number)"] CheckVertexNum --"Check if the specified vertex number is valid" --> RetrieveInfo["(fas:fa-database Retrieve Vertex Information)"] RetrieveInfo --"Retrieve vertex information or associated node" --> End["(fas:fa-stop End)"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#99cc99,stroke:#000,stroke-width:3px style ExtractParameters fill:#99cc99,stroke:#000,stroke-width:3px style CheckCount fill:#99cc99,stroke:#000,stroke-width:3px style GetVtxCount fill:#99cc99,stroke:#000,stroke-width:3px style CheckVertexNum fill:#99cc99,stroke:#000,stroke-width:3px style RetrieveInfo fill:#99cc99,stroke:#000,stroke-width:3px style End fill:#99cc99,stroke:#000,stroke-width:3px linkStyle 0 stroke:#2ecd71,stroke-width:2px; linkStyle 1 stroke:#2ecd71,stroke-width:2px; linkStyle 2 stroke:#2ecd71,stroke-width:2px; linkStyle 3 stroke:#2ecd71,stroke-width:2px; linkStyle 4 stroke:#2ecd71,stroke-width:2px; linkStyle 5 stroke:#2ecd71,stroke-width:2px; linkStyle 6 stroke:#2ecd71,stroke-width:2px;
Flow Chart Description:

This flowchart illustrates the process of retrieving vertex information in Maya:

  1. The process begins with the execution of the vtx function.

  2. It checks if additional arguments (shArgs) are provided.

  3. If provided, it extracts parameters such as num, getNode, checkCount, and onMesh, otherwise, it uses default values.

  4. It checks if vertex count checking is enabled.

  5. If enabled, it retrieves the count of vertices.

  6. It checks if the specified vertex number is valid.

  7. If valid, it retrieves vertex information or the associated node.

  8. The process concludes after retrieving the desired information.