eTest#

_images/as_eTest.jpg

eTest Features

:Advanced Teting Module:

The eTest module, in line with the asNode and eCtrl modules, is a custom Python module specifically crafted for application in VFX, with a particular focus on rigging and automation in Autodesk Maya. Based on the initial examination of the file, the eTest module offers several distinct uses and features:

  1. Testing and Validation: The eTest module is designed for testing and validating rigging scripts in Maya, ensuring their correct and efficient functionality.

  2. Automation of Test Cases: eTest streamlines the rigging process by automating the creation and execution of test cases, enhancing the reliability of rigs while saving time.

  3. Debugging Support: The module includes tools and functions that aid in debugging rigging scripts, facilitating the swift identification and resolution of issues.

  4. Performance Evaluation: eTest is equipped with functionalities to assess the performance of various rigging setups, aiming to guarantee optimal efficiency and resource management.

  5. Integration with Rigging Workflow: Seamlessly integrating into the rigging workflow, eTest provides tools that complement and bolster existing rigging processes.

  6. User-Friendly Testing Environment: eTest features a user-friendly interface for conducting tests, making it accessible to users across different levels of technical skill.

  7. Customizable Testing Framework: The module offers customizable options to suit specific rigging needs or scenarios, allowing for flexible testing of diverse rig types.

  8. Compatibility Checks: eTest includes capabilities to verify the compatibility of rigs with various versions of Maya and other tools and scripts utilized in the rigging process.

eTest.__init__(self)#

To Support main auto rig scripts via eTest

as_eTestMain_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
Mobile No: +91-9741454400 / +91-9949005359

Copyright (c) as_eTestMain

** (Subbaiah) Subbu Addanki. All Rights Reserved. **
eTest._confirmAction(self, action, raiseErr=False, **shArgs)#

[**shArgs : a=action, re=raiseErr]

Purpose:

:: Requests the user to confirm an action using a confirmDialog window.

Argument | Description:

Parameters:
  • action – (<type str>) # The action to be confirmed by the user.

  • raiseErr – (<type bool, optional>) # If True, raises a RuntimeError with the action message. Defaults to False.

Code Examples:

>>> action = "Delete selected objects?"
>>> if _confirmAction(action):
...     # User confirmed the action, perform deletion.
...     deleteSelected()
... else:
...     # User canceled the action, do nothing.
...     pass
graph TB Start_confirmAction[("fa:fa-play Start")] --> CheckShArgs_confirmAction{{"/fas:fa-question Check shArgs"}} CheckShArgs_confirmAction --"If shArgs is provided" --> UpdateParams_confirmAction["/fas:fa-sync-alt Update Parameters"] CheckShArgs_confirmAction --"If shArgs is not provided" --> CheckRaiseErr_confirmAction{{"/fas:fa-question Check raiseErr"}} UpdateParams_confirmAction --> CheckRaiseErr_confirmAction CheckRaiseErr_confirmAction --"If raiseErr is True" --> ConfirmDialogRaiseError_confirmAction["/fas:fa-window-close Confirm Dialog and Raise Error"] CheckRaiseErr_confirmAction --"If raiseErr is False" --> ConfirmDialog_confirmAction["/fas:fa-window-close Confirm Dialog"] ConfirmDialogRaiseError_confirmAction --> End_confirmAction[("fas:fa-stop End")] ConfirmDialog_confirmAction --> ReturnDecision_confirmAction["/fas:fa-check-circle Return Decision"] ReturnDecision_confirmAction --> End_confirmAction style Start_confirmAction fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_confirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_confirmAction fill:#ff9999,stroke:#000,stroke-width:2px style CheckRaiseErr_confirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style ConfirmDialogRaiseError_confirmAction fill:#ff9999,stroke:#000,stroke-width:2px style ConfirmDialog_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style ReturnDecision_confirmAction fill:#99ff99,stroke:#000,stroke-width:2px style End_confirmAction fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the _confirmAction function:

  1. The function begins by checking shArgs and updating parameters accordingly.

  2. It then checks if raiseErr is True, and if so, displays a confirm dialog and raises an error.

  3. If raiseErr is False, it displays a confirm dialog and returns the user’s decision.

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

Purpose:

:: Sends a given error message through a confirmDialog window and raises a RuntimeError.

Parameters:

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

Returns:

None, but raises a RuntimeError with the provided error message.

Sends a given error message through confirmDialog window. After closing the window, RuntimeError will be raised

graph TB Start_error[("fa:fa-play Start")] --> CheckShArgs_error{{"/fas:fa-question Check shArgs"}} CheckShArgs_error --"No specific action" --> ConfirmDialog_error["/fas:fa-window-close Confirm Dialog"] ConfirmDialog_error --> RaiseError_error["/fas:fa-exclamation-triangle Raise Error"] style Start_error fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_error fill:#ffcc00,stroke:#000,stroke-width:2px style ConfirmDialog_error fill:#ff9999,stroke:#000,stroke-width:2px style RaiseError_error fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the _error function:

  1. The function starts by checking shArgs and then displays an error message using a confirm dialog, followed by raising a RuntimeError.

eTest._listReferences(self, parentNS=None, **shArgs)#

[**shArgs : pns=parentNS]

Purpose:

:: Returns a list of reference nodes found in the current Maya scene.

Parameters:

parentNS – <str, optional> #Parent namespace to query reference nodes from. If None, all reference nodes in the scene are considered.

Returns:

<list> #A list of reference node names found in the current scene.

graph TB Start_listRef[("fa:fa-play Start")] --> CheckShArgs_listRef{{"/fas:fa-question Check shArgs"}} CheckShArgs_listRef --"If shArgs is provided" --> UpdateParentNS_listRef["/fas:fa-sync-alt Update parentNS"] CheckShArgs_listRef --"If shArgs is not provided" --> GetRefList_listRef["/fas:fa-list-ol Get Reference List"] UpdateParentNS_listRef --> GetRefList_listRef GetRefList_listRef --> ReturnRefNodes_listRef["/fas:fa-check-circle Return Reference Nodes"] style Start_listRef fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_listRef fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParentNS_listRef fill:#ff9999,stroke:#000,stroke-width:2px style GetRefList_listRef fill:#99ccff,stroke:#000,stroke-width:2px style ReturnRefNodes_listRef fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the _listReferences function:

  1. The function checks for shArgs, updates parentNS if necessary, and then returns a list of reference nodes found in the current scene.

eTest._refreshView(self, num, **shArgs)#

[**shArgs : num=num]

Purpose:

:: Forces a refresh of the Maya viewport a specified number of times.

Argument | Description:

Parameters:

num – (<type int>) # The number of times to refresh the Maya viewport.

Returns:

None

Code Examples:

>>> num_refresh = 3
>>> refresh_view(num_refresh)
# Forces a refresh of the Maya viewport three times.
graph TB Start_refreshView[("fa:fa-play Start")] --> CheckNum{{"/fas:fa-question Check num"}} CheckNum --"If num is provided" --> RefreshLoop["/fas:fa-sync-alt Refresh Loop"] CheckNum --"If num is not provided" --> End_refreshView[("fas:fa-stop End")] RefreshLoop --> End_refreshView style Start_refreshView fill:#00cc00,stroke:#000,stroke-width:3px style CheckNum fill:#ffcc00,stroke:#000,stroke-width:2px style RefreshLoop fill:#99ccff,stroke:#000,stroke-width:2px style End_refreshView fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the _refreshView function:

  1. The function starts by checking if num is provided.

  2. If num is provided, it enters a loop to refresh the Maya viewport the specified number of times.

  3. If num is not provided, the function ends.

eTest._selectHI(self, objName, objType='jnt', topSelect=True, includeShapes=False, **shArgs)#

[**shArgs : obn=objName, ot=objType, ts=topSelect, ins=includeShapes]

Purpose:

:: Selects all objects of a given type under the specified object and returns the selection.

Parameters:
  • objName – <str> #The name of the object under which to select.

  • objType – <str> #The type of objects to select (e.g., ‘jnt’, ‘curv’, ‘mesh’). Defaults to ‘jnt’.

  • topSelect – <bool> #Whether to include the top object in the selection. Defaults to True.

  • includeShapes – <bool> #Whether to include shape nodes in the selection. Defaults to False.

Returns:

<list> #A list of selected objects as per the specified object type.

graph TB Start_selectHI[("fa:fa-play Start")] --> CheckShArgs_selectHI{{"/fas:fa-question Check shArgs"}} CheckShArgs_selectHI --"If shArgs is provided" --> UpdateParams_selectHI["/fas:fa-sync-alt Update Parameters"] CheckShArgs_selectHI --"If shArgs is not provided" --> DetermineObjType_selectHI["/fas:fa-filter Determine Object Type"] UpdateParams_selectHI --> DetermineObjType_selectHI DetermineObjType_selectHI --> SelectObject_selectHI["/fas:fa-mouse-pointer Select Object"] SelectObject_selectHI --> HierarchicalSelection_selectHI["/fas:fa-sitemap Hierarchical Selection"] HierarchicalSelection_selectHI --> ObjectTypeCheck_selectHI{{"/fas:fa-question Check Object Type"}} ObjectTypeCheck_selectHI --"If objType starts with '^'" --> ToggleSelect_selectHI["/fas:fa-toggle-on Toggle Selection"] ObjectTypeCheck_selectHI --"If objType does not start with '^'" --> DeselectUnmatched_selectHI["/fas:fa-times-circle Deselect Unmatched"] ToggleSelect_selectHI --> TopSelectionCheck_selectHI{{"/fas:fa-question Top Selection Check"}} DeselectUnmatched_selectHI --> TopSelectionCheck_selectHI TopSelectionCheck_selectHI --"If topSelect is False" --> DeselectTopObject_selectHI["/fas:fa-minus-square Deselect Top Object"] TopSelectionCheck_selectHI --"If topSelect is True" --> IncludeShapesCheck_selectHI{{"/fas:fa-question Include Shapes Check"}} DeselectTopObject_selectHI --> IncludeShapesCheck_selectHI IncludeShapesCheck_selectHI --"If includeShapes is True" --> SelectShapes_selectHI["/fas:fa-plus-square Select Shapes"] IncludeShapesCheck_selectHI --"If includeShapes is False" --> ReturnSelection_selectHI["/fas:fa-check-circle Return Selection"] SelectShapes_selectHI --> ReturnSelection_selectHI style Start_selectHI fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_selectHI fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_selectHI fill:#ff9999,stroke:#000,stroke-width:2px style DetermineObjType_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style SelectObject_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style HierarchicalSelection_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style ObjectTypeCheck_selectHI fill:#ffcc00,stroke:#000,stroke-width:2px style ToggleSelect_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style DeselectUnmatched_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style TopSelectionCheck_selectHI fill:#ffcc00,stroke:#000,stroke-width:2px style DeselectTopObject_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style IncludeShapesCheck_selectHI fill:#ffcc00,stroke:#000,stroke-width:2px style SelectShapes_selectHI fill:#99ccff,stroke:#000,stroke-width:2px style ReturnSelection_selectHI fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the _selectHI function:

  1. The function updates parameters if shArgs are provided, determines the object type, selects objects hierarchically based on the type, and returns the selection. It also includes logic for toggling selection and including shapes based on parameters.

eTest.as_eTest(self)#

Purpose:

:: To Support main scripts with repetitive tasks via eTest.

eTest.check4KeyFrames(self, ctrlList, **shArgs)#

[**shArgs : cl=ctrlList]

Purpose:

:: Checks for keyframes on a list of controls and selects any controls with keyframes.

  • Vital for animation workflows to identify animated controls quickly.

  • Scans a list of control nodes and selects those which have keyframe animation.

