eTest#

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:
Testing and Validation: The eTest module is designed for testing and validating rigging scripts in Maya, ensuring their correct and efficient functionality.
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.
Debugging Support: The module includes tools and functions that aid in debugging rigging scripts, facilitating the swift identification and resolution of issues.
Performance Evaluation: eTest is equipped with functionalities to assess the performance of various rigging setups, aiming to guarantee optimal efficiency and resource management.
Integration with Rigging Workflow: Seamlessly integrating into the rigging workflow, eTest provides tools that complement and bolster existing rigging processes.
User-Friendly Testing Environment: eTest features a user-friendly interface for conducting tests, making it accessible to users across different levels of technical skill.
Customizable Testing Framework: The module offers customizable options to suit specific rigging needs or scenarios, allowing for flexible testing of diverse rig types.
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
- Flow Chart Description:
This flowchart illustrates the _confirmAction function:
The function begins by checking shArgs and updating parameters accordingly.
It then checks if raiseErr is True, and if so, displays a confirm dialog and raises an error.
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
No specific actionStart/ Check shArgs/ Confirm Dialog/ Raise Error- Flow Chart Description:
This flowchart illustrates the _error function:
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.
If shArgs is providedIf shArgs is not providedStart/ Check shArgs/ Update parentNS/ Get Reference List/ Return Reference Nodes- Flow Chart Description:
This flowchart illustrates the _listReferences function:
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.
If num is providedIf num is not providedStart/ Check num/ Refresh LoopEnd- Flow Chart Description:
This flowchart illustrates the _refreshView function:
The function starts by checking if num is provided.
If num is provided, it enters a loop to refresh the Maya viewport the specified number of times.
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.
If shArgs is providedIf shArgs is not providedIf objType starts with '^'If objType does not start with '^'If topSelect is FalseIf topSelect is TrueIf includeShapes is TrueIf includeShapes is FalseStart/ Check shArgs/ Update Parameters/ Determine Object Type/ Select Object/ Hierarchical Selection/ Check Object Type/ Toggle Selection/ Deselect Unmatched/ Top Selection Check/ Deselect Top Object/ Include Shapes Check/ Select Shapes/ Return Selection- Flow Chart Description:
This flowchart illustrates the _selectHI function:
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.
If shArgs ExistIf shArgs Does Not ExistFor Each Control in ctrlListIf Keyframes FoundIf No Keyframes FoundAppend Control to keysListSelect All ControlsConfirm ActionStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Map Controls/ Check Keyframes/ Append To List/ No Keyframes Found/ Confirm Action/ End- 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']
If shArgs ExistIf shArgs Does Not ExistIf runCompute is TrueGet Elapsed TimeCalculate Hours, Minutes, and SecondsDisplay Information MessageStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Compute Elapsed Time/ Get Elapsed Time/ Calculate Time Components/ Display Info/ End- 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'.
If shArgs providedIf shArgs not providedStart/ Check shArgs/ Update Obj/ Select Object/ Get MObject/ Return MObject- Flow Chart Description:
This flowchart illustrates the getMObject function:
The function starts by checking for shArgs and updates the object if provided.
It then selects the specified Maya object.
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'.
If shArgs providedIf shArgs not providedDetermine if inside meshIf point inside meshIf point outside meshStart/ Check shArgs/ Update Parameters/ Get Mesh Node/ Determine Point/ Check Point in Mesh/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the hasMeshContainsPoint function:
The function starts by checking for shArgs and updates parameters if provided.
It retrieves the mesh node and determines the point or object’s position to check.
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]
If testType is neither 'any' nor 'all'If testType is validFor each controlIf keyframe existsIf no keyframeIf more controlsIf no more controlsEvaluate based on testTypeStart/ Check Test Type/ Raise Error/ Initialize Lists/ Iterate Controls/ Check Keyframe/ Append to Anim List/ Append to Bool List/ Next Control/ Evaluate Animation/ Return Result- Flow Chart Description:
This flowchart illustrates the isAnimated function:
The function starts by checking the validity of the testType (‘any’ or ‘all’).
It initializes lists for storing animation controls and boolean results.
The function iterates through each control in the control list to check for keyframes.
If keyframes are found, the control is appended to the animated control list; otherwise, it’s appended to the boolean list.
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
If format is 'object.attribute'If format is not 'object.attribute'If attribute existsIf attribute does not existStart/ Check Format/ Split Object & Attribute/ Return False/ Check Attribute Existence/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isAttr function:
The function starts by checking the format of the input, ensuring it’s in the ‘object.attribute’ format.
If the format is correct, it splits the input into object and attribute components.
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
If format is not 'object.attribute'If format is 'object.attribute'If object or attribute does not existIf both existIf attribute is lockedIf attribute is not lockedStart/ Check String Format/ Return False/ Split Object and Attribute/ Check Object & Attribute Existence/ Return False/ Check Lock Status/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isAttrLocked function:
The function starts by checking if the input string is in the ‘object.attribute’ format.
If the format is correct, it splits the string into object and attribute parts.
The function then checks if both the object and attribute exist.
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.
If blendShape does not existIf blendShape existsIf object type is not 'blendShape'If object type is 'blendShape'Start/ Check BlendShape Exists/ Return False/ Check Object Type/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isBlendShape function:
The function starts by checking if the specified blendShape node exists.
If the blendShape exists, it verifies whether the node is of type ‘blendShape’.
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.
If shArgs providedIf shArgs not providedIf object is not a stringIf object is a stringIf not a componentIf a componentStart/ Check shArgs/ Update Obj/ Check Object Type/ Return False/ Check Component/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isComponent function:
The function starts by checking for shArgs and updates the object if provided.
It then checks if the object is a string type.
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.
If shArgs providedIf shArgs not providedIf obj has shapeIf obj has no shapeIf obj is CurveIf obj is not CurveStart/ Check shArgs/ Update Obj/ Get Shape/ Check if Curve/ Return False/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isCurv function:
The function begins by checking for shArgs and updates the object if provided.
It then retrieves the shape of the object.
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.
If shArgs providedIf shArgs not providedIf deformer does not existIf deformer existsIf not a geometry filterIf a geometry filterStart/ Check shArgs/ Update Deformer/ Check if Deformer Exists/ Return False/ Check Deformer Type/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isDeformer function:
The function starts by checking for shArgs and updates the deformer if provided.
It then checks if the deformer exists in the scene.
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.
If shArgs providedIf shArgs not providedIf object does not existIf object existsIf not transformIf transformIf follicleIf not follicleStart/ Check shArgs/ Update Obj/ Check if Exists/ Return False/ Check if Transform/ Check if Follicle/ Get Shape/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isFollicle function:
The function starts by checking for shArgs and updates the object if provided.
It checks if the object exists in the scene.
If the object is a transform, it retrieves the shape of the object.
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.
If shArgs providedIf shArgs not providedIf any object not freezedIf all objects freezedStart/ Check shArgs/ Update Parameters/ Check Each Object/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isFreezed function:
The function begins by checking for shArgs and updates the parameters if provided.
It then assesses each object in the list to determine if the specified attributes are freezed.
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.
If shArgs ExistIf shArgs Does Not ExistIf Object Does Not ExistIf Object ExistsIf Object Type is TransformIf Shape ExistsIf Shape Does Not ExistIf Object Type is Hair SystemIf Object Type is Not Hair SystemReturn FalseReturn TrueStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Check Object Exists/ Return False/ Check Object Type/ Check Shape Exists/ Check Hair System/ Return True/ End- 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.
If shArgs ExistIf shArgs Does Not ExistIf Object is Not VisibleIf Object is VisibleReturn TrueReturn FalseStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Check Visibility/ Return True/ Return False/ End- 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.
If shArgs providedIf shArgs not providedIf date is out of rangeIf date is in rangeStart/ Check shArgs/ Update Parameters/ Get Current Date/ Check Date Range/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isInTime function:
The function starts by checking for shArgs and updates the parameters if provided.
It then retrieves the current date.
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.
If shArgs providedIf shArgs not providedIf not a jointIf a jointStart/ Check shArgs/ Update Obj/ Check Node Type/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isJnt function:
The function checks for shArgs and updates the object if provided.
It then determines the node type of the object.
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.
If shArgs providedIf shArgs not providedIf not a jointIf jointIf last jointIf not last jointStart/ Check shArgs/ Update Parameters/ Check Joint Type/ Error/ Check Last Joint/ Return False/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isLastJnt function:
The function starts by checking for shArgs and updates parameters if provided.
It then checks if the specified object is a joint.
The function determines if the joint is the last in its chain and returns True or False.
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.
If shArgs providedIf shArgs not providedIf not a jointIf it's a jointIf joint not in setIf joint in setIf end jointIf not end jointStart/ Check shArgs/ Update Parameters/ Validate Joint/ Return False/ Check Joint In Set/ Return False/ Check if End Joint/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isLastSkinJnt function:
The function checks for shArgs and updates the parameters if provided.
It validates if the specified joint is actually a joint.
The function checks if the joint is in the set of skin joints.
If in the set, it assesses whether the joint is the end joint in the skin joint chain.
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.
If attribute existsIf attribute does not existIf type is 'double3'If other typesIf sub-attributes existCheck each sub-attribute lock statusIf any sub-attribute is lockedIf no sub-attribute is lockedIf attribute is lockedIf attribute is not lockedStart/ Check if Attribute Exists/ Split Object and Attribute/ Return False/ Check Attribute Type/ Check Sub-Attributes/ Check Lock Status/ Loop Through Sub-Attributes/ Is Sub-Attribute Locked?/ Return True/ Return False/ Return False- Flow Chart Description:
This flowchart illustrates the isLockedAttr function:
The function starts by checking if the attribute exists.
If it exists, it splits the object and attribute and checks the attribute type.
For ‘double3’ type, it loops through sub-attributes to check if any are locked.
For other types, it directly checks the lock status of the attribute.
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.
If shArgs providedIf shArgs not providedIf obj has shapeIf obj has no shapeIf obj is MeshIf obj is not MeshStart/ Check shArgs/ Update obj/ Get Shape/ Check if Mesh/ Return False/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isMesh function:
The function checks for shArgs and updates the object if provided.
It then retrieves the shape of the object.
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'.
If shArgs providedIf shArgs not providedIf type is 'curv'If type is 'jnt' or 'joint'Other typesIf object is CurveIf object is not CurveIf object is JointIf object is not JointStart/ Check shArgs/ Update Parameters/ Check Node Type/ Check if Curve/ Check if Joint/ Return False/ Return True/ Return False/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isNodeType function:
The function starts by checking for shArgs and updates parameters if provided.
It then checks the specified node type (e.g., ‘curv’, ‘jnt’).
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.")
If shArgs is providedIf shArgs is not providedIf obj is a numberIf obj is not a numberStart/ Check shArgs/ Update obj/ Is Number?/ Return True/ Return FalseEnd- Flow Chart Description:
This flowchart illustrates the isNum function:
The function checks if shArgs are provided and updates obj accordingly.
It then determines if the object is a number (integer, float, or long).
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
If object does not existIf object existsIf object type is 'transform'If object type is not 'transform'If not a NURBS surfaceIf it's a NURBS surfaceStart/ Check Object Exists/ Return False/ Check Object Type/ Get Shape/ Check if NURBS Surface/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isNurbsSurface function:
The function begins by checking if the specified object exists.
If the object exists, it checks whether the object is a transform, and if so, retrieves its shape.
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.
If shArgs providedIf shArgs not providedIf not list or tupleIf list or tupleIf not 3 elementsIf 3 elementsIf valid positionsStart/ Check shArgs/ Update PosList/ Check List Type/ Return False/ Check List Size/ Return False/ Check ElementsReturn- 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:
The function checks for shArgs and updates the position list if provided.
It then validates the type of the position list (list or tuple).
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.
If shArgs providedIf shArgs not providedIf not a valid referenceIf valid referenceStart/ Check shArgs/ Update refNode/ Check Valid Reference/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isReference function:
The function starts by checking for shArgs and updates the reference node if provided.
It then checks if the node is a valid reference node in the scene.
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.
If shArgs providedIf shArgs not providedIf not valid reference nodeIf valid reference nodeIf reference loadedIf reference not loadedStart/ Check shArgs/ Update refNode/ Validate Reference Node/ Error/ Check Load State/ Return False/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isReferenceLoaded function:
The function checks for shArgs and updates the reference node if provided.
It validates if the provided node is a valid reference node.
The function then checks the load state of the reference and returns True if loaded, otherwise False.
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.
If shArgs providedIf shArgs not providedIf not a valid referenceIf valid referenceStart/ Check shArgs/ Update refNode/ Check Valid Reference/ Return False/ Return True- Flow Chart Description:
This flowchart illustrates the isReference function:
The function starts by checking for shArgs and updates the reference node if provided.
It then checks if the node is a valid reference node in the scene.
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.
If shArgs providedIf shArgs not providedIf not a valid jointIf valid jointIf no skinClusterIf skinCluster existsIf joint influences skinClusterIf joint does not influence skinClusterStart/ Check shArgs/ Update Parameters/ Validate Joint/ Return False/ Check SkinCluster/ Return False/ Check Joint Influence/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isSkinJnt function:
The function checks for shArgs and updates parameters if provided.
It validates if the provided joint is valid.
The function checks if there is a skinCluster associated with the mesh.
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'.
If shArgs providedIf shArgs not providedIf not a jointIf it's a jointIf SkinCluster existsIf no SkinClusterIf joint influences skinIf joint does not influence skinStart/ Check shArgs/ Update Parameters/ Validate Joint/ Return False/ Check SkinCluster/ Check Joint Influence/ Return True/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isSkinJnt function:
The function starts by checking for shArgs and updates the parameters if provided.
It then validates if the specified joint is actually a joint.
The function checks if there is a skinCluster associated with the mesh.
If a skinCluster exists, it checks if the joint is influencing the skinCluster.
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.
If shArgs providedIf shArgs not providedIf obj is MeshIf obj is not MeshIf SkinCluster existsIf no SkinClusterStart/ Check shArgs/ Update obj/ Check if Mesh/ Check SkinCluster/ Return False/ Return True/ Return False- Flow Chart Description:
This flowchart illustrates the isSkinned function:
The function begins by checking for shArgs and updates the object if provided.
It checks if the object is a mesh.
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.
If shArgs ExistIf shArgs Does Not ExistIf Object Does Not ExistIf Object ExistsIf Object is Not a Transform NodeIf Object is a Transform NodeReturn FalseReturn TrueStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Check Object Exists/ Return False/ Check Transform Type/ Return True/ End- 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.
If shArgs ExistIf shArgs Does Not ExistIf Object Does Not ExistIf Object ExistsIf Node Type Does Not MatchIf Node Type MatchesReturn FalseReturn TrueStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Check Object Exists/ Return False/ Check Node Type/ Return True/ End- 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.
If shArgs ExistIf shArgs Does Not ExistIf Object is Not VisibleIf Object is VisibleIf checkParents is TrueFor Each Parent ObjectIf Parent Object is Not VisibleIf Parent Object is VisibleIf All Parents are VisibleIf Not All Parents are VisibleReturn FalseReturn TrueStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Check Visibility/ Return False/ Check Parents Visibility/ Get Parent List/ Check Parent Visibility/ Check All Parents Visibility/ Return True/ End- 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.
If shArgs ExistIf shArgs Does Not ExistIf objList is Not a ListIf objList is Already a ListMap objList to ListCheck If All Objects ExistStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Convert To List/ Map To List/ Check Object Existence/ End- 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.
If shArgs ExistIf shArgs Does Not ExistIf runCompute is TrueSet Global Start TimeDisplay Information MessageStart/ Check shArgs/ Parse shArgs/ Initialize Parameters/ Start Timer/ Set Global Start Time/ Display Info/ End- 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.