Parameters:

ctrlList – <list> # The list of controls to check for keyframes.

Returns:

None, but selects controls with keyframes if found.

Code Examples:

>>> control_list = ["ctrl1", "ctrl2", "ctrl3"]
>>> check4KeyFrames(control_list)
# Selects controls from the list that have keyframe animation.
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 --> MapControls{"/fas:fa-list Map Controls"} MapControls --"For Each Control in ctrlList"--> CheckKeyframes{"/fas:fa-key Check Keyframes"} CheckKeyframes --"If Keyframes Found"--> AppendToList["/fas:fa-plus Append To List"] CheckKeyframes --"If No Keyframes Found"--> NoKeyframesFound["/fas:fa-exclamation-triangle No Keyframes Found"] AppendToList --"Append Control to keysList"--> MapControls NoKeyframesFound --"Select All Controls"--> ConfirmAction{"/fas:fa-check-circle Confirm Action"} ConfirmAction --"Confirm Action"--> 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 MapControls fill:#cc99ff,stroke:#000,stroke-width:2px style CheckKeyframes fill:#ffcc99,stroke:#000,stroke-width:2px style AppendToList fill:#ccffcc,stroke:#000,stroke-width:2px style NoKeyframesFound fill:#ff6666,stroke:#000,stroke-width:3px style ConfirmAction fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the check4KeyFrames function:

  • Checks if shArgs exist, and if so, parses the cl from it.

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

  • Maps the controls provided in ctrlList.

  • For each control in ctrlList, checks if keyframes are found.

  • If keyframes are found, appends the control to keysList.

  • If no keyframes are found on any control, selects all controls and confirms the action.

eTest.computeTime(self, runCompute=True, killTime=False, processName=None, **shArgs)#

[**shArgs : rc=runCompute, kt=killTime, pn=processName]

Purpose:

:: Computes the elapsed time since ‘startTime’ was called.

  • Essential for performance analysis and timing in scripts and automation tasks.

  • Calculates the time elapsed since the startTime function was initiated, useful for tracking operation durations.

Parameters:
  • runCompute – <bool> # If True, computes the elapsed time. Defaults to True.

  • killTime – <bool> # If True, stops the timer after computation. Defaults to False.

  • processName – <str, optional> # Name of the process for which time is being computed.

Returns:

<list> # [[hours, minutes, seconds], formattedTime] representing the elapsed time.

Code Examples:

>>> computeTime(True, False, "Modeling Process")
# Computes the elapsed time since the last invocation of `startTime`, specifically for the "Modeling Process".

Returns

| [[progressHour, progressMinute, progressSecond], '%dHr %dMin %dSec' % (progressHour, progressMinute, progressSecond)]
| For Example:
| [[0, 10, 25], '0Hr 10Min 25Sec']
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 --> ComputeElapsedTime{"/fas:fa-clock Compute Elapsed Time"} ComputeElapsedTime --"If runCompute is True"--> GetElapsedTime["/fas:fa-check-circle Get Elapsed Time"] GetElapsedTime --"Get Elapsed Time"--> CalculateTimeComponents["/fas:fa-calculator Calculate Time Components"] CalculateTimeComponents --"Calculate Hours, Minutes, and Seconds"--> DisplayInfo["/fas:fa-info-circle Display Info"] DisplayInfo --"Display Information Message"--> 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 ComputeElapsedTime fill:#cc99ff,stroke:#000,stroke-width:2px style GetElapsedTime fill:#00cc00,stroke:#000,stroke-width:3px style CalculateTimeComponents fill:#ccffcc,stroke:#000,stroke-width:2px style DisplayInfo fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the computeTime function:

  • Checks if shArgs exist, and if so, parses the rc, kt, and pn from it.

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

  • Computes the elapsed time since the last invocation of startTime if runCompute is True.

  • Gets the elapsed time and calculates hours, minutes, and seconds.

  • Displays an informational message with the computed time.

eTest.getMObject(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Retrieves the MObject for a given Maya object.

  • Essential in Maya API programming for obtaining the MObject, which represents Maya objects in a more complex way than just their names.

  • Facilitates advanced operations and manipulations on Maya objects using the API.

Parameters:

obj – <str> # The name of the Maya object.

Returns:

The MObject corresponding to the given Maya object.

Code Examples:

>>> maya_object_name = "pCube1"
>>> mobject = getMObject(maya_object_name)
# Retrieves the MObject for 'pCube1'.
graph TB Start_getMObject[("fa:fa-play Start")] --> CheckShArgs_getMObject{{"/fas:fa-question Check shArgs"}} CheckShArgs_getMObject --"If shArgs provided" --> UpdateObj_getMObject["/fas:fa-sync-alt Update Obj"] CheckShArgs_getMObject --"If shArgs not provided" --> SelectObj_getMObject["/fas:fa-mouse-pointer Select Object"] UpdateObj_getMObject --> SelectObj_getMObject SelectObj_getMObject --> GetMObject_getMObject["/fas:fa-object-group Get MObject"] GetMObject_getMObject --> ReturnMObject_getMObject["/fas:fa-check-circle-o Return MObject"] style Start_getMObject fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_getMObject fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_getMObject fill:#99ccff,stroke:#000,stroke-width:2px style SelectObj_getMObject fill:#99ccff,stroke:#000,stroke-width:2px style GetMObject_getMObject fill:#99ccff,stroke:#000,stroke-width:2px style ReturnMObject_getMObject fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the getMObject function:

  1. The function starts by checking for shArgs and updates the object if provided.

  2. It then selects the specified Maya object.

  3. The function retrieves the MObject for the given Maya object and returns it.

eTest.hasMeshContainsPoint(self, checkMesh=None, checkPointOrObj=None, **shArgs)#

[**shArgs : cm=checkMesh, cp=checkPointOrObj]

Purpose:

:: Determines if a mesh contains a specified point.

  • Useful in collision detection, physics simulations, and procedural modeling.

  • Checks whether a given point or object’s position is within the volume of a specified mesh.

Parameters:
  • checkMesh – <str> # The mesh to check against.

  • checkPointOrObj – <list/str> # The point coordinates or object to check if it’s inside the mesh.

Returns:

<bool> # True if the mesh contains the point or object, False otherwise.

Code Examples:

>>> mesh_name = "pSphere1"
>>> point = [1, 2, 3]
>>> is_point_inside = hasMeshContainsPoint(mesh_name, point)
# Determines if the point [1, 2, 3] is inside the mesh 'pSphere1'.
graph TB Start_hasMeshContainsPoint[("fa:fa-play Start")] --> CheckShArgs_hasMeshContainsPoint{{"/fas:fa-question Check shArgs"}} CheckShArgs_hasMeshContainsPoint --"If shArgs provided" --> UpdateParams_hasMeshContainsPoint["/fas:fa-sync-alt Update Parameters"] CheckShArgs_hasMeshContainsPoint --"If shArgs not provided" --> GetMeshNode_hasMeshContainsPoint{{"/fas:fa-cube Get Mesh Node"}} UpdateParams_hasMeshContainsPoint --> GetMeshNode_hasMeshContainsPoint GetMeshNode_hasMeshContainsPoint --> DeterminePoint_hasMeshContainsPoint{{"/fas:fa-question Determine Point"}} DeterminePoint_hasMeshContainsPoint --"Determine if inside mesh" --> CheckPointInMesh_hasMeshContainsPoint{{"/fas:fa-question Check Point in Mesh"}} CheckPointInMesh_hasMeshContainsPoint --"If point inside mesh" --> ReturnTrue_hasMeshContainsPoint["/fas:fa-check-circle-o Return True"] CheckPointInMesh_hasMeshContainsPoint --"If point outside mesh" --> ReturnFalse_hasMeshContainsPoint["/fas:fa-times-circle-o Return False"] style Start_hasMeshContainsPoint fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_hasMeshContainsPoint fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_hasMeshContainsPoint fill:#99ccff,stroke:#000,stroke-width:2px style GetMeshNode_hasMeshContainsPoint fill:#99ccff,stroke:#000,stroke-width:2px style DeterminePoint_hasMeshContainsPoint fill:#ffcc00,stroke:#000,stroke-width:2px style CheckPointInMesh_hasMeshContainsPoint fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_hasMeshContainsPoint fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_hasMeshContainsPoint fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the hasMeshContainsPoint function:

  1. The function starts by checking for shArgs and updates parameters if provided.

  2. It retrieves the mesh node and determines the point or object’s position to check.

  3. The function checks if the specified point is inside the mesh and returns True or False accordingly.

eTest.isAnimated(self, ctrlList, testType='any', **shArgs)#

[**shArgs : cl=ctrlList, tt=testType]

Purpose:

:: Checks if the given control list has any animation.

  • Determines the presence of keyframes on a list of control nodes.

  • Supports different testing types, either checking if any or all controls are animated.

Parameters:
  • ctrlList – <list> #The list of controls to check for animation.

  • testType – <str> #Specifies the type of test - ‘any’ or ‘all’.

Returns:

<list> #[True, animCtrlList] if animated controls are found, [False, None] otherwise.

Code Examples:

>>> controls = ["ctrl1", "ctrl2", "ctrl3"]
>>> test_type = "any"
>>> animation_check = isAnimated(controls, test_type)
# Checks if any of the controls in the list have animation.

Args:

testType = ‘any’ | ‘all’

Returns:

if animCtrlList:

return [True, animCtrlList]

else:

return [False, None]

graph TB Start_isAnimated[("fa:fa-play Start")] --> CheckTestType_isAnimated{{"/fas:fa-question Check Test Type"}} CheckTestType_isAnimated --"If testType is neither 'any' nor 'all'" --> RaiseError_isAnimated["/fas:fa-exclamation-triangle Raise Error"] CheckTestType_isAnimated --"If testType is valid" --> InitializeLists_isAnimated["/fas:fa-list-ol Initialize Lists"] InitializeLists_isAnimated --> IterateControls_isAnimated{{"/fas:fa-repeat Iterate Controls"}} IterateControls_isAnimated --"For each control" --> CheckKeyframe_isAnimated{{"/fas:fa-question Check Keyframe"}} CheckKeyframe_isAnimated --"If keyframe exists" --> AppendToAnimList_isAnimated["/fas:fa-plus-square Append to Anim List"] CheckKeyframe_isAnimated --"If no keyframe" --> AppendToBoolList_isAnimated["/fas:fa-plus-square Append to Bool List"] AppendToAnimList_isAnimated --> NextControl_isAnimated{{"/fas:fa-arrow-right Next Control"}} AppendToBoolList_isAnimated --> NextControl_isAnimated NextControl_isAnimated --"If more controls" --> IterateControls_isAnimated NextControl_isAnimated --"If no more controls" --> EvaluateAnimation_isAnimated{{"/fas:fa-balance-scale Evaluate Animation"}} EvaluateAnimation_isAnimated --"Evaluate based on testType" --> ReturnResult_isAnimated["/fas:fa-check-circle Return Result"] style Start_isAnimated fill:#00cc00,stroke:#000,stroke-width:3px style CheckTestType_isAnimated fill:#ffcc00,stroke:#000,stroke-width:2px style RaiseError_isAnimated fill:#ff6666,stroke:#000,stroke-width:2px style InitializeLists_isAnimated fill:#99ccff,stroke:#000,stroke-width:2px style IterateControls_isAnimated fill:#ffcc00,stroke:#000,stroke-width:2px style CheckKeyframe_isAnimated fill:#ffcc00,stroke:#000,stroke-width:2px style AppendToAnimList_isAnimated fill:#99ccff,stroke:#000,stroke-width:2px style AppendToBoolList_isAnimated fill:#99ccff,stroke:#000,stroke-width:2px style NextControl_isAnimated fill:#ffcc00,stroke:#000,stroke-width:2px style EvaluateAnimation_isAnimated fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnResult_isAnimated fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isAnimated function:

  1. The function starts by checking the validity of the testType (‘any’ or ‘all’).

  2. It initializes lists for storing animation controls and boolean results.

  3. The function iterates through each control in the control list to check for keyframes.

  4. If keyframes are found, the control is appended to the animated control list; otherwise, it’s appended to the boolean list.

  5. After iterating through all controls, the function evaluates animation based on the specified testType and returns the result.

eTest.isAttr(self, objNAttr, **shArgs)#

[**shArgs : oa=objNAttr]

Purpose:

:: Determines if the specified object attribute exists.

Parameters:

objNAttr – <str> # The object and attribute in the format ‘object.attribute’.

Returns:

<bool> # True if the attribute exists on the specified object, False otherwise.

Code Examples:

>>> attr_to_check = "myObject.myAttribute"
>>> result = isAttr(attr_to_check)
# Explain above code in one line
graph TB Start_isAttr[("fa:fa-play Start")] --> CheckFormat_isAttr{{"/fas:fa-question Check Format"}} CheckFormat_isAttr --"If format is 'object.attribute'" --> SplitObjAttr_isAttr["/fas:fa-cut Split Object & Attribute"] CheckFormat_isAttr --"If format is not 'object.attribute'" --> ReturnFalse_isAttr1["/fas:fa-times Return False"] SplitObjAttr_isAttr --> CheckExistence_isAttr{{"/fas:fa-question Check Attribute Existence"}} CheckExistence_isAttr --"If attribute exists" --> ReturnTrue_isAttr["/fas:fa-check Return True"] CheckExistence_isAttr --"If attribute does not exist" --> ReturnFalse_isAttr2["/fas:fa-times Return False"] style Start_isAttr fill:#00cc00,stroke:#000,stroke-width:3px style CheckFormat_isAttr fill:#ffcc00,stroke:#000,stroke-width:2px style SplitObjAttr_isAttr fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFalse_isAttr1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckExistence_isAttr fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isAttr fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isAttr2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isAttr function:

  1. The function starts by checking the format of the input, ensuring it’s in the ‘object.attribute’ format.

  2. If the format is correct, it splits the input into object and attribute components.

  3. The function then checks if the attribute exists on the specified object, returning True if it does and False otherwise.

eTest.isAttrLocked(self, objNAttr, **shArgs)#

[**shArgs : oa=objNAttr]

Purpose:

:: Checks if the specified object attribute is locked.

Parameters:

objNAttr – <str> # The object and attribute in the format ‘object.attribute’.

Returns:

<bool> # True if the attribute is locked, False otherwise.

Code Examples:

>>> attr_to_check = "myObject.myAttribute"
>>> result = isAttrLocked(attr_to_check)
# Explain above code in one line
graph TB Start_isAttrLocked[("fa:fa-play Start")] --> CheckString_isAttrLocked{{"/fas:fa-question Check String Format"}} CheckString_isAttrLocked --"If format is not 'object.attribute'" --> ReturnFalse_isAttrLocked1["/fas:fa-times Return False"] CheckString_isAttrLocked --"If format is 'object.attribute'" --> SplitObjAttr_isAttrLocked["/fas:fa-cut Split Object and Attribute"] SplitObjAttr_isAttrLocked --> CheckExistence_isAttrLocked{{"/fas:fa-question Check Object & Attribute Existence"}} CheckExistence_isAttrLocked --"If object or attribute does not exist" --> ReturnFalse_isAttrLocked2["/fas:fa-times Return False"] CheckExistence_isAttrLocked --"If both exist" --> CheckLockStatus_isAttrLocked{{"/fas:fa-lock Check Lock Status"}} CheckLockStatus_isAttrLocked --"If attribute is locked" --> ReturnTrue_isAttrLocked["/fas:fa-check Return True"] CheckLockStatus_isAttrLocked --"If attribute is not locked" --> ReturnFalse_isAttrLocked3["/fas:fa-times Return False"] style Start_isAttrLocked fill:#00cc00,stroke:#000,stroke-width:3px style CheckString_isAttrLocked fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isAttrLocked1 fill:#ff6666,stroke:#000,stroke-width:2px style SplitObjAttr_isAttrLocked fill:#99ccff,stroke:#000,stroke-width:2px style CheckExistence_isAttrLocked fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isAttrLocked2 fill:#ff6666,stroke:#000,stroke-width:2px style CheckLockStatus_isAttrLocked fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isAttrLocked fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isAttrLocked3 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isAttrLocked function:

  1. The function starts by checking if the input string is in the ‘object.attribute’ format.

  2. If the format is correct, it splits the string into object and attribute parts.

  3. The function then checks if both the object and attribute exist.

  4. If they exist, it checks if the attribute is locked and returns True or False accordingly.

eTest.isBlendShape(self, blendShape, **shArgs)#

[**shArgs : bs=blendShape]

Purpose:

:: Tests if a node is a valid blendShape deformer.

  • This function verifies the existence and type of the given blendShape node in Maya.

  • It’s useful for ensuring the integrity of deformers in rigging and animation pipelines.

Parameters:

blendShape – <str> #Name of the blendShape to query.

Returns:

<bool> #True if the node is a valid blendShape deformer, False otherwise.

Code Examples:

>>> blend_shape_name = "faceBlendShape"
>>> is_valid_blend_shape = isBlendShape(blend_shape_name)
# This example checks if 'faceBlendShape' is a valid blendShape deformer.
graph TB Start_isBlendShape[("fa:fa-play Start")] --> CheckBlendShapeExists_isBlendShape{{"/fas:fa-question Check BlendShape Exists"}} CheckBlendShapeExists_isBlendShape --"If blendShape does not exist" --> ReturnFalse_isBlendShape1["/fas:fa-times Return False"] CheckBlendShapeExists_isBlendShape --"If blendShape exists" --> CheckObjectType_isBlendShape{{"/fas:fa-question Check Object Type"}} CheckObjectType_isBlendShape --"If object type is not 'blendShape'" --> ReturnFalse_isBlendShape2["/fas:fa-times Return False"] CheckObjectType_isBlendShape --"If object type is 'blendShape'" --> ReturnTrue_isBlendShape["/fas:fa-check Return True"] style Start_isBlendShape fill:#00cc00,stroke:#000,stroke-width:3px style CheckBlendShapeExists_isBlendShape fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isBlendShape1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckObjectType_isBlendShape fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isBlendShape2 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isBlendShape fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isBlendShape function:

  1. The function starts by checking if the specified blendShape node exists.

  2. If the blendShape exists, it verifies whether the node is of type ‘blendShape’.

  3. The function returns True if the node is a valid blendShape deformer, and False otherwise.

eTest.isComponent(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Determines if the specified object is a component.

  • Useful in scripting and automation for differentiating between objects and their components.

  • Identifies if the given entity in Maya is a component like a vertex, edge, or face.

Parameters:

obj – <str> # The object to be checked.

Returns:

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

Code Examples:

>>> object_component = "pCube1.vtx[0]"
>>> is_comp = isComponent(object_component)
# Checks if 'pCube1.vtx[0]' is a component of an object.
graph TB Start_isComponent[("fa:fa-play Start")] --> CheckShArgs_isComponent{{"/fas:fa-question Check shArgs"}} CheckShArgs_isComponent --"If shArgs provided" --> UpdateObj_isComponent["/fas:fa-sync-alt Update Obj"] CheckShArgs_isComponent --"If shArgs not provided" --> CheckObjType_isComponent{{"/fas:fa-question Check Object Type"}} UpdateObj_isComponent --> CheckObjType_isComponent CheckObjType_isComponent --"If object is not a string" --> ReturnFalse_isComponent1["/fas:fa-times-circle-o Return False"] CheckObjType_isComponent --"If object is a string" --> CheckComponent_isComponent{{"/fas:fa-question Check Component"}} CheckComponent_isComponent --"If not a component" --> ReturnFalse_isComponent2["/fas:fa-times-circle-o Return False"] CheckComponent_isComponent --"If a component" --> ReturnTrue_isComponent["/fas:fa-check-circle-o Return True"] style Start_isComponent fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isComponent fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isComponent fill:#99ccff,stroke:#000,stroke-width:2px style CheckObjType_isComponent fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isComponent1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckComponent_isComponent fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isComponent2 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isComponent fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isComponent function:

  1. The function starts by checking for shArgs and updates the object if provided.

  2. It then checks if the object is a string type.

  3. The function determines if the string represents a component and returns True or False accordingly.

eTest.isCurv(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks if the specified object is a NURBS curve.

  • Essential in modeling and animation pipelines for identifying curve objects.

  • Determines if a given Maya object is a NURBS curve, which is often used in path animations, rigging, etc.

Parameters:

obj – <str> # The object to be checked.

Returns:

<bool> # True if the object is a NURBS curve, False otherwise.

Code Examples:

>>> object_name = "controlCurve1"
>>> is_nurbs_curve = isCurv(object_name)
# Verifies if 'controlCurve1' is a NURBS curve in Maya.
graph TB Start_isCurv[("fa:fa-play Start")] --> CheckShArgs_isCurv{{"/fas:fa-question Check shArgs"}} CheckShArgs_isCurv --"If shArgs provided" --> UpdateObj_isCurv["/fas:fa-sync-alt Update Obj"] CheckShArgs_isCurv --"If shArgs not provided" --> GetShape_isCurv{{"/fas:fa-cube Get Shape"}} UpdateObj_isCurv --> GetShape_isCurv GetShape_isCurv --"If obj has shape" --> CheckCurve_isCurv{{"/fas:fa-question Check if Curve"}} GetShape_isCurv --"If obj has no shape" --> ReturnFalse_isCurv1["/fas:fa-times-circle-o Return False"] CheckCurve_isCurv --"If obj is Curve" --> ReturnTrue_isCurv["/fas:fa-check-circle-o Return True"] CheckCurve_isCurv --"If obj is not Curve" --> ReturnFalse_isCurv2["/fas:fa-times-circle-o Return False"] style Start_isCurv fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isCurv fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isCurv fill:#99ccff,stroke:#000,stroke-width:2px style GetShape_isCurv fill:#99ccff,stroke:#000,stroke-width:2px style CheckCurve_isCurv fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isCurv1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isCurv fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isCurv2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isCurv function:

  1. The function begins by checking for shArgs and updates the object if provided.

  2. It then retrieves the shape of the object.

  3. The function checks if the object or its shape is a NURBS curve and returns True or False accordingly.

eTest.isDeformer(self, deformer, **shArgs)#

[**shArgs : d=deformer]

Purpose:

:: Checks if the given node is a valid deformer.

  • Crucial for rigging and animation workflows to verify deformer nodes.

  • Determines whether a specified node is a deformer, which is used to manipulate geometry.

Parameters:

deformer – <str> # The name of the deformer to check.

Returns:

<bool> # True if the node is a valid deformer, False otherwise.

Code Examples:

>>> deformer_name = "bend1"
>>> is_valid_deformer = isDeformer(deformer_name)
# Checks if 'bend1' is a valid deformer node in Maya.
graph TB Start_isDeformer[("fa:fa-play Start")] --> CheckShArgs_isDeformer{{"/fas:fa-question Check shArgs"}} CheckShArgs_isDeformer --"If shArgs provided" --> UpdateDeformer_isDeformer["/fas:fa-sync-alt Update Deformer"] CheckShArgs_isDeformer --"If shArgs not provided" --> CheckExists_isDeformer{{"/fas:fa-question Check if Deformer Exists"}} UpdateDeformer_isDeformer --> CheckExists_isDeformer CheckExists_isDeformer --"If deformer does not exist" --> ReturnFalse_isDeformer1["/fas:fa-times-circle-o Return False"] CheckExists_isDeformer --"If deformer exists" --> CheckDeformerType_isDeformer{{"/fas:fa-question Check Deformer Type"}} CheckDeformerType_isDeformer --"If not a geometry filter" --> ReturnFalse_isDeformer2["/fas:fa-times-circle-o Return False"] CheckDeformerType_isDeformer --"If a geometry filter" --> ReturnTrue_isDeformer["/fas:fa-check-circle-o Return True"] style Start_isDeformer fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isDeformer fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateDeformer_isDeformer fill:#99ccff,stroke:#000,stroke-width:2px style CheckExists_isDeformer fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isDeformer1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckDeformerType_isDeformer fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isDeformer2 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isDeformer fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isDeformer function:

  1. The function starts by checking for shArgs and updates the deformer if provided.

  2. It then checks if the deformer exists in the scene.

  3. The function determines if the node is a valid deformer type (geometry filter) and returns True or False accordingly.

eTest.isEdge(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Determines if the specified object is an edge component.

  • Useful in modeling and geometry analysis scripts.

  • Checks if the given object reference in Maya is an edge component of a mesh.

Parameters:

obj – <str> # The object to be checked.

Returns:

<bool> # True if the object is an edge component, False otherwise.

Code Examples:

>>> edge_component = "pCube1.e[0]"
>>> is_edge = isEdge(edge_component)
# Determines if 'pCube1.e[0]' is an edge component of the object 'pCube1'.
eTest.isFace(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Determines if the specified object is a face component.

  • Critical for modeling scripts and algorithms that need to interact with face components.

  • Checks if a given object reference in Maya is a face component of a mesh.

Parameters:

obj – <str> # The object to be checked.

Returns:

<bool> # True if the object is a face component, False otherwise.

Code Examples:

>>> face_component = "pCube1.f[2]"
>>> is_face = isFace(face_component)
# Determines if 'pCube1.f[2]' is a face component of the object 'pCube1'.
eTest.isFollicle(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks if the specified object is a follicle.

  • Important in hair and fur dynamics, as well as certain rigging scenarios.

  • Assesses whether a given Maya node is a follicle, which is used for hair simulation and attachment.

Parameters:

obj – <str> # The object to be checked.

Returns:

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

Code Examples:

>>> follicle_object = "hairFollicle1"
>>> is_follicle = isFollicle(follicle_object)
# Checks if 'hairFollicle1' is a follicle node in Maya.
graph TB Start_isFollicle[("fa:fa-play Start")] --> CheckShArgs_isFollicle{{"/fas:fa-question Check shArgs"}} CheckShArgs_isFollicle --"If shArgs provided" --> UpdateObj_isFollicle["/fas:fa-sync-alt Update Obj"] CheckShArgs_isFollicle --"If shArgs not provided" --> CheckExists_isFollicle{{"/fas:fa-question Check if Exists"}} UpdateObj_isFollicle --> CheckExists_isFollicle CheckExists_isFollicle --"If object does not exist" --> ReturnFalse_isFollicle1["/fas:fa-times-circle-o Return False"] CheckExists_isFollicle --"If object exists" --> CheckTransform_isFollicle{{"/fas:fa-question Check if Transform"}} CheckTransform_isFollicle --"If not transform" --> CheckFollicle_isFollicle{{"/fas:fa-question Check if Follicle"}} CheckTransform_isFollicle --"If transform" --> GetShape_isFollicle["/fas:fa-sitemap Get Shape"] GetShape_isFollicle --> CheckFollicle_isFollicle CheckFollicle_isFollicle --"If follicle" --> ReturnTrue_isFollicle["/fas:fa-check-circle-o Return True"] CheckFollicle_isFollicle --"If not follicle" --> ReturnFalse_isFollicle2["/fas:fa-times-circle-o Return False"] style Start_isFollicle fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isFollicle fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isFollicle fill:#99ccff,stroke:#000,stroke-width:2px style CheckExists_isFollicle fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isFollicle1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckTransform_isFollicle fill:#ffcc00,stroke:#000,stroke-width:2px style GetShape_isFollicle fill:#99ccff,stroke:#000,stroke-width:2px style CheckFollicle_isFollicle fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isFollicle fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isFollicle2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isFollicle function:

  1. The function starts by checking for shArgs and updates the object if provided.

  2. It checks if the object exists in the scene.

  3. If the object is a transform, it retrieves the shape of the object.

  4. The function then determines if the object or its shape is a follicle and returns True or False accordingly.

eTest.isFreezed(self, objList, attrList=['t', 'r', 's'], checkAllParents=1, getUnfreezed=0, *args, **kwargs)#

[**shArgs : ol=objList, al=attrList, cap=checkAllParents, guf=getUnfreezed]

Purpose:

:: Determines if the specified objects have their specified attributes freezed.

  • Useful in rigging and animation, to verify if transformation attributes are locked or in a default state.

  • Checks whether attributes like translation, rotation, and scale have been frozen on the objects.

Parameters:
  • objList – <list> # The list of objects to be checked.

  • attrList – <list> # The list of attributes to check for freeze status.

  • checkAllParents – <bool> # If True, checks all parent objects as well. Defaults to True.

  • getUnfreezed – <bool> # If True, returns objects that are not freezed. Defaults to False.

Returns:

<bool> # True if all specified attributes on all specified objects are freezed, False otherwise.

Code Examples:

>>> objects_to_check = ["pCube1", "pSphere1"]
>>> attributes_to_check = ["t", "r", "s"]
>>> are_attributes_freezed = isFreezed(objects_to_check, attributes_to_check)
# Checks if translation, rotation, and scale are frozen on pCube1 and pSphere1.
graph TB Start_isFreezed[("fa:fa-play Start")] --> CheckShArgs_isFreezed{{"/fas:fa-question Check shArgs"}} CheckShArgs_isFreezed --"If shArgs provided" --> UpdateParams_isFreezed["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isFreezed --"If shArgs not provided" --> CheckEachObj_isFreezed{{"/fas:fa-question Check Each Object"}} UpdateParams_isFreezed --> CheckEachObj_isFreezed CheckEachObj_isFreezed --"If any object not freezed" --> ReturnFalse_isFreezed["/fas:fa-times-circle-o Return False"] CheckEachObj_isFreezed --"If all objects freezed" --> ReturnTrue_isFreezed["/fas:fa-check-circle-o Return True"] style Start_isFreezed fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isFreezed fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isFreezed fill:#99ccff,stroke:#000,stroke-width:2px style CheckEachObj_isFreezed fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isFreezed fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isFreezed fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isFreezed function:

  1. The function begins by checking for shArgs and updates the parameters if provided.

  2. It then assesses each object in the list to determine if the specified attributes are freezed.

  3. The function returns True if all specified attributes on all specified objects are freezed, otherwise False.

eTest.isHairSystem(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks if the specified object is a hair system.

  • Important for dynamics and grooming workflows in Maya.

  • Determines whether a given node in the scene is a hair system, which is used for simulating hair and fur dynamics.

Parameters:

obj – <str> # The object to be checked.

Returns:

<bool> # True if the object is a hair system, False otherwise.

Code Examples:

>>> hair_system_name = "hairSystem1"
>>> is_hair_system = isHairSystem(hair_system_name)
# Verifies if 'hairSystem1' is a hair system node in Maya.
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 --> CheckObjectExists{"/fas:fa-check-square Check Object Exists"} CheckObjectExists --"If Object Does Not Exist"--> ReturnFalse["/fas:fa-times Return False"] CheckObjectExists --"If Object Exists"--> CheckObjectType{"/fas:fa-question-circle Check Object Type"} CheckObjectType --"If Object Type is Transform"--> CheckShapeExists["/fas:fa-question-circle Check Shape Exists"] CheckShapeExists --"If Shape Exists"--> CheckHairSystem["/fas:fa-question-circle Check Hair System"] CheckShapeExists --"If Shape Does Not Exist"--> ReturnFalse["/fas:fa-times Return False"] CheckHairSystem --"If Object Type is Hair System"--> ReturnTrue["/fas:fa-check Return True"] CheckHairSystem --"If Object Type is Not Hair System"--> ReturnFalse ReturnFalse --"Return False"--> End["/fas:fa-stop End"] ReturnTrue --"Return True"--> 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 CheckObjectExists fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:3px style CheckObjectType fill:#99ff99,stroke:#000,stroke-width:2px style CheckShapeExists fill:#ffcc99,stroke:#000,stroke-width:2px style CheckHairSystem fill:#ccffcc,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isHairSystem function:

  • Checks if shArgs exist, and if so, parses the o from it.

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

  • Checks if the specified object (obj) exists in the scene. If not, returns False.

  • If the object exists, it checks whether its type is a transform.

  • If it’s a transform, it checks if it has a shape node.

  • If the shape node exists, it checks if the object type of the shape node is a hair system.

  • If the object type is a hair system, returns True.

  • If the object type is not a hair system, returns False.

eTest.isHidden(self, obj, checkParents=True, **shArgs)#

[**shArgs : o=obj, cp=checkParents]

Purpose:

:: Determines if an object is hidden in the scene.

  • Crucial for scene management and optimization, ensuring hidden objects are not unnecessarily processed.

  • Assesses the visibility of an object, considering its own visibility attribute and optionally its parents’.

Parameters:
  • obj – <str> # The object to check.

  • checkParents – <bool> # If True, also checks the visibility of parent objects. Defaults to True.

Returns:

<bool> # True if the object is hidden, False otherwise.

Code Examples:

>>> object_name = "pCube1"
>>> is_object_hidden = isHidden(object_name)
# Checks if 'pCube1' is hidden in the Maya scene.
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 --> CheckVisibility{"/fas:fa-eye Check Visibility"} CheckVisibility --"If Object is Not Visible"--> ReturnTrue["/fas:fa-check Return True"] CheckVisibility --"If Object is Visible"--> ReturnFalse["/fas:fa-times Return False"] ReturnTrue --"Return True"--> End["/fas:fa-stop End"] ReturnFalse --"Return False"--> 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 CheckVisibility fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:3px 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 isHidden function:

  • Checks if shArgs exist, and if so, parses the o and cp from it.

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

  • Checks the visibility of the provided object (obj).

  • If the object is not visible, returns True (indicating it is hidden).

  • If the object is visible, returns False.

eTest.isInTime(self, startDate=[1, 1, 2017], endDate=[1, 1, 2018], onlineTime=True, **shArgs)#

[**shArgs : sd=startDate, ed=endDate, ot=onlineTime]

Purpose:

:: Checks if the current date falls within a specified time range.

  • Useful for applications involving license checks or time-based features.

  • Compares the current date against a specified start and end date range.

Parameters:
  • startDate – <list> # The start date in the format [day, month, year].

  • endDate – <list> # The end date in the format [day, month, year].

  • onlineTime – <bool> # Whether to use online time for the check. Defaults to True.

Returns:

<bool> # True if the current date is within the specified range, False otherwise.

Code Examples:

>>> start_date = [1, 1, 2022]
>>> end_date = [31, 12, 2022]
>>> is_within_time = isInTime(start_date, end_date)
# Checks if the current date is between 1st Jan 2022 and 31st Dec 2022.
graph TB Start_isInTime[("fa:fa-play Start")] --> CheckShArgs_isInTime{{"/fas:fa-question Check shArgs"}} CheckShArgs_isInTime --"If shArgs provided" --> UpdateParams_isInTime["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isInTime --"If shArgs not provided" --> GetCurrentDate_isInTime{{"/fas:fa-calendar-alt Get Current Date"}} UpdateParams_isInTime --> GetCurrentDate_isInTime GetCurrentDate_isInTime --> CheckDateRange_isInTime{{"/fas:fa-question Check Date Range"}} CheckDateRange_isInTime --"If date is out of range" --> ReturnFalse_isInTime["/fas:fa-times Return False"] CheckDateRange_isInTime --"If date is in range" --> ReturnTrue_isInTime["/fas:fa-check Return True"] style Start_isInTime fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isInTime fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isInTime fill:#99ccff,stroke:#000,stroke-width:2px style GetCurrentDate_isInTime fill:#99ccff,stroke:#000,stroke-width:2px style CheckDateRange_isInTime fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isInTime fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isInTime fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isInTime function:

  1. The function starts by checking for shArgs and updates the parameters if provided.

  2. It then retrieves the current date.

  3. The function checks if the current date is within the specified start and end date range and returns True or False accordingly.

eTest.isJnt(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks if the specified object is a joint.

  • Vital for rigging and skinning processes to identify joint nodes.

  • Determines if a given Maya object is a joint, which is a crucial element in skeletal animation.

Parameters:

obj – <str> # The object to be checked.

Returns:

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

Code Examples:

>>> joint_name = "arm_joint"
>>> is_joint = isJnt(joint_name)
# Verifies if 'arm_joint' is a joint in Maya.
graph TB Start_isJnt[("fa:fa-play Start")] --> CheckShArgs_isJnt{{"/fas:fa-question Check shArgs"}} CheckShArgs_isJnt --"If shArgs provided" --> UpdateObj_isJnt["/fas:fa-sync-alt Update Obj"] CheckShArgs_isJnt --"If shArgs not provided" --> CheckNodeType_isJnt{{"/fas:fa-question Check Node Type"}} UpdateObj_isJnt --> CheckNodeType_isJnt CheckNodeType_isJnt --"If not a joint" --> ReturnFalse_isJnt["/fas:fa-times-circle-o Return False"] CheckNodeType_isJnt --"If a joint" --> ReturnTrue_isJnt["/fas:fa-check-circle-o Return True"] style Start_isJnt fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isJnt fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isJnt fill:#99ccff,stroke:#000,stroke-width:2px style CheckNodeType_isJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isJnt fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isJnt fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isJnt function:

  1. The function checks for shArgs and updates the object if provided.

  2. It then determines the node type of the object.

  3. The function returns True if the object is a joint, otherwise False.

eTest.isLastJnt(self, jnt, numFromEnd=0, **shArgs)#

[**shArgs : j=jnt, nfe=numFromEnd]

Purpose:

:: Checks if a joint is the last in a joint chain.

  • Critical in rigging, especially for tail or end-effector setups.

  • Determines if a specified joint is the last joint in its chain, based on hierarchy or a specified number from the end.

Parameters:
  • jnt – <str> # The joint to be checked.

  • numFromEnd – <int> # Number of joints from the end to consider. Defaults to 0.

Returns:

<bool> # True if the joint is the last in the joint chain, False otherwise.

Code Examples:

>>> joint_name = "finger_end_joint"
>>> is_end_joint = isLastJnt(joint_name)
# Checks if 'finger_end_joint' is the last joint in its chain.
graph TB Start_isLastJnt[("fa:fa-play Start")] --> CheckShArgs_isLastJnt{{"/fas:fa-question Check shArgs"}} CheckShArgs_isLastJnt --"If shArgs provided" --> UpdateParams_isLastJnt["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isLastJnt --"If shArgs not provided" --> CheckJointType_isLastJnt{{"/fas:fa-question Check Joint Type"}} UpdateParams_isLastJnt --> CheckJointType_isLastJnt CheckJointType_isLastJnt --"If not a joint" --> Error_isLastJnt["/fas:fa-exclamation-triangle Error"] CheckJointType_isLastJnt --"If joint" --> CheckLastJoint_isLastJnt{{"/fas:fa-question Check Last Joint"}} Error_isLastJnt --> ReturnFalse_isLastJnt1["/fas:fa-times-circle-o Return False"] CheckLastJoint_isLastJnt --"If last joint" --> ReturnTrue_isLastJnt["/fas:fa-check-circle-o Return True"] CheckLastJoint_isLastJnt --"If not last joint" --> ReturnFalse_isLastJnt2["/fas:fa-times-circle-o Return False"] style Start_isLastJnt fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isLastJnt fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isLastJnt fill:#99ccff,stroke:#000,stroke-width:2px style CheckJointType_isLastJnt fill:#ffcc00,stroke:#000,stroke-width:2px style Error_isLastJnt fill:#ff9999,stroke:#000,stroke-width:2px style CheckLastJoint_isLastJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isLastJnt1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isLastJnt fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isLastJnt2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isLastJnt function:

  1. The function starts by checking for shArgs and updates parameters if provided.

  2. It then checks if the specified object is a joint.

  3. The function determines if the joint is the last in its chain and returns True or False.

  4. If the object is not a joint, an error is raised and False is returned.

eTest.isLastSkinJnt(self, jnt, skinJntList, numFromEnd=0, useSeries=False, asNodes_given=False, **shArgs)#

[**shArgs : j=jnt, sjl=skinJntList, nfe=numFromEnd, us=useSeries, ag=asNodes_given]

Purpose:

:: Checks if a joint is the last in a chain of skin joints.

  • Essential for rigging systems to determine the end of a joint chain influencing a skinned mesh.

  • Assesses if a given joint is the terminal joint in a sequence of skin influencing joints.

Parameters:
  • jnt – <str> # The joint to be checked.

  • skinJntList – <list> # The list of skin joints.

  • numFromEnd – <int> # Number of joints from the end to consider. Defaults to 0.

  • useSeries – <bool> # Whether to consider a series of joints. Defaults to False.

  • asNodes_given – <bool> # Whether the provided skinJntList consists of asNode objects. Defaults to False.

Returns:

<bool> # True if the joint is the last in the skin joint chain, False otherwise.

Code Examples:

>>> joint_to_check = "spine_end_joint"
>>> skin_joint_list = ["spine_01", "spine_02", "spine_end_joint"]
>>> is_end_joint = isLastSkinJnt(joint_to_check, skin_joint_list)
# Evaluates if 'spine_end_joint' is the last joint in the skinning chain of the spine.
graph TB Start_isLastSkinJnt[("fa:fa-play Start")] --> CheckShArgs_isLastSkinJnt{{"/fas:fa-question Check shArgs"}} CheckShArgs_isLastSkinJnt --"If shArgs provided" --> UpdateParams_isLastSkinJnt["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isLastSkinJnt --"If shArgs not provided" --> ValidateJoint_isLastSkinJnt{{"/fas:fa-question Validate Joint"}} UpdateParams_isLastSkinJnt --> ValidateJoint_isLastSkinJnt ValidateJoint_isLastSkinJnt --"If not a joint" --> ReturnFalse_isLastSkinJnt1["/fas:fa-times Return False"] ValidateJoint_isLastSkinJnt --"If it's a joint" --> CheckJointInSet_isLastSkinJnt{{"/fas:fa-question Check Joint In Set"}} CheckJointInSet_isLastSkinJnt --"If joint not in set" --> ReturnFalse_isLastSkinJnt2["/fas:fa-times Return False"] CheckJointInSet_isLastSkinJnt --"If joint in set" --> CheckEndJoint_isLastSkinJnt{{"/fas:fa-question Check if End Joint"}} CheckEndJoint_isLastSkinJnt --"If end joint" --> ReturnTrue_isLastSkinJnt["/fas:fa-check Return True"] CheckEndJoint_isLastSkinJnt --"If not end joint" --> ReturnFalse_isLastSkinJnt3["/fas:fa-times Return False"] style Start_isLastSkinJnt fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isLastSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isLastSkinJnt fill:#99ccff,stroke:#000,stroke-width:2px style ValidateJoint_isLastSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isLastSkinJnt1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckJointInSet_isLastSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isLastSkinJnt2 fill:#ff6666,stroke:#000,stroke-width:2px style CheckEndJoint_isLastSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isLastSkinJnt fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isLastSkinJnt3 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isLastSkinJnt function:

  1. The function checks for shArgs and updates the parameters if provided.

  2. It validates if the specified joint is actually a joint.

  3. The function checks if the joint is in the set of skin joints.

  4. If in the set, it assesses whether the joint is the end joint in the skin joint chain.

  5. The function returns True if it’s the end joint, otherwise False.

eTest.isLockedAttr(self, objNAttr, **shArgs)#

[**shArgs : ona=objNAttr]

Purpose:

:: Checks if the specified object attribute is locked.

  • Useful for rigging and scripting workflows to ensure the integrity of attribute states.

  • Can be applied to any Maya node attribute to determine its lock status.

Parameters:

objNAttr – <str> #The object and attribute in the format ‘object.attribute’.

Returns:

<bool> #True if the specified attribute is locked, False otherwise.

Code Examples:

>>> obj_attribute = "pCube1.translateX"
>>> is_locked = isLockedAttr(obj_attribute)
# This example checks if the translateX attribute of pCube1 is locked.
graph TB Start_isLockedAttr[("fa:fa-play Start")] --> CheckIsAttr_isLockedAttr{{"/fas:fa-question Check if Attribute Exists"}} CheckIsAttr_isLockedAttr --"If attribute exists" --> SplitObjNAttr_isLockedAttr["/fas:fa-code-branch Split Object and Attribute"] CheckIsAttr_isLockedAttr --"If attribute does not exist" --> ReturnFalse_isLockedAttr1["/fas:fa-times Return False"] SplitObjNAttr_isLockedAttr --> CheckAttrType_isLockedAttr{{"/fas:fa-question Check Attribute Type"}} CheckAttrType_isLockedAttr --"If type is 'double3'" --> CheckSubAttrs_isLockedAttr{{"/fas:fa-question Check Sub-Attributes"}} CheckAttrType_isLockedAttr --"If other types" --> CheckLockStatus_isLockedAttr{{"/fas:fa-lock Check Lock Status"}} CheckSubAttrs_isLockedAttr --"If sub-attributes exist" --> LoopSubAttrs_isLockedAttr{{"/fas:fa-repeat Loop Through Sub-Attributes"}} LoopSubAttrs_isLockedAttr --"Check each sub-attribute lock status" --> IsSubAttrLocked_isLockedAttr{{"/fas:fa-question Is Sub-Attribute Locked?"}} IsSubAttrLocked_isLockedAttr --"If any sub-attribute is locked" --> ReturnTrue_isLockedAttr["/fas:fa-check Return True"] IsSubAttrLocked_isLockedAttr --"If no sub-attribute is locked" --> ReturnFalse_isLockedAttr2["/fas:fa-times Return False"] CheckLockStatus_isLockedAttr --"If attribute is locked" --> ReturnTrue_isLockedAttr CheckLockStatus_isLockedAttr --"If attribute is not locked" --> ReturnFalse_isLockedAttr3["/fas:fa-times Return False"] style Start_isLockedAttr fill:#00cc00,stroke:#000,stroke-width:3px style CheckIsAttr_isLockedAttr fill:#ffcc00,stroke:#000,stroke-width:2px style SplitObjNAttr_isLockedAttr fill:#99ccff,stroke:#000,stroke-width:2px style CheckAttrType_isLockedAttr fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSubAttrs_isLockedAttr fill:#ffcc00,stroke:#000,stroke-width:2px style LoopSubAttrs_isLockedAttr fill:#99ccff,stroke:#000,stroke-width:2px style IsSubAttrLocked_isLockedAttr fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isLockedAttr fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isLockedAttr1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnFalse_isLockedAttr2 fill:#ff6666,stroke:#000,stroke-width:2px style CheckLockStatus_isLockedAttr fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isLockedAttr3 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isLockedAttr function:

  1. The function starts by checking if the attribute exists.

  2. If it exists, it splits the object and attribute and checks the attribute type.

  3. For ‘double3’ type, it loops through sub-attributes to check if any are locked.

  4. For other types, it directly checks the lock status of the attribute.

  5. The function returns True if the attribute or any sub-attribute is locked, and False otherwise.

eTest.isMesh(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Determines if the specified object is a mesh.

  • Essential for modeling and rigging processes to validate object types.

  • Helps in ensuring that operations like deformations or UV mappings are applied to the correct object type.

Parameters:

obj – <str> #The object to be checked.

Returns:

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

Code Examples:

>>> object_name = "pCube1"
>>> is_object_mesh = isMesh(object_name)
# Checks if 'pCube1' is a mesh object in the scene.
graph TB Start_isMesh[("fa:fa-play Start")] --> CheckShArgs_isMesh{{"/fas:fa-question Check shArgs"}} CheckShArgs_isMesh --"If shArgs provided" --> UpdateObj_isMesh["/fas:fa-sync-alt Update obj"] CheckShArgs_isMesh --"If shArgs not provided" --> GetShape_isMesh{{"/fas:fa-cube Get Shape"}} UpdateObj_isMesh --> GetShape_isMesh GetShape_isMesh --"If obj has shape" --> CheckMesh_isMesh{{"/fas:fa-question Check if Mesh"}} GetShape_isMesh --"If obj has no shape" --> ReturnFalse_isMesh1["/fas:fa-times Return False"] CheckMesh_isMesh --"If obj is Mesh" --> ReturnTrue_isMesh["/fas:fa-check Return True"] CheckMesh_isMesh --"If obj is not Mesh" --> ReturnFalse_isMesh2["/fas:fa-times Return False"] style Start_isMesh fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isMesh fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isMesh fill:#99ccff,stroke:#000,stroke-width:2px style GetShape_isMesh fill:#99ccff,stroke:#000,stroke-width:2px style CheckMesh_isMesh fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isMesh1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isMesh fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isMesh2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isMesh function:

  1. The function checks for shArgs and updates the object if provided.

  2. It then retrieves the shape of the object.

  3. The function checks if the object or its shape is a mesh and returns True or False accordingly.

eTest.isNodeType(self, obj, objType='curv', **shArgs)#

[**shArgs : o=obj, ot=objType]

Purpose:

:: Determines if the specified object is of a certain node type.

  • Useful for scripts and automation that require validation of node types.

  • Checks if the given object in Maya is of a specific node type, like ‘mesh’, ‘joint’, etc.

Parameters:
  • obj – <str> # The object to be checked.

  • objType – <str> # The node type to check for.

Returns:

<bool> # True if the object is of the specified node type, False otherwise.

Code Examples:

>>> object_name = "pCube1"
>>> node_type = "mesh"
>>> is_specific_node_type = isNodeType(object_name, node_type)
# Determines if 'pCube1' is a node of type 'mesh'.
graph TB Start_isNodeType[("fa:fa-play Start")] --> CheckShArgs_isNodeType{{"/fas:fa-question Check shArgs"}} CheckShArgs_isNodeType --"If shArgs provided" --> UpdateParams_isNodeType["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isNodeType --"If shArgs not provided" --> CheckNodeType_isNodeType{{"/fas:fa-question Check Node Type"}} UpdateParams_isNodeType --> CheckNodeType_isNodeType CheckNodeType_isNodeType --"If type is 'curv'" --> CheckCurve_isNodeType{{"/fas:fa-curve-line Check if Curve"}} CheckNodeType_isNodeType --"If type is 'jnt' or 'joint'" --> CheckJoint_isNodeType{{"/fas:fa-anchor Check if Joint"}} CheckNodeType_isNodeType --"Other types" --> ReturnFalse_isNodeType1["/fas:fa-times-circle-o Return False"] CheckCurve_isNodeType --"If object is Curve" --> ReturnTrue_isNodeType1["/fas:fa-check-circle-o Return True"] CheckCurve_isNodeType --"If object is not Curve" --> ReturnFalse_isNodeType2["/fas:fa-times-circle-o Return False"] CheckJoint_isNodeType --"If object is Joint" --> ReturnTrue_isNodeType2["/fas:fa-check-circle-o Return True"] CheckJoint_isNodeType --"If object is not Joint" --> ReturnFalse_isNodeType3["/fas:fa-times-circle-o Return False"] style Start_isNodeType fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isNodeType fill:#99ccff,stroke:#000,stroke-width:2px style CheckNodeType_isNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style CheckCurve_isNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isNodeType1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isNodeType1 fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isNodeType2 fill:#ff6666,stroke:#000,stroke-width:2px style CheckJoint_isNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isNodeType2 fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isNodeType3 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isNodeType function:

  1. The function starts by checking for shArgs and updates parameters if provided.

  2. It then checks the specified node type (e.g., ‘curv’, ‘jnt’).

  3. The function determines if the object matches the specified node type (Curve or Joint) and returns True or False.

eTest.isNum(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Determines if the given object is a number (integer, float, or long).

Argument | Description:

Parameters:

(varied) (obj) – The object to be checked.

Return (bool):

True if the object is a number (integer, float, or long), False otherwise.

Code Examples:

>>> number = 42
>>> if isNum(number):
...     print("It's a number!")
... else:
...     print("It's not a number.")
graph TB Start_isNum[("fa:fa-play Start")] --> CheckShArgs_isNum{{"/fas:fa-question Check shArgs"}} CheckShArgs_isNum --"If shArgs is provided" --> UpdateObj_isNum["/fas:fa-sync-alt Update obj"] CheckShArgs_isNum --"If shArgs is not provided" --> CheckNumber_isNum{{"/fas:fa-question Is Number?"}} UpdateObj_isNum --> CheckNumber_isNum CheckNumber_isNum --"If obj is a number" --> ReturnTrue_isNum["/fas:fa-check-circle Return True"] CheckNumber_isNum --"If obj is not a number" --> ReturnFalse_isNum["/fas:fa-times-circle Return False"] ReturnTrue_isNum --> End_isNum[("fas:fa-stop End")] ReturnFalse_isNum --> End_isNum style Start_isNum fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isNum fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isNum fill:#ff9999,stroke:#000,stroke-width:2px style CheckNumber_isNum fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isNum fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isNum fill:#99ff99,stroke:#000,stroke-width:2px style End_isNum fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isNum function:

  1. The function checks if shArgs are provided and updates obj accordingly.

  2. It then determines if the object is a number (integer, float, or long).

  3. The function returns True if it is a number, and False otherwise.

eTest.isNurbsSurface(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks whether the specified object is a NURBS surface or the transform parent of a surface.

Parameters:

(str) (obj) – The object to be queried.

Return (bool):

True if the object is a NURBS surface or transform parent of a surface, False otherwise.

Code Examples:

>>> obj_to_check = "nurbsSurface1"
>>> result = isNurbsSurface(obj_to_check)
# Explain above code in one line
graph TB Start_isNurbsSurface[("fa:fa-play Start")] --> CheckObjExists_isNurbsSurface{{"/fas:fa-question Check Object Exists"}} CheckObjExists_isNurbsSurface --"If object does not exist" --> ReturnFalse_isNurbsSurface1["/fas:fa-times Return False"] CheckObjExists_isNurbsSurface --"If object exists" --> CheckObjectType_isNurbsSurface{{"/fas:fa-question Check Object Type"}} CheckObjectType_isNurbsSurface --"If object type is 'transform'" --> GetShape_isNurbsSurface["/fas:fa-sitemap Get Shape"] CheckObjectType_isNurbsSurface --"If object type is not 'transform'" --> CheckNurbsSurface_isNurbsSurface{{"/fas:fa-question Check if NURBS Surface"}} GetShape_isNurbsSurface --> CheckNurbsSurface_isNurbsSurface CheckNurbsSurface_isNurbsSurface --"If not a NURBS surface" --> ReturnFalse_isNurbsSurface2["/fas:fa-times Return False"] CheckNurbsSurface_isNurbsSurface --"If it's a NURBS surface" --> ReturnTrue_isNurbsSurface["/fas:fa-check Return True"] style Start_isNurbsSurface fill:#00cc00,stroke:#000,stroke-width:3px style CheckObjExists_isNurbsSurface fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isNurbsSurface1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckObjectType_isNurbsSurface fill:#ffcc00,stroke:#000,stroke-width:2px style GetShape_isNurbsSurface fill:#99ccff,stroke:#000,stroke-width:2px style CheckNurbsSurface_isNurbsSurface fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isNurbsSurface2 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isNurbsSurface fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isNurbsSurface function:

  1. The function begins by checking if the specified object exists.

  2. If the object exists, it checks whether the object is a transform, and if so, retrieves its shape.

  3. The function then determines if the object or its shape is a NURBS surface and returns True or False accordingly.

eTest.isPosList(self, posList, **shArgs)#

[**shArgs : pl=posList]

Purpose:

:: Determines if the given list represents a valid position (x, y, z coordinates).

  • Utilized in scripting for validating coordinates or positions in 3D space.

  • Checks if a provided list or tuple correctly represents a 3D coordinate.

Parameters:

posList – <list/tuple> # The position list to be checked.

Returns:

<bool> # True if the list represents a valid position, False otherwise.

Code Examples:

>>> position = [0, 5, 10]
>>> is_valid_position = isPosList(position)
# Verifies if [0, 5, 10] is a valid 3D position.
graph TB Start_isPosList[("fa:fa-play Start")] --> CheckShArgs_isPosList{{"/fas:fa-question Check shArgs"}} CheckShArgs_isPosList --"If shArgs provided" --> UpdatePosList_isPosList["/fas:fa-sync-alt Update PosList"] CheckShArgs_isPosList --"If shArgs not provided" --> CheckListType_isPosList{{"/fas:fa-question Check List Type"}} UpdatePosList_isPosList --> CheckListType_isPosList CheckListType_isPosList --"If not list or tuple" --> ReturnFalse_isPosList1["/fas:fa-times-circle-o Return False"] CheckListType_isPosList --"If list or tuple" --> CheckListSize_isPosList{{"/fas:fa-question Check List Size"}} CheckListSize_isPosList --"If not 3 elements" --> ReturnFalse_isPosList2["/fas:fa-times-circle-o Return False"] CheckListSize_isPosList --"If 3 elements" --> CheckElements_isPosList{{"/fas:fa-question Check Elements"}} CheckElements_isPosList --"If valid positions" --> Return
True_isPosList[“/fas:fa-check-circle-o Return True”]

CheckElements_isPosList –“If invalid positions” –> ReturnFalse_isPosList3[“/fas:fa-times-circle-o Return False”] style Start_isPosList fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isPosList fill:#ffcc00,stroke:#000,stroke-width:2px style UpdatePosList_isPosList fill:#99ccff,stroke:#000,stroke-width:2px style CheckListType_isPosList fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isPosList1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckListSize_isPosList fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isPosList2 fill:#ff6666,stroke:#000,stroke-width:2px style CheckElements_isPosList fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isPosList fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isPosList3 fill:#ff6666,stroke:#000,stroke-width:2px

Flow Chart Description:

This flowchart illustrates the isPosList function:

  1. The function checks for shArgs and updates the position list if provided.

  2. It then validates the type of the position list (list or tuple).

  3. The function checks if the list has 3 elements, representing a valid 3D position, and returns True or False accordingly.

eTest.isReference(self, refNode, **shArgs)#

[**shArgs : rn=refNode]

Purpose:

:: Checks if the given node is a valid reference node.

  • Essential for scene management and data referencing in Maya.

  • Verifies if the specified node is part of the scene’s reference network.

Parameters:

refNode – <str> # The reference node to query.

Returns:

<bool> # True if the node is a valid reference node, False otherwise.

Code Examples:

>>> reference_node_name = "characterRefNode"
>>> is_valid_reference = isReference(reference_node_name)
# Determines if 'characterRefNode' is a valid reference node in the scene.
graph TB Start_isReference[("fa:fa-play Start")] --> CheckShArgs_isReference{{"/fas:fa-question Check shArgs"}} CheckShArgs_isReference --"If shArgs provided" --> UpdateRefNode_isReference["/fas:fa-sync-alt Update refNode"] CheckShArgs_isReference --"If shArgs not provided" --> CheckValidReference_isReference{{"/fas:fa-question Check Valid Reference"}} UpdateRefNode_isReference --> CheckValidReference_isReference CheckValidReference_isReference --"If not a valid reference" --> ReturnFalse_isReference["/fas:fa-times Return False"] CheckValidReference_isReference --"If valid reference" --> ReturnTrue_isReference["/fas:fa-check Return True"] style Start_isReference fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isReference fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateRefNode_isReference fill:#99ccff,stroke:#000,stroke-width:2px style CheckValidReference_isReference fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isReference fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isReference fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isReference function:

  1. The function starts by checking for shArgs and updates the reference node if provided.

  2. It then checks if the node is a valid reference node in the scene.

  3. The function returns True if the node is a valid reference, otherwise False.

eTest.isReferenceLoaded(self, refNode, **shArgs)#

[**shArgs : rn=refNode]

Purpose:

:: Checks if the reference of the given reference node is currently loaded.

  • Useful for verifying the load state of referenced assets in a scene.

  • Determines whether the referenced content of a node is actively loaded in Maya.

Parameters:

refNode – <str> # The reference node to query.

Returns:

<bool> # True if the reference is currently loaded, False otherwise.

Code Examples:

>>> ref_node = "environment_refNode"
>>> is_ref_loaded = isReferenceLoaded(ref_node)
# Verifies if the reference linked to 'environment_refNode' is currently loaded in the scene.
graph TB Start_isReferenceLoaded[("fa:fa-play Start")] --> CheckShArgs_isReferenceLoaded{{"/fas:fa-question Check shArgs"}} CheckShArgs_isReferenceLoaded --"If shArgs provided" --> UpdateRefNode_isReferenceLoaded["/fas:fa-sync-alt Update refNode"] CheckShArgs_isReferenceLoaded --"If shArgs not provided" --> ValidateRefNode_isReferenceLoaded{{"/fas:fa-question Validate Reference Node"}} UpdateRefNode_isReferenceLoaded --> ValidateRefNode_isReferenceLoaded ValidateRefNode_isReferenceLoaded --"If not valid reference node" --> Error_isReferenceLoaded["/fas:fa-exclamation-triangle Error"] ValidateRefNode_isReferenceLoaded --"If valid reference node" --> CheckLoadState_isReferenceLoaded{{"/fas:fa-question Check Load State"}} Error_isReferenceLoaded --> ReturnFalse_isReferenceLoaded1["/fas:fa-times Return False"] CheckLoadState_isReferenceLoaded --"If reference loaded" --> ReturnTrue_isReferenceLoaded["/fas:fa-check Return True"] CheckLoadState_isReferenceLoaded --"If reference not loaded" --> ReturnFalse_isReferenceLoaded2["/fas:fa-times Return False"] style Start_isReferenceLoaded fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isReferenceLoaded fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateRefNode_isReferenceLoaded fill:#99ccff,stroke:#000,stroke-width:2px style ValidateRefNode_isReferenceLoaded fill:#ffcc00,stroke:#000,stroke-width:2px style Error_isReferenceLoaded fill:#ff9999,stroke:#000,stroke-width:2px style CheckLoadState_isReferenceLoaded fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isReferenceLoaded1 fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isReferenceLoaded fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isReferenceLoaded2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isReferenceLoaded function:

  1. The function checks for shArgs and updates the reference node if provided.

  2. It validates if the provided node is a valid reference node.

  3. The function then checks the load state of the reference and returns True if loaded, otherwise False.

  4. If the reference node is not valid, an error is raised, and False is returned.

eTest.isReferenced(self, node, **shArgs)#

[**shArgs : n=node]

Purpose:

:: Checks if the given node is referenced from an external file.

  • Crucial for asset management in complex Maya scenes.

  • Determines if a node is linked to an external file, indicating a reference.

Parameters:

node – <str> # The node to query.

Returns:

<bool> # True if the node is referenced from an external file, False otherwise.

Code Examples:

>>> node_name = "characterModel_grp"
>>> is_referenced_node = isReferenced(node_name)
# Checks if 'characterModel_grp' is a referenced node linked to an external file.
graph TB Start_isReference[("fa:fa-play Start")] --> CheckShArgs_isReference{{"/fas:fa-question Check shArgs"}} CheckShArgs_isReference --"If shArgs provided" --> UpdateRefNode_isReference["/fas:fa-sync-alt Update refNode"] CheckShArgs_isReference --"If shArgs not provided" --> CheckValidReference_isReference{{"/fas:fa-question Check Valid Reference"}} UpdateRefNode_isReference --> CheckValidReference_isReference CheckValidReference_isReference --"If not a valid reference" --> ReturnFalse_isReference["/fas:fa-times Return False"] CheckValidReference_isReference --"If valid reference" --> ReturnTrue_isReference["/fas:fa-check Return True"] style Start_isReference fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isReference fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateRefNode_isReference fill:#99ccff,stroke:#000,stroke-width:2px style CheckValidReference_isReference fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isReference fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isReference fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isReference function:

  1. The function starts by checking for shArgs and updates the reference node if provided.

  2. It then checks if the node is a valid reference node in the scene.

  3. The function returns True if the node is a valid reference, otherwise False.

eTest.isSkinCluster(self, node, **shArgs)#

[**shArgs : n=node]

Purpose:

:: Tests if the input node is a valid skinCluster.

  • Integral for character rigging, ensuring that skin deformations are correctly applied.

  • Checks whether a given node in Maya is a skinCluster, responsible for skin deformation.

Parameters:

node – <str> # The name of the node to be checked.

Returns:

<bool> # True if the node is a valid skinCluster, False otherwise.

Code Examples:

>>> node_name = "skinCluster1"
>>> is_valid_skin_cluster = isSkinCluster(node_name)
# Determines if 'skinCluster1' is a valid skinCluster node in Maya.
graph TB Start_isSkinJnt[("fa:fa-play Start")] --> CheckShArgs_isSkinJnt{{"/fas:fa-question Check shArgs"}} CheckShArgs_isSkinJnt --"If shArgs provided" --> UpdateParams_isSkinJnt["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isSkinJnt --"If shArgs not provided" --> ValidateJnt_isSkinJnt{{"/fas:fa-question Validate Joint"}} UpdateParams_isSkinJnt --> ValidateJnt_isSkinJnt ValidateJnt_isSkinJnt --"If not a valid joint" --> ReturnFalse_isSkinJnt1["/fas:fa-times Return False"] ValidateJnt_isSkinJnt --"If valid joint" --> CheckSkinCluster_isSkinJnt{{"/fas:fa-question Check SkinCluster"}} CheckSkinCluster_isSkinJnt --"If no skinCluster" --> ReturnFalse_isSkinJnt2["/fas:fa-times Return False"] CheckSkinCluster_isSkinJnt --"If skinCluster exists" --> CheckJointInfluence_isSkinJnt{{"/fas:fa-question Check Joint Influence"}} CheckJointInfluence_isSkinJnt --"If joint influences skinCluster" --> ReturnTrue_isSkinJnt["/fas:fa-check Return True"] CheckJointInfluence_isSkinJnt --"If joint does not influence skinCluster" --> ReturnFalse_isSkinJnt3["/fas:fa-times Return False"] style Start_isSkinJnt fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isSkinJnt fill:#99ccff,stroke:#000,stroke-width:2px style ValidateJnt_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isSkinJnt1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckSkinCluster_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isSkinJnt2 fill:#ff6666,stroke:#000,stroke-width:2px style CheckJointInfluence_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isSkinJnt fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isSkinJnt3 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isSkinJnt function:

  1. The function checks for shArgs and updates parameters if provided.

  2. It validates if the provided joint is valid.

  3. The function checks if there is a skinCluster associated with the mesh.

  4. It then determines if the joint is part of the skinCluster for the mesh, returning True or False.

eTest.isSkinJnt(self, jnt, skinMesh, **shArgs)#

[**shArgs : j=jnt, sm=skinMesh]

Purpose:

:: Determines if the specified joint is part of the skinCluster associated with a given mesh.

  • Key function in character rigging to ensure joints are correctly associated with mesh skinning.

  • Checks if a joint is influencing the deformation of a specified mesh via a skinCluster.

Parameters:
  • jnt – <str> # The joint to be checked.

  • skinMesh – <str> # The mesh associated with the skinCluster.

Returns:

<bool> # True if the joint is part of the skinCluster for the mesh, False otherwise.

Code Examples:

>>> joint_name = "arm_joint"
>>> mesh_name = "character_mesh"
>>> is_joint_in_skin_cluster = isSkinJnt(joint_name, mesh_name)
# Verifies if 'arm_joint' is influencing the skinCluster of 'character_mesh'.
graph TB Start_isSkinJnt[("fa:fa-play Start")] --> CheckShArgs_isSkinJnt{{"/fas:fa-question Check shArgs"}} CheckShArgs_isSkinJnt --"If shArgs provided" --> UpdateParams_isSkinJnt["/fas:fa-sync-alt Update Parameters"] CheckShArgs_isSkinJnt --"If shArgs not provided" --> ValidateJoint_isSkinJnt{{"/fas:fa-question Validate Joint"}} UpdateParams_isSkinJnt --> ValidateJoint_isSkinJnt ValidateJoint_isSkinJnt --"If not a joint" --> ReturnFalse_isSkinJnt1["/fas:fa-times Return False"] ValidateJoint_isSkinJnt --"If it's a joint" --> CheckSkinCluster_isSkinJnt{{"/fas:fa-question Check SkinCluster"}} CheckSkinCluster_isSkinJnt --"If SkinCluster exists" --> CheckJointInfluence_isSkinJnt{{"/fas:fa-question Check Joint Influence"}} CheckSkinCluster_isSkinJnt --"If no SkinCluster" --> ReturnTrue_isSkinJnt["/fas:fa-check Return True"] CheckJointInfluence_isSkinJnt --"If joint influences skin" --> ReturnTrue_isSkinJnt2["/fas:fa-check Return True"] CheckJointInfluence_isSkinJnt --"If joint does not influence skin" --> ReturnFalse_isSkinJnt2["/fas:fa-times Return False"] style Start_isSkinJnt fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_isSkinJnt fill:#99ccff,stroke:#000,stroke-width:2px style ValidateJoint_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isSkinJnt1 fill:#ff6666,stroke:#000,stroke-width:2px style CheckSkinCluster_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isSkinJnt fill:#99ff99,stroke:#000,stroke-width:2px style CheckJointInfluence_isSkinJnt fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_isSkinJnt2 fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isSkinJnt2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isSkinJnt function:

  1. The function starts by checking for shArgs and updates the parameters if provided.

  2. It then validates if the specified joint is actually a joint.

  3. The function checks if there is a skinCluster associated with the mesh.

  4. If a skinCluster exists, it checks if the joint is influencing the skinCluster.

  5. The function returns True if the joint influences the skinCluster, otherwise False.

eTest.isSkinned(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks if the specified object has a skinCluster associated with it.

  • This function is vital for character rigging and animation to verify skinning attachments.

  • It checks whether the given Maya object has a skinCluster deformer associated.

Parameters:

obj – <str> # The object to be checked for a skinCluster.

Returns:

<bool> # True if the object has a skinCluster, False otherwise.

Code Examples:

>>> object_name = "characterMesh"
>>> is_skinned = isSkinned(object_name)
# Determines if 'characterMesh' has a skinCluster deformer associated.
graph TB Start_isSkinned[("fa:fa-play Start")] --> CheckShArgs_isSkinned{{"/fas:fa-question Check shArgs"}} CheckShArgs_isSkinned --"If shArgs provided" --> UpdateObj_isSkinned["/fas:fa-sync-alt Update obj"] CheckShArgs_isSkinned --"If shArgs not provided" --> CheckMesh_isSkinned{{"/fas:fa-question Check if Mesh"}} UpdateObj_isSkinned --> CheckMesh_isSkinned CheckMesh_isSkinned --"If obj is Mesh" --> CheckSkinCluster_isSkinned{{"/fas:fa-question Check SkinCluster"}} CheckMesh_isSkinned --"If obj is not Mesh" --> ReturnFalse_isSkinned["/fas:fa-times Return False"] CheckSkinCluster_isSkinned --"If SkinCluster exists" --> ReturnTrue_isSkinned["/fas:fa-check Return True"] CheckSkinCluster_isSkinned --"If no SkinCluster" --> ReturnFalse_isSkinned2["/fas:fa-times Return False"] style Start_isSkinned fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_isSkinned fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateObj_isSkinned fill:#99ccff,stroke:#000,stroke-width:2px style CheckMesh_isSkinned fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSkinCluster_isSkinned fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse_isSkinned fill:#ff6666,stroke:#000,stroke-width:2px style ReturnTrue_isSkinned fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_isSkinned2 fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the isSkinned function:

  1. The function begins by checking for shArgs and updates the object if provided.

  2. It checks if the object is a mesh.

  3. The function then determines if there is a skinCluster associated with the mesh, returning True or False.

eTest.isTransform(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Determines if the specified object is a valid transform node.

  • Essential for rigging, animation, and scene organization, as transform nodes are fundamental in Maya.

  • Verifies if a specified object is a transform node, which are typically used to position, rotate, and scale other objects.

Parameters:

obj – <str> # The object to query.

Returns:

<bool> # True if the object is a valid transform node, False otherwise.

Code Examples:

>>> object_name = "group1"
>>> is_transform_node = isTransform(object_name)
# Verifies if 'group1' is a transform node in Maya.
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 --> CheckObjectExists{"/fas:fa-question-circle Check Object Exists"} CheckObjectExists --"If Object Does Not Exist"--> ReturnFalse["/fas:fa-times Return False"] CheckObjectExists --"If Object Exists"--> CheckTransformType{"/fas:fa-eye Check Transform Type"} CheckTransformType --"If Object is Not a Transform Node"--> ReturnFalse["/fas:fa-times Return False"] CheckTransformType --"If Object is a Transform Node"--> ReturnTrue["/fas:fa-check Return True"] ReturnFalse --"Return False"--> End["/fas:fa-stop End"] ReturnTrue --"Return True"--> 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 CheckObjectExists fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:3px style CheckTransformType fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isTransform function:

  • Checks if shArgs exist, and if so, parses the o from it.

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

  • Checks if the specified object (obj) exists in the scene. If not, returns False.

  • If the object exists, it checks whether it is a valid transform node.

  • If the object is not a transform node, returns False.

  • If the object is a transform node, returns True.

eTest.isType(self, nodeName, nodeType, **shArgs)#

[**shArgs : nn=nodeName, nt=nodeType]

Purpose:

:: Checks if an object is of the specified node type.

  • Useful in various Maya scripting and automation tasks where node type verification is required.

  • Determines if a given object in the Maya scene is of a particular node type specified by the user.

Parameters:
  • nodeName – <str> # The name of the object to query.

  • nodeType – <str> # The node type to check against.

Returns:

<bool> # True if the object is of the specified node type, False otherwise.

Code Examples:

>>> object_name = "pCube1"
>>> type_to_check = "mesh"
>>> is_type_mesh = isType(object_name, type_to_check)
# Checks if 'pCube1' is a mesh type node.
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 --> CheckObjectExists{"/fas:fa-check-square Check Object Exists"} CheckObjectExists --"If Object Does Not Exist"--> ReturnFalse["/fas:fa-times Return False"] CheckObjectExists --"If Object Exists"--> CheckNodeType{"/fas:fa-question-circle Check Node Type"} CheckNodeType --"If Node Type Does Not Match"--> ReturnFalse["/fas:fa-times Return False"] CheckNodeType --"If Node Type Matches"--> ReturnTrue["/fas:fa-check Return True"] ReturnFalse --"Return False"--> End["/fas:fa-stop End"] ReturnTrue --"Return True"--> 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 CheckObjectExists fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:3px style CheckNodeType fill:#99ff99,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isType function:

  • Checks if shArgs exist, and if so, parses the nn and nt from it.

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

  • Checks if the specified object (nodeName) exists in the scene. If not, returns False.

  • If the object exists, it checks whether its node type matches the specified nodeType.

  • If the node type does not match, returns False.

  • If the node type matches, returns True.

eTest.isVisible(self, obj, checkParents=True, **shArgs)#

[**shArgs : o=obj, cp=checkParents]

Purpose:

:: Checks if an object is visible in the scene.

  • Crucial for rendering and scene setup, ensuring objects are correctly set for visibility.

  • Evaluates the visibility of an object, considering both its own and its parents’ visibility settings.

Parameters:
  • obj – <str> # The object to check visibility for.

  • checkParents – <bool> # If True, also checks the visibility of parent objects. Defaults to True.

Returns:

<bool> # True if the object is visible, False otherwise.

Code Examples:

>>> object_name = "pCube1"
>>> is_object_visible = isVisible(object_name)
# Checks the visibility status of 'pCube1' in the Maya scene.
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 --> CheckVisibility{"/fas:fa-eye Check Visibility"} CheckVisibility --"If Object is Not Visible"--> ReturnFalse["/fas:fa-times Return False"] CheckVisibility --"If Object is Visible"--> CheckParentsVisibility{"/fas:fa-check-square Check Parents Visibility"} CheckParentsVisibility --"If checkParents is True"--> GetParentList{"/fas:fa-sitemap Get Parent List"} GetParentList --"For Each Parent Object"--> CheckParentVisibility{"/fas:fa-question-circle Check Parent Visibility"} CheckParentVisibility --"If Parent Object is Not Visible"--> ReturnFalse["/fas:fa-times Return False"] CheckParentVisibility --"If Parent Object is Visible"--> CheckAllParentsVisibility["/fas:fa-check-square Check All Parents Visibility"] CheckAllParentsVisibility --"If All Parents are Visible"--> ReturnTrue["/fas:fa-check Return True"] CheckAllParentsVisibility --"If Not All Parents are Visible"--> ReturnFalse ReturnFalse --"Return False"--> End["/fas:fa-stop End"] ReturnTrue --"Return True"--> 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 CheckVisibility fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:3px style CheckParentsVisibility fill:#99ff99,stroke:#000,stroke-width:2px style GetParentList fill:#ccffcc,stroke:#000,stroke-width:2px style CheckParentVisibility fill:#ffcc99,stroke:#000,stroke-width:2px style CheckAllParentsVisibility fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnTrue fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isVisible function:

  • Checks if shArgs exist, and if so, parses the o and cp from it.

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

  • Checks the visibility of the provided object (obj).

  • If the object is not visible, returns False.

  • If the object is visible and checkParents is True, it checks the visibility of parent objects.

  • For each parent object, it checks if it’s visible. If any parent object is not visible, it returns False.

  • If all parent objects are visible, it returns True.

  • If checkParents is False, it returns True.

eTest.isVtx(self, obj, **shArgs)#

[**shArgs : o=obj]

Purpose:

:: Checks if the specified object is a vertex component.

  • Integral for scripts dealing with vertex-level operations in modeling and rigging.

  • Identifies if a specified entity in Maya is a vertex component of a geometry.

Parameters:

obj – <str> # The object to be checked.

Returns:

<bool> # True if the object is a vertex component, False otherwise.

Code Examples:

>>> vertex_component = "pCube1.vtx[1]"
>>> is_vertex = isVtx(vertex_component)
# Verifies if 'pCube1.vtx[1]' is a vertex component of 'pCube1'.
eTest.objExists(self, objList, **shArgs)#

[**shArgs : ol=objList]

Purpose:

:: Checks if a list of objects exists in the scene.

  • Essential for scripting and scene validation to ensure object references are valid.

  • Evaluates whether each object in a provided list exists within the current Maya scene.

Parameters:

objList – <list> # The list of objects to check.

Returns:

<bool> # True if all objects in the list exist in the scene, False otherwise.

Code Examples:

>>> objects_to_check = ["pCube1", "pSphere1", "pCylinder1"]
>>> do_objects_exist = objExists(objects_to_check)
# Verifies the existence of objects in the provided list in the Maya scene.
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 --> ConvertToList{"/fas:fa-list Convert To List"} ConvertToList --"If objList is Not a List"--> MapToList["/fas:fa-plus Map To List"] ConvertToList --"If objList is Already a List"--> CheckObjectExistence{"/fas:fa-check-circle Check Object Existence"} MapToList --"Map objList to List"--> CheckObjectExistence CheckObjectExistence --"Check If All Objects Exist"--> 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 ConvertToList fill:#cc99ff,stroke:#000,stroke-width:2px style MapToList fill:#ccffcc,stroke:#000,stroke-width:2px style CheckObjectExistence fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the objExists function:

  • Checks if shArgs exist, and if so, parses the ol from it.

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

  • Converts objList to a list if it’s not already a list.

  • Checks if all objects in the list exist in the scene.

eTest.startTime(self, runCompute=True, **shArgs)#

[**shArgs : rc=runCompute]

Purpose:

:: Initiates a timer for computing elapsed time. Required for using ‘eTest.computeTime()’.

  • Useful in scripting scenarios where timing operations or processes is necessary.

  • Starts a timer to track the duration of tasks, facilitating performance measurements.

Parameters:

runCompute – <bool> # If True, starts the timer. Defaults to True.

Returns:

None, but initiates the timer for time computation.

Code Examples:

>>> startTime(True)
# Starts a timer for subsequent computation of elapsed time.
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 --> StartTimer{"/fas:fa-clock Start Timer"} StartTimer --"If runCompute is True"--> SetGlobalStartTime["/fas:fa-check-circle Set Global Start Time"] SetGlobalStartTime --"Set Global Start Time"--> DisplayInfo["/fas:fa-info-circle Display Info"] DisplayInfo --"Display Information Message"--> 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 StartTimer fill:#cc99ff,stroke:#000,stroke-width:2px style SetGlobalStartTime fill:#00cc00,stroke:#000,stroke-width:3px style DisplayInfo fill:#ccffcc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the startTime function:

  • Checks if shArgs exist, and if so, parses the rc from it.

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

  • Starts a timer to track elapsed time if runCompute is True.

  • Sets the global start time for time computation.

  • Displays an informational message.