HyperSkin

Contents

HyperSkin#

HyperSkin.__aboutHyperSkin(self)#
HyperSkin.__confirmAction(self, action)#
try:

deleteUI (‘as_HyperSkinWin’)

except:

pass

HyperSkin.__init__(self, filePath=None)#

“ Hyper Speed Skinning” based on “Art & Technology” Combination

as_HyperSkinMain_v3.0

About :#

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

Contact :#

Mail Id: subbu.add@gmail.com

HyperSkin._check4Author(self)#
HyperSkin._compileAHSS(self, userFolder='$_Free_AHSS_v3.5')#
HyperSkin._createVtxSet_Solved(self)#

[shArgs : none]

Purpose:

:: The function _createVtxSet_Solved in Autodesk Maya is designed to create a vertex set for a selected joint, particularly useful in rigging and character animation. This function helps in defining and isolating specific vertex influences for a joint, allowing for more controlled and precise skinning operations.

  • Streamlines the process of managing vertex influences on joints in character rigging.

  • Provides a method to quickly generate and manipulate vertex sets associated with specific joints.

Note:

  • Ideal for use in complex rigging setups where managing individual vertex influences is necessary.

  • Requires the selection of a joint for which the vertex set will be created.

Usage Example:

>>> _createVtxSet_Solved()
# This will create a vertex set for the currently selected joint, aiding in focused skin weight adjustments.
Flow Chart Description:

The _createVtxSet_Solved function performs the following steps:

  1. Verifies if the selected object is a joint.

  2. Generates a unique name for the vertex set based on the joint’s name.

  3. Deletes any existing vertex set with the same name to avoid duplicates.

  4. Creates a locator at the joint’s position for reference.

  5. Hides the locator to avoid clutter in the viewport.

  6. Creates a new vertex set with the vertices influenced by the selected joint.

  7. Switches the selection mode back to object mode.

graph TD Start[("fa:fa-play Start")] --> VerifyJoint{Verify Selected Joint} VerifyJoint -- Not a Joint --> Error1[Error: Not a Joint] Error1 --> End[("fas:fa-stop End")] VerifyJoint -- Is a Joint --> GenerateVtxSetName{Generate Vertex Set Name} GenerateVtxSetName --> DeleteExistingSet{Delete Existing Set with Same Name} DeleteExistingSet --> CreateLocator{Create Locator at Joint Position} CreateLocator --> HideLocator{Hide Locator} HideLocator --> CreateVertexSet{Create Vertex Set} CreateVertexSet --> SwitchSelectMode{Switch to Object Selection Mode} SwitchSelectMode --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style VerifyJoint fill:#99ccff,stroke:#000,stroke-width:2px style Error1 fill:#ff6666,stroke:#000,stroke-width:2px style GenerateVtxSetName fill:#99ccff,stroke:#000,stroke-width:2px style DeleteExistingSet fill:#99ccff,stroke:#000,stroke-width:2px style CreateLocator fill:#99ccff,stroke:#000,stroke-width:2px style HideLocator fill:#99ccff,stroke:#000,stroke-width:2px style CreateVertexSet fill:#99ccff,stroke:#000,stroke-width:2px style SwitchSelectMode fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin._isInTime(self, startDate=[2017, 1, 1], endDate=[2018, 1, 1], onlineTime=1, showDaysLeft=1, bufferTime=1)#
HyperSkin._isNum(self, obj)#
HyperSkin._isPosList(self, posList)#

if posList == [1, 3, 10.5] | [0.1, 10, 9.5] | [0, 0, 0] | (0, 10, 5): return True else: return False

HyperSkin._mayaVer(self)#
HyperSkin._selectEndVertices_4Solving(self)#

[shArgs : none]

Purpose:

:: The function _selectEndVertices_4Solving in Autodesk Maya is designed to assist in character rigging by selecting the nearest vertex on a skin mesh relative to a specified joint. This is particularly useful for refining skin weights and joint influences in character animation.

  • Facilitates precise rigging adjustments by targeting specific mesh vertices in close proximity to joints.

  • Enhances the rigging process, especially in areas where accurate joint-to-mesh alignment is critical.

Note:

  • This function is integral to rigging workflows that require fine-tuning of skin deformations around joints.

  • It requires the selection of a joint and the associated skin mesh to function correctly.

Usage Example:

>>> _selectEndVertices_4Solving()
# This will select the nearest vertex on the skin mesh to the currently selected joint.
Flow Chart Description:

The _selectEndVertices_4Solving function performs the following steps:

  1. Verifies the presence of a selected joint and a skin mesh.

  2. Identifies the nearest vertex on the skin mesh to the selected joint.

  3. Changes the selection mode to vertex selection.

  4. Selects the identified nearest vertex on the skin mesh.

graph TD Start[("fa:fa-play Start")] --> VerifySelection{Verify Joint and Skin Mesh} VerifySelection -- Not Found --> PromptAction1[Prompt: No Joint/Mesh Selected] PromptAction1 --> End[("fas:fa-stop End")] VerifySelection -- Found --> IdentifyNearestVtx{Identify Nearest Vertex} IdentifyNearestVtx --> ChangeSelectionMode{Change to Vertex Selection Mode} ChangeSelectionMode --> SelectVertex{Select Nearest Vertex} SelectVertex --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style VerifySelection fill:#99ccff,stroke:#000,stroke-width:2px style PromptAction1 fill:#99ccff,stroke:#000,stroke-width:2px style IdentifyNearestVtx fill:#99ccff,stroke:#000,stroke-width:2px style ChangeSelectionMode fill:#99ccff,stroke:#000,stroke-width:2px style SelectVertex fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin._selectNearestFaces(self)#

[shArgs : none]

Purpose:

:: Facilitates the selection of nearest faces on a skin mesh in Autodesk Maya, relative to a selected Geometric Control Mesh (GCM).

  • Aids in skin weight editing by focusing on relevant mesh areas near the GCM.

  • Streamlines the rigging and skinning workflow in Maya.

Note:

  • The function is designed to enhance the user’s control over skin weight adjustments, particularly in complex character rigs.

  • It requires the selection of a GCM before execution and works by isolating relevant mesh areas for easier manipulation.

Usage Example:

>>> _selectNearestFaces()
# After selecting a GCM, this function will focus on the nearest faces on the skin mesh for editing.
Flow Chart Description:

The _selectNearestFaces function performs the following steps:

  1. The function starts by verifying if a GCM is selected.

  2. It retrieves the associated skin mesh and skin cluster.

  3. Sets the skin mesh template attribute to 0 (visible).

  4. Retrieves the model panel for viewport manipulation.

  5. Adjusts the model editor settings to focus on polymeshes and joints.

  6. Iterates through the joint list of the skin cluster, setting their template attribute.

  7. Verifies the selected GCM suffix for correctness.

  8. Toggles the visibility of GCMs and Discs (DSC) for clarity.

  9. Selects the skin mesh and switches to face selection mode.

  10. Sets the selection tool to the lasso tool for manual face selection.

  11. The function concludes its operation.

graph TD Start[("fa:fa-play Start")] --> VerifySelection{Verify GCM Selection} VerifySelection -- No Selection --> PromptAction1[Prompt: No GCM Selected] PromptAction1 --> End[("fas:fa-stop End")] VerifySelection -- Selection --> RetrieveSkinMesh{Retrieve Skin Mesh and Cluster} RetrieveSkinMesh --> SetMeshTemplate{Set Skin Mesh Template} SetMeshTemplate --> GetModelPanel{Get Model Panel} GetModelPanel --> AdjustModelEditor{Adjust Model Editor Settings} AdjustModelEditor --> IterateJoints{Iterate Through Joints} IterateJoints --> VerifyGCM{Verify GCM Suffix} VerifyGCM -- Incorrect --> PromptAction2[Prompt: Select GCM Only] PromptAction2 --> End VerifyGCM -- Correct --> ToggleVisibility{Toggle GCM/DSC Visibility} ToggleVisibility --> SelectSkinMesh{Select Skin Mesh} SelectSkinMesh --> SetSelectionTool{Set Selection Tool (Lasso)} SetSelectionTool --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style VerifySelection fill:#99ccff,stroke:#000,stroke-width:2px style PromptAction1 fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveSkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style SetMeshTemplate fill:#99ccff,stroke:#000,stroke-width:2px style GetModelPanel fill:#99ccff,stroke:#000,stroke-width:2px style AdjustModelEditor fill:#99ccff,stroke:#000,stroke-width:2px style IterateJoints fill:#99ccff,stroke:#000,stroke-width:2px style VerifyGCM fill:#99ccff,stroke:#000,stroke-width:2px style PromptAction2 fill:#99ccff,stroke:#000,stroke-width:2px style ToggleVisibility fill:#99ccff,stroke:#000,stroke-width:2px style SelectSkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style SetSelectionTool fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin._snap2NearestFaces(self)#

[shArgs : none]

Purpose:

:: The function _snap2NearestFaces in Autodesk Maya is designed to align a selected Geometric Control Mesh (GCM) to the nearest faces of a skin mesh for precise deformation control.

  • Enhances rigging accuracy by allowing finer adjustments to the GCM position relative to the skin mesh.

  • Streamlines the process of skin weight painting and rig adjustments.

Note:

  • This function is particularly useful in complex character rigging scenarios where precise control over skin deformations is required.

  • It requires a GCM to be selected and operates by duplicating and reducing the skin mesh for optimal GCM alignment.

Usage Example:

>>> _snap2NearestFaces()
# This will align the selected GCM to the closest faces of the skin mesh based on the chosen snap type.
Flow Chart Description:

The _snap2NearestFaces function performs the following steps:

  1. Verifies the existence of a skin mesh and skin cluster.

  2. Retrieves and stores the original attributes of the skin mesh, skin cluster, and associated joints.

  3. Duplicates the skin mesh and reduces the mesh based on the selected snap type.

  4. Prompts the user to select the most suitable duplicate mesh for the GCM.

  5. Deletes the original GCM and renames the selected duplicate mesh to the original GCM name.

  6. Rebinds the skin mesh with the original joints and applies the appropriate shader.

  7. Resets the display attributes of the joints affected in the selection process.

  8. Concludes by selecting the updated GCM and setting the tool mode back to object selection.

graph TD Start[("fa:fa-play Start")] --> VerifySkinMesh{Verify Skin Mesh and Cluster} VerifySkinMesh -- Not Found --> PromptAction1[Prompt: No Skin Mesh/Cluster] PromptAction1 --> End[("fas:fa-stop End")] VerifySkinMesh -- Found --> StoreOriginals{Store Original Attributes} StoreOriginals --> DuplicateMesh{Duplicate Skin Mesh} DuplicateMesh --> ReduceMesh{Reduce Duplicated Meshes} ReduceMesh --> UserSelection{User Selects Suitable Mesh} UserSelection -- No Selection --> PromptAction2[Prompt: Action Cancelled] PromptAction2 --> End UserSelection -- Selection --> DeleteOriginalGCM{Delete Original GCM} DeleteOriginalGCM --> RenameSelectedMesh{Rename Selected Mesh} RenameSelectedMesh --> RebindSkin{Rebind Skin Mesh} RebindSkin --> ApplyShader{Apply GCM Shader} ApplyShader --> ResetJoints{Reset Joint Display Attributes} ResetJoints --> FinalSelection{Select Updated GCM} FinalSelection --> SetToolMode{Set Tool Mode to Object Selection} SetToolMode --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style VerifySkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style PromptAction1 fill:#99ccff,stroke:#000,stroke-width:2px style StoreOriginals fill:#99ccff,stroke:#000,stroke-width:2px style DuplicateMesh fill:#99ccff,stroke:#000,stroke-width:2px style ReduceMesh fill:#99ccff,stroke:#000,stroke-width:2px style UserSelection fill:#99ccff,stroke:#000,stroke-width:2px style PromptAction2 fill:#99ccff,stroke:#000,stroke-width:2px style DeleteOriginalGCM fill:#99ccff,stroke:#000,stroke-width:2px style RenameSelectedMesh fill:#99ccff,stroke:#000,stroke-width:2px style RebindSkin fill:#99ccff,stroke:#000,stroke-width:2px style ApplyShader fill:#99ccff,stroke:#000,stroke-width:2px style ResetJoints fill:#99ccff,stroke:#000,stroke-width:2px style FinalSelection fill:#99ccff,stroke:#000,stroke-width:2px style SetToolMode fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.addInfluences_skinClust(self, infList=None, skinMesh=None, useGeoInf=True, useProgress=1)#

[shArgs : none]

Purpose:

:: Adds influences (joints or geometry) to an existing skinCluster on a specified skinMesh in Autodesk Maya.

  • Enhances rigging flexibility by allowing the addition of new influences to a skinned mesh.

  • Supports adding both joint and non-joint influences to the skin cluster.

  • Useful for updating rigs with new deformers without the need to re-skin the entire mesh.

Usage Example:

>>> addInfluences_skinClust(infList=['joint1', 'joint2'], skinMesh='characterMesh', useGeoInf=True)
# Adds 'joint1' and 'joint2' as influences to the skinCluster of 'characterMesh'.
Parameters:

  • infList: List of influence objects (joints or geometry) to be added to the skinCluster.

  • skinMesh: The mesh to which the influences are added. If not specified, it uses the last object in the infList.

  • useGeoInf: Boolean indicating whether to use geometry as influence (True/False).

Return:

  • None. This function does not return values but modifies the skinCluster of the specified mesh.

Note:

  • Ensure the skinMesh is already bound to a skinCluster before using this function.

  • The function automatically sets ‘useComponents’ to True for geometry influences.

graph TB Start[("fa:fa-play Start")] --> ValidateInputs{"/fas:fa-check-circle Validate Inputs"} ValidateInputs --"Inputs Valid"--> AddInfluences["/fas:fa-plus Add Influences to SkinCluster"] ValidateInputs --"Invalid Inputs"--> End[("fas:fa-stop End")] AddInfluences --> UpdateLockWeights{"/fas:fa-lock Update Lock Weights"} UpdateLockWeights --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ValidateInputs fill:#ffcc00,stroke:#000,stroke-width:2px style AddInfluences fill:#99ccff,stroke:#000,stroke-width:2px style UpdateLockWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the addInfluences_skinClust function:

  1. The process starts and validates the inputs - infList and skinMesh.

  2. If the inputs are valid, it proceeds to add the specified influences to the skinCluster.

  3. After adding the influences, it updates the lock weights attributes for the new influences.

  4. The process completes once the influences are added and the weights updated.

Purpose:#

Adds given infList to given skinMesh

Args:#

infList =infList to be added to skinMesh skinMesh = infList[-1], if skinMesh not given useGeoInf = True | False (for ‘useGeometry’ arg)

Args (from selection):#

If both Args are not given:

infList =hsN._selected()[0:-1] skinMesh =hsN._selected()[-1]

HyperSkin.add_CharPrefix(self, txtFldName)#

[shArgs : none]

Purpose:

:: Extracts and applies a character prefix from selected objects in Autodesk Maya to a specified text field.

  • Useful for automatically retrieving and applying naming conventions based on selected objects.

  • Enhances efficiency in rigging and scene organization by maintaining consistent naming across multiple objects.

Usage Example:

>>> add_CharPrefix('textFieldName')
# Extracts the character prefix from selected objects and applies it to the specified text field.

Note: - This function is particularly useful in rigging workflows where consistent naming conventions are crucial. - It extracts the prefix from the first object in the selection and applies it to the text field provided in the argument.

Parameters:

  • txtFldName: (<str>) The name of the text field where the extracted prefix will be applied.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"fas:fa-mouse-pointer Check Selection"} CheckSelection -- "Objects Selected" --> ExtractPrefix["/fas:fa-cut Extract Prefix"] ExtractPrefix --> ApplyToTextField["/fas:fa-text-height Apply to Text Field"] CheckSelection -- "No Selection" --> ClearTextField["/fas:fa-eraser Clear Text Field"] ApplyToTextField --> End[("fas:fa-stop End")] ClearTextField --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractPrefix fill:#99ccff,stroke:#000,stroke-width:2px style ApplyToTextField fill:#99ff99,stroke:#000,stroke-width:2px style ClearTextField fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the add_CharPrefix function:

  1. The process starts, and the selection is checked.

  2. If objects are selected, the function extracts the character prefix from the first selected object.

  3. The extracted prefix is then applied to the specified text field.

  4. If no objects are selected, the text field is cleared of any existing text.

  5. The process ends.

HyperSkin.add_NoDiscAttrs(self)#

[shArgs : none]

Purpose:

:: Adds a set of custom attributes to the selected joints, which are typically part of a skinning setup in Autodesk Maya.

  • Enhances rigging flexibility by providing additional control attributes on joints.

  • Includes attributes for base and tail blending, volume preservation, and other rigging functionalities.

  • Facilitates advanced skinning techniques, allowing for more nuanced deformation and control.

Parameters:

none – This function does not require direct arguments but operates on the selected joints or joints associated with a specified skinned mesh.

Returns:

None #This function does not return any value but modifies the selected joints.

Usage Example:

>>> add_NoDiscAttrs()
# Applies custom attributes to the selected joints or joints of the specified skinned mesh.
Note:

  • Ensure that either joints are selected or a skinned mesh is specified in the corresponding text field.

  • The function adds a series of attributes that are useful in advanced rigging setups, such as for blend shapes or volume preservation.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-check-circle Check Selection"} CheckSelection --"Joints Selected"--> AddAttributes["/fas:fa-plus-circle Add Custom Attributes"] CheckSelection --"Skinned Mesh Selected"--> RetrieveJoints["/fas:fa-project-diagram Retrieve Joints from Skinned Mesh"] RetrieveJoints --> AddAttributes AddAttributes --> DisplayMessage["/fas:fa-comment-alt Display Completion Message"] DisplayMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style AddAttributes fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveJoints fill:#99ff99,stroke:#000,stroke-width:2px style DisplayMessage fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The add_NoDiscAttrs function operates in the following manner:

  1. Starts by checking if joints are directly selected or if a skinned mesh is specified.

  2. If joints are selected, proceeds to add custom attributes to these joints.

  3. If a skinned mesh is selected, retrieves the associated joints and then adds custom attributes to them.

  4. After adding the attributes, displays a completion message.

  5. The process ends successfully after adding the attributes and notifying the user.

HyperSkin.add_Selection(self, textFld, multiSelect=False)#

[shArgs : tf=textFld, ms=multiSelect]

Purpose:

:: Adds the selected object’s name as input in any window for a “<==” button.

Argument | Description:

:param textFld: (<type str>) # The text field where the object name will be added.
:param multiSelect: (<type bool, optional>) # If set to True, allows multiple objects to be selected.

:return: None

Code Examples:

>>> text_field_name = "textField1"  # Example text field name
>>> add_Selection(textFld=text_field_name, multiSelect=True)
# Adds the names of selected objects (comma-separated) to the specified text field.

>>> add_Selection(textFld="textField2", multiSelect=False)
# Adds the name of the selected object to the specified text field.

This function allows you to add the selected object’s name as input to any window with a “<==” button.

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 --> CheckMultiSelect{"/fas:fa-check-square Check MultiSelect"} CheckMultiSelect --"If MultiSelect is True"--> GetSelectedObjects{"/fas:fa-list Get Selected Objects"} GetSelectedObjects --"If Multiple Objects are Selected"--> JoinSelectedObjects["/fas:fa-compress Join Selected Objects"] JoinSelectedObjects --"Join Selected Object Names"--> SetTextFieldValue["/fas:fa-edit Set Text Field Value"] CheckMultiSelect --"If MultiSelect is False"--> GetSingleSelectedObject{"/fas:fa-dot-circle Get Single Selected Object"} GetSingleSelectedObject --"If a Single Object is Selected"--> SetTextFieldValue["/fas:fa-edit Set Text Field Value"] SetTextFieldValue --"Set Text Field Value"--> 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 CheckMultiSelect fill:#cc99ff,stroke:#000,stroke-width:2px style GetSelectedObjects fill:#ccffcc,stroke:#000,stroke-width:2px style JoinSelectedObjects fill:#ffcc99,stroke:#000,stroke-width:2px style GetSingleSelectedObject fill:#ffcc99,stroke:#000,stroke-width:2px style SetTextFieldValue fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the add_Selection function:

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

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

  • Checks if multiSelect is True or False.

  • If multiSelect is True, it gets the names of multiple selected objects, joins them into a comma-separated string, and sets the text field’s value.

  • If multiSelect is False, it gets the name of a single selected object and sets the text field’s value accordingly.

HyperSkin.add_SidePrefix(self, rePattern, txtFldName)#

[shArgs : none]

Purpose:

:: Extracts and applies a side prefix from selected objects in Autodesk Maya to a specified text field based on a regular expression pattern.

  • Assists in identifying and applying side-specific prefixes (like ‘L_’, ‘R_’, etc.) to maintain consistent naming conventions.

  • Streamlines the process of rigging and organizing scene objects based on their side specification.

Usage Example:

>>> add_SidePrefix('regularExpressionPattern', 'textFieldName')
# Searches for a side prefix in the selected object's name using the provided pattern and applies it to the specified text field.

Note: - The function uses a regular expression pattern to identify the side prefix in the selected object’s name. - It’s particularly helpful in complex rigging scenarios where objects are side-specific and need to be identified or grouped accordingly.

Parameters:

  • rePattern: (<str>) Regular expression pattern used to identify the side prefix in the object’s name.

  • txtFldName: (<str>) The name of the text field where the extracted side prefix will be applied.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"fas:fa-mouse-pointer Check Selection"} CheckSelection -- "Objects Selected" --> ExtractSidePrefix["/fas:fa-cut Extract Side Prefix using RegEx"] ExtractSidePrefix --> ApplyToTextField["/fas:fa-text-height Apply to Text Field"] CheckSelection -- "No Selection" --> ClearTextField["/fas:fa-eraser Clear Text Field"] ApplyToTextField --> End[("fas:fa-stop End")] ClearTextField --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractSidePrefix fill:#99ccff,stroke:#000,stroke-width:2px style ApplyToTextField fill:#99ff99,stroke:#000,stroke-width:2px style ClearTextField fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the add_SidePrefix function:

  1. The process starts, and the selection is checked.

  2. If objects are selected, the function uses a regular expression pattern to extract the side prefix from the first selected object.

  3. The extracted side prefix is then applied to the specified text field.

  4. If no objects are selected, the text field is cleared of any existing text.

  5. The process ends.

HyperSkin.add_SkinMesh(self, textFld)#

[shArgs : none]

Purpose:

:: Facilitates the addition of a skin mesh to a text field in Autodesk Maya, handling side prefixes for better rigging organization.

  • Streamlines the process of assigning skin meshes to rigging elements in Maya.

  • Automatically detects and applies side prefixes (like ‘L_’, ‘R_’) to left and right joints for better rigging organization.

Usage Example:

>>> add_SkinMesh('textFieldName')
# Adds the selected skin mesh to the specified text field and handles side prefixes for joints.

Note: - The function examines the selected mesh or joints to determine and apply side prefixes. - It’s particularly useful in complex rigging scenarios where proper naming and organization of skin meshes and joints are crucial.

Parameters:

  • textFld: (<str>) The name of the text field where the skin mesh name will be applied.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"fas:fa-mouse-pointer Check Selection"} CheckSelection -- "Objects Selected" --> CheckMeshType["/fas:fa-question-circle Check Mesh Type"] CheckMeshType -- "Mesh is Skin Cluster" --> ExtractMeshName["/fas:fa-cut Extract Mesh Name"] ExtractMeshName --> ApplyToTextField["/fas:fa-text-height Apply to Text Field"] CheckMeshType -- "Not Skin Cluster" --> ShowWarning["/fas:fa-exclamation-triangle Show Warning"] CheckSelection -- "No Selection" --> ClearTextField["/fas:fa-eraser Clear Text Field"] ApplyToTextField --> End[("fas:fa-stop End")] ShowWarning --> End ClearTextField --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMeshType fill:#99ccff,stroke:#000,stroke-width:2px style ExtractMeshName fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyToTextField fill:#99ff99,stroke:#000,stroke-width:2px style ShowWarning fill:#ff9999,stroke:#000,stroke-width:2px style ClearTextField fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the add_SkinMesh function:

  1. The process starts, and the selection is checked.

  2. If objects are selected, it checks if the mesh is part of a skin cluster.

  3. If it is a skin cluster, it extracts the mesh name and applies it to the specified text field.

  4. If it’s not a skin cluster, a warning is shown to the user.

  5. If no objects are selected, the text field is cleared of any existing text.

  6. The process ends.

HyperSkin.applyObjColor(self, ctrlList=None, colorNum=None, LPrefix=None, RPrefix=None, CPrefix=None, **shortArgs)#

[shArgs : cl=ctrlList, cn=colorNum, lp=LPrefix, rp=RPrefix, cp=CPrefix]

Purpose:

:: Dynamically changes the color of controls or objects in Autodesk Maya based on their name prefix or a specified color value.

  • Allows for easy identification and organization of controls in complex rigs.

  • Supports color assignment based on left, right, center prefixes or a specific color value.

  • Enhances the visual clarity of the rig, facilitating a more efficient animation workflow.

Parameters:
  • ctrlList – (<list/str>) #List of controls or a single control to apply color to.

  • colorNum – (<int, optional>) #Specific color value to apply. Overrides prefix-based color assignment.

  • LPrefix – (<list, optional>) #Left side prefix and its corresponding color value (e.g., [‘L’, 6]).

  • RPrefix – (<list, optional>) #Right side prefix and its corresponding color value (e.g., [‘R’, 13]).

  • CPrefix – (<list, optional>) #Center prefix and its corresponding color value.

Usage Example:

>>> # Apply color based on object's name prefix
>>> applyObjColor(ctrlList=['L_arm_ctrl', 'R_leg_ctrl'])
# Left arm control turns blue, right leg control turns red.

>>> # Apply specific color to a list of controls
>>> applyObjColor(ctrlList=['ctrl1', 'ctrl2'], colorNum=17)
# Both controls turn yellow.

>>> # Apply color with custom prefixes
>>> applyObjColor(ctrlList=['left_hand_ctrl', 'right_foot_ctrl'], LPrefix=['left', 18], RPrefix=['right', 20])
# Left hand control turns light blue, right foot control turns light red.
Note:

  • If no specific color is provided, the function assigns colors based on the control’s name prefix.

  • Custom prefixes and their corresponding colors can be defined for more control over the color assignment.

graph TB Start[("fa:fa-play Start")] --> CheckColorNum{"/fas:fa-question-circle Check Color Number"} CheckColorNum --"Color Number Provided"--> AssignSpecificColor["/fas:fa-palette Assign Specific Color"] CheckColorNum --"No Color Number"--> CheckPrefixes{"/fas:fa-question-circle Check Prefixes"} CheckPrefixes --> DetermineColorByPrefix{"/fas:fa-shapes Determine Color By Prefix"} DetermineColorByPrefix --> AssignColorByPrefix["/fas:fa-tint Assign Color By Prefix"] AssignSpecificColor --> SetColorAttributes["/fas:fa-sliders-h Set Color Attributes"] AssignColorByPrefix --> SetColorAttributes SetColorAttributes --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckColorNum fill:#ffcc00,stroke:#000,stroke-width:2px style AssignSpecificColor fill:#99ccff,stroke:#000,stroke-width:2px style CheckPrefixes fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineColorByPrefix fill:#99ccff,stroke:#000,stroke-width:2px style AssignColorByPrefix fill:#cc99ff,stroke:#000,stroke-width:2px style SetColorAttributes fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the applyObjColor function:

  1. The process begins by checking if a specific color number is provided.

  2. If a color number is provided, it assigns that specific color to the selected controls.

  3. If no color number is provided, it checks for name prefixes (L, R, C) to determine the color.

  4. Colors are assigned based on the detected prefixes.

  5. The color attributes are set on the controls, and the process completes.

HyperSkin.as_AboutHyperSkin(self)#
HyperSkin.as_BakeDeformers(self)#

[shArgs : none]

Purpose:

:: Executes the as_BakeDeformers function to bake deformers to a skin cluster in Autodesk Maya, a part of the ‘as_HyperRig’ tool.

  • This function is specifically designed to work with the ‘as_HyperRig’ module, ensuring integration with advanced rigging setups.

  • It’s used for transferring deformations from various deformers to a skin cluster, streamlining the rigging process.

  • Suitable for complex rigs where multiple deformers are used to achieve desired deformations.

Returns:

None #This function does not return any value but performs a baking operation on deformers.

Usage Example:

>>> as_BakeDeformers()
# Bakes the deformers to the skin cluster as part of the 'as_HyperRig' tool.
Note:

  • This function is part of the ‘as_HyperRig’ module and requires the module to be purchased and installed.

  • The function is a wrapper to call HyperRig.as_BakeDeformers_ToSkinClust(), ensuring proper integration with the ‘as_HyperRig’ system.

graph TB Start[("fa:fa-play Start")] --> CheckHyperRigModule{"/fas:fa-puzzle-piece Check 'as_HyperRig' Module"} CheckHyperRigModule --"Module Found"--> BakeDeformers["/fas:fa-fire Bake Deformers to Skin Cluster"] CheckHyperRigModule --"Module Not Found"--> DisplayError["/fas:fa-exclamation-triangle Display Error Message"] BakeDeformers --> End[("fas:fa-stop End")] DisplayError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckHyperRigModule fill:#ffcc00,stroke:#000,stroke-width:2px style BakeDeformers fill:#99ccff,stroke:#000,stroke-width:2px style DisplayError fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_BakeDeformers function operates in the following manner:

  1. Starts by checking if the ‘as_HyperRig’ module is available and properly integrated.

  2. If the module is found, it proceeds to bake the deformers to the skin cluster using HyperRig.as_BakeDeformers_ToSkinClust().

  3. If the ‘as_HyperRig’ module is not found, displays an error message indicating the necessity to purchase and install the module.

  4. The process ends after successfully baking the deformers or displaying the error message.

HyperSkin.as_CreateGCMs(self)#

[shArgs : none]

Purpose:

:: Creates Geometry Control Meshes (GCMs) for character rigging in Autodesk Maya using the ‘as_CreateGCMs’ function from the HyperSkin tool.

  • This function is vital for generating control meshes on a character’s skin, facilitating precise deformation control in rigging.

  • It efficiently manages the creation of GCMs based on joint positions and skin mesh proximity, ensuring optimal rig control.

  • The process includes generating, positioning, and parenting control meshes to corresponding joints.

Returns:

None #This function does not return a value but executes the GCM creation process.

Usage Example:

>>> as_CreateGCMs()
# Initiates the creation of Geometry Control Meshes for the selected skin mesh and its associated joints.
Note:

  • The function requires the character’s skin mesh and the related joints to be selected or specified.

  • It is a part of the HyperSkin tool, designed to streamline rigging processes in Maya.

  • The function manages various parameters such as blend values, prefixes, and joint hierarchies to create effective GCMs.

graph TB Start[("fa:fa-play Start")] --> CheckHyperSkinModule{"/fas:fa-puzzle-piece Check 'as_HyperSkin' Module"} CheckHyperSkinModule --"Module Found"--> GenerateGCMs["/fas:fa-cogs Generate Geometry Control Meshes (GCMs)"] CheckHyperSkinModule --"Module Not Found"--> DisplayError["/fas:fa-exclamation-triangle Display Error Message"] GenerateGCMs --> End[("fas:fa-stop End")] DisplayError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckHyperSkinModule fill:#ffcc00,stroke:#000,stroke-width:2px style GenerateGCMs fill:#99ccff,stroke:#000,stroke-width:2px style DisplayError fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_CreateGCMs function operates in the following manner:

  1. It starts by checking if the ‘as_HyperSkin’ module is available and integrated.

  2. If the module is found, it proceeds to create Geometry Control Meshes (GCMs) based on the selected skin mesh and joints.

  3. The function manages joint hierarchy, naming conventions, and mesh proximity to generate precise control meshes for rigging.

  4. If the ‘as_HyperSkin’ module is not found, an error message is displayed.

  5. The process concludes after the successful generation of GCMs or upon displaying the error message.

HyperSkin.as_DeleteGCMs(self)#

[shArgs : none]

Purpose:

:: The ‘as_DeleteGCMs’ function in Autodesk Maya serves to remove all Geometric Control Meshes (GCMs) associated with a specific skin mesh. This is particularly useful in rigging and animation workflows where it’s necessary to clear or redo the rigging setup.

  • The function prompts for confirmation before proceeding with the deletion, ensuring that the removal of GCMs is intentional and preventing accidental loss of rig data.

  • It’s a convenient way to clean up the rigging scene by removing unnecessary or outdated GCMs, streamlining the rig for further modifications or updates.

Parameters:
  • skinMesh – <str> #Name of the skin mesh whose associated GCMs are to be deleted.

  • skinClust – <str> #Skin cluster associated with the skin mesh, used to identify related GCMs.

Returns:

None #This function performs a deletion operation and does not return a value.

Usage Example:

>>> as_DeleteGCMs()
# This command will prompt for confirmation and then delete all GCMs related to the currently selected skin mesh.
Note:

  • It’s important to use this function with caution as it permanently removes GCMs from the scene.

  • The function is helpful in scenarios where the rig needs to be cleaned up or prepared for a different rigging approach.

  • It enhances the flexibility and maintenance of the rigging process, allowing for easy removal of control meshes when they are no longer needed or require replacement.

graph TD Start[("fa:fa-play Start")] --> ConfirmAction{Confirm Deletion} ConfirmAction --"Confirmed"--> DeleteGCMs[Delete All GCMs] DeleteGCMs --> End[("fas:fa-stop End")] ConfirmAction --"Cancelled"--> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style DeleteGCMs fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_DeleteGCMs function follows this sequence:

  1. The process starts and immediately prompts the user to confirm the deletion of all GCMs related to the specified skin mesh.

  2. If the user confirms the action, the function proceeds to delete all GCMs that are part of the specified skin mesh group.

  3. The process concludes once all GCMs are deleted, or if the user cancels the action, the process ends without making any changes.

HyperSkin.as_DoReSkin(self)#

[shArgs : none]

Purpose:

:: The function as_DoReSkin in Autodesk Maya is used for reapplying skinning to a mesh with a fresh skin cluster while preserving the original skin cluster’s name. This function is especially useful in rigging workflows where the skinning needs to be reset without losing the naming conventions and setup of the original skin cluster.

  • Facilitates the process of redoing the skinning on a mesh without altering the original skin cluster’s naming and connections.

  • Ensures a clean and fresh skinning setup while maintaining the existing rigging structure.

Note:

  • Particularly useful in complex rigging scenarios where maintaining naming conventions and connections is crucial.

  • Requires an initial skinning setup on the mesh for the function to work.

Usage Example:

>>> as_DoReSkin()
# This will reapply skinning to the selected mesh, preserving the name of the original skin cluster.
Flow Chart Description:

The as_DoReSkin function follows these steps:

  1. Validates if the selected mesh has an existing skin cluster.

  2. Detaches the skin from the mesh, removing the existing skin cluster.

  3. Rebinds the skin to the mesh with a new skin cluster.

  4. Renames the new skin cluster to match the original one.

  5. Reorders deformers, if needed, to maintain the rigging setup.

  6. Selects the joints affected by the skinning for review.

graph TD Start[("fa:fa-play Start")] --> CheckSkinCluster{Check Existing Skin Cluster} CheckSkinCluster -- Exists --> DetachSkin[Detach Skin] DetachSkin --> RebindSkin[Rebind Skin] RebindSkin --> RenameSkinCluster{Rename New Skin Cluster} RenameSkinCluster --> ReorderDeformers[Reorder Deformers] CheckSkinCluster -- Not Found --> Error[Error: Initial Skinning Required] Error --> End[("fas:fa-stop End")] ReorderDeformers --> SelectJoints[Select Affected Joints] SelectJoints --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style DetachSkin fill:#99ccff,stroke:#000,stroke-width:2px style RebindSkin fill:#99ccff,stroke:#000,stroke-width:2px style RenameSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style ReorderDeformers fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:2px style SelectJoints fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.as_EasySmooth(self, vtx=None)#

[shArgs : none]

Purpose:

:: Smooths skin weights for a specific vertex or a selection of vertices in Autodesk Maya.

  • Provides a convenient method for refining skin deformations by smoothing weights at specific points.

  • Can be used for targeted skin weight adjustments, enhancing the animator’s control over deformation quality.

  • Ideal for troubleshooting and fine-tuning skinning issues in complex character rigs.

Parameters:

vtx – The vertex or list of vertices to smooth. If not provided, the function operates on the current selection.

Usage Example:

>>> # Select a single vertex or multiple vertices
>>> as_EasySmooth()
# Smooths the skin weights of the selected vertices.

>>> # To smooth a specific vertex programmatically
>>> as_EasySmooth('pSphere1.vtx[10]')
# Smooths the skin weight of vertex number 10 on pSphere1.
Note:

  • If no vertex is specified, the function assumes the current selection in Maya.

  • It is crucial to have vertices selected on a skinned mesh before executing this function.

graph TB Start[("fa:fa-play Start")] --> CheckArgument{"/fas:fa-question-circle Check Vertex Argument"} CheckArgument --"Vertex Provided"--> SelectVertex["/fas:fa-mouse-pointer Select Vertex"] SelectVertex --> SmoothSkinWeights["/fas:fa-magic Smooth Skin Weights"] CheckArgument --"No Vertex Provided"--> CheckSelection{"/fas:fa-question-circle Check Vertex Selection"} CheckSelection --"Vertices Selected"--> SmoothSelectedWeights["/fas:fa-magic Smooth Selected Weights"] CheckSelection --"No Vertices Selected"--> Error["/fas:fa-exclamation-triangle Display Error"] SmoothSkinWeights --> GrowSelection["/fas:fa-expand-arrows-alt Grow Selection"] GrowSelection --> SmoothAdjacentWeights["/fas:fa-magic Smooth Adjacent Weights"] SmoothAdjacentWeights --> End[("fas:fa-stop End")] SmoothSelectedWeights --> End Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgument fill:#ffcc00,stroke:#000,stroke-width:2px style SelectVertex fill:#99ccff,stroke:#000,stroke-width:2px style SmoothSkinWeights fill:#99ccff,stroke:#000,stroke-width:2px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style SmoothSelectedWeights fill:#99ccff,stroke:#000,stroke-width:2px style GrowSelection fill:#99ccff,stroke:#000,stroke-width:2px style SmoothAdjacentWeights fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart explains the as_EasySmooth function:

  1. The process begins by checking if a specific vertex is provided as an argument.

  2. If a vertex is provided, it selects that vertex and smooths its skin weights.

  3. If no vertex is provided, it checks if vertices are currently selected.

  4. If vertices are selected, it smooths the skin weights of these selected vertices.

  5. If no vertices are selected, an error is displayed.

  6. After smoothing the selected weights, the process ends.

HyperSkin.as_Generate_HyperSkin(self)#

[shArgs : none]

Purpose:

:: Executes the HyperSkin generation process on a selected mesh in Autodesk Maya, with options for disc-based or non-disc-based skinning.

  • This function serves as a gateway to two distinct skinning processes: HyperSkin with discs and HyperSkin without discs.

  • It prompts the user to confirm before proceeding with the HyperSkin generation process.

  • Depending on the user’s choice (disc-based or non-disc-based), it redirects to the appropriate HyperSkin generation method.

Parameters:

  • None. The function determines the skinning method based on user input in the Maya interface.

Return:

  • None. This function primarily acts as a decision-making node and does not return any specific values.

Note:

  • The user must make sure the appropriate mesh and settings are selected or defined in Maya before initiating this function.

  • Depending on the user’s choice in the Maya UI (checked or unchecked ‘No Disc HyperSkin’ checkbox), the function will either generate HyperSkin with or without discs.

  • The function includes a safety prompt to confirm the user’s intention to proceed with the HyperSkin generation process.

graph LR Start[("fa:fa-play Start")] --> ConfirmAction{"/fas:fa-question-circle Confirm Action"} ConfirmAction --"If Cancelled"--> CancelledAction["/fas:fa-times-circle Action Cancelled"] ConfirmAction --"If Confirmed"--> CheckNoDiscOption{"/fas:fa-check-circle Check 'No Disc' Option"} CheckNoDiscOption --"If No Disc HyperSkin"--> GenerateNoDisc["/fas:fa-circle Generate HyperSkin Without Disc"] CheckNoDiscOption --"If Disc HyperSkin"--> GenerateDisc["/fas:fa-circle-o Generate HyperSkin With Disc"] CancelledAction --> End[("fas:fa-stop End")] GenerateNoDisc --> End GenerateDisc --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style CancelledAction fill:#ff6666,stroke:#000,stroke-width:3px style CheckNoDiscOption fill:#99ccff,stroke:#000,stroke-width:2px style GenerateNoDisc fill:#99ff99,stroke:#000,stroke-width:2px style GenerateDisc fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the as_Generate_HyperSkin function illustrates:

  1. The process starts with the execution of the function.

  2. The user is prompted to confirm the action of generating HyperSkin.

  3. If the action is cancelled, the process ends.

  4. If confirmed, the function checks whether the ‘No Disc HyperSkin’ checkbox is selected in the Maya UI.

  5. Depending on the checkbox state, it either generates HyperSkin without discs or with discs.

  6. The process concludes after executing the chosen HyperSkin generation method.

HyperSkin.as_Generate_HyperSkin_Disc(self)#

[shArgs : -]

Purpose:

:: Generates Hyper Skin for Autodesk Maya, encompassing complex operations such as joint orientation, skin weighting, and hyper smoothing.

  • This function handles multiple tasks like disabling garbage collection, managing undo chunks, processing vertices, and generating skin discs.

  • It involves a series of Maya commands and calculations to achieve precise skin weighting and manipulation.

Argument | Description:

  • (no explicit arguments in the function definition)

:return: #The function does not explicitly return a value but performs numerous operations on Maya objects.

HyperSkin.as_Generate_HyperSkin_NoDisc(self)#

[shArgs : none]

Purpose:

:: Generates HyperSkin without using discs for a selected mesh in Autodesk Maya. It involves a comprehensive process of analyzing skin weights, solving joints, and adjusting skinning based on various criteria.

  • The function is a detailed and extensive implementation of skin weight calculation and adjustment without relying on disc-based HyperSkinning.

  • It includes multiple steps like analyzing joints, setting full weights, solving HyperDiscs, and painting solved and non-solved skinned vertices.

  • The function also handles cases where vertices are selected or not and executes different operations based on various conditions.

Parameters:

  • None. The function utilizes various settings and selections from the Maya UI, like side prefixes, lattice divisions, and skin cluster information.

Return:

  • None. The function performs a series of operations on the selected mesh or vertices and adjusts skin weights accordingly.

Note:

  • Due to the complexity of the function, it’s crucial for users to understand the HyperSkinning process and have the correct setup in Autodesk Maya.

  • The function is not for sale and is restricted for use in certain cases (__notForSale flag).

  • The skinning process includes multiple levels of computation and adjustments, and it may take a significant amount of time to complete depending on the complexity of the mesh and joint setup.

graph LR Start[("fa:fa-play Start")] --> CheckNoDisc{"/fas:fa-circle-o Check No Disc Option"} CheckNoDisc --"Restricted"--> RestrictedZone["/fas:fa-ban Restricted Access"] CheckNoDisc --"Proceed"--> AnalyzeJoints{"/fas:fa-sitemap Analyze Joints"} AnalyzeJoints --> PaintSolvedVtx["/fas:fa-paint-brush Paint Solved Skinned Vertices"] AnalyzeJoints --> PaintNonSolvedVtx["/fas:fa-paint-brush Paint Non Solved Skinned Vertices"] PaintSolvedVtx --> HyperSmooth["/fas:fa-magic-wand Hyper Smooth"] PaintNonSolvedVtx --> HyperSmooth HyperSmooth --> End[("fas:fa-stop End")] RestrictedZone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNoDisc fill:#ffcc00,stroke:#000,stroke-width:2px style AnalyzeJoints fill:#99ccff,stroke:#000,stroke-width:2px style PaintSolvedVtx fill:#99ff99,stroke:#000,stroke-width:2px style PaintNonSolvedVtx fill:#99ff99,stroke:#000,stroke-width:2px style HyperSmooth fill:#f9d5e5,stroke:#000,stroke-width:2px style RestrictedZone fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the as_Generate_HyperSkin_NoDisc function illustrates:

  1. The process starts with checking if the No Disc HyperSkin option is selected.

  2. If restricted, the process ends without proceeding further.

  3. Otherwise, it moves to analyze joints for skin weighting.

  4. The process then paints solved and non-solved skinned vertices based on the analysis.

  5. It concludes with a HyperSmooth operation to refine the skin weights.

  6. The entire process is complex and handles multiple conditions and scenarios for precise skin weight adjustments.

HyperSkin.as_Generate_HyperSmooth(self, smoothAll=False, vtxList=None, jntList=None, pruneWgts=True, skinSide=None, **shortArgs)#

[shArgs : sa=smoothAll, vl=vtxList, jl=jntList, pw=pruneWgts]

Purpose:

:: Applies HyperSmooth skinning to a specified mesh in Autodesk Maya, enhancing the quality and precision of the skinning process.

  • This method significantly improves the skinning results by smoothing weights across the specified mesh or selected vertices.

  • It offers flexibility by allowing the user to specify whether to smooth all joints or selected joints and vertices.

  • The function also includes options for pruning weights and defining skinning sides for more targeted skinning.

Parameters:

  • smoothAll (<bool, optional>): If True, smooths weights for all joints. If False, focuses on the specified joints or vertices.

  • vtxList (<list, optional>): List of vertices to be included in the HyperSmooth process. If None, the function decides based on other parameters.

  • jntList (<list, optional>): List of joints to target for HyperSmooth. If None, the function uses all joints associated with the skinMesh.

  • pruneWgts (<bool, optional>): If True, prunes the skin weights after smoothing to optimize performance and accuracy.

Return:

  • None. The function modifies the skin weights on the specified mesh or vertices to achieve a smoother skinning result.

Note:

  • The function requires the mesh name to be specified in the Maya UI under ‘as_SkinMesh_TF’.

  • Ensure that the mesh is properly skinned with a skinCluster before using this function for optimal results.

  • The smoothing rounds, specified in the Maya UI, determine the intensity of the HyperSmooth process.

graph TB Start[("fa:fa-play Start")] --> PrepareMesh["/fas:fa-object-group Prepare Mesh"] PrepareMesh --> CheckParameters{"/fas:fa-sliders-h Check Parameters"} CheckParameters --"If smoothAll"--> SmoothAllJoints["/fas:fa-sync-alt Smooth All Joints"] CheckParameters --"If not smoothAll"--> SmoothSelected["/fas:fa-mouse-pointer Smooth Selected Joints/Vtx"] SmoothAllJoints --> End[("fas:fa-stop End")] SmoothSelected --> PruneWeights{"/fas:fa-cut Prune Weights"} PruneWeights --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style PrepareMesh fill:#99ccff,stroke:#000,stroke-width:2px style CheckParameters fill:#ffcc00,stroke:#000,stroke-width:2px style SmoothAllJoints fill:#99ff99,stroke:#000,stroke-width:2px style SmoothSelected fill:#99ff99,stroke:#000,stroke-width:2px style PruneWeights fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for as_Generate_HyperSmooth function:

  1. The process starts with the preparation of the mesh for HyperSmooth skinning.

  2. It checks the parameters to determine the smoothing approach (all joints or selected joints/vertices).

  3. If smoothAll is True, it applies smoothing to all joints. Otherwise, it focuses on the specified joints or vertices.

  4. Optionally, it prunes the skin weights for optimization.

  5. The process concludes once the skin weights are smoothed and optionally pruned.

HyperSkin.as_Generate_HyperSmoothMulti(self)#

[shArgs : none]

Purpose:

:: Generates HyperSmooth skinning on multiple selected meshes in Autodesk Maya using the HyperSmooth tool.

  • This function is designed to automate the process of applying HyperSmooth skinning to a series of selected mesh objects.

  • It streamlines the skinning workflow, especially when working with multiple mesh objects that require similar skinning techniques.

  • Each mesh in the selection is processed sequentially, ensuring consistent application of HyperSmooth skinning across all selected meshes.

Parameters:

  • None. This function operates on the currently selected mesh objects in the Maya scene.

Return:

  • None. The function’s primary task is to apply HyperSmooth skinning to selected meshes, and it does not return any values.

Note:

  • Ensure that the mesh objects intended for HyperSmooth skinning are selected in the Maya scene before executing this function.

  • The function relies on the as_Generate_HyperSmooth method, which should be correctly implemented and functional for successful execution.

  • Suitable for scenarios where multiple mesh objects require similar skinning processes, saving time and effort in rigging workflows.

graph LR Start[("fa:fa-play Start")] --> SelectMeshes["/fas:fa-mouse-pointer Select Meshes"] SelectMeshes --> ApplyHyperSmooth{"/fas:fa-sync-alt Apply HyperSmooth"} ApplyHyperSmooth --"For Each Mesh"--> IterateMeshes["/fas:fa-repeat Iterate Through Meshes"] IterateMeshes --> HyperSmoothMesh["/fas:fa-magic HyperSmooth Each Mesh"] HyperSmoothMesh --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMeshes fill:#99ccff,stroke:#000,stroke-width:2px style ApplyHyperSmooth fill:#ffcc00,stroke:#000,stroke-width:2px style IterateMeshes fill:#cc99ff,stroke:#000,stroke-width:2px style HyperSmoothMesh fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the as_Generate_HyperSmoothMulti function illustrates:

  1. The process starts with the execution of the function.

  2. Multiple mesh objects are selected in the Maya scene.

  3. The function iterates through each selected mesh.

  4. The HyperSmooth skinning process is applied to each mesh individually.

  5. The process concludes once all selected meshes have been processed.

HyperSkin.as_Generate_LipsSkin(self, jntList=None, vtxList=None, bodyMesh=None)#

[shArgs : none]

Purpose:

:: Generates skinning for lip joints on a specified mesh in Autodesk Maya.

  • This function automates the process of skinning lip joints to a specified mesh, ensuring seamless deformation during animation.

  • Ideal for facial rigging, specifically targeting the lip area for detailed and precise skinning.

Usage Example:

>>> as_Generate_LipsSkin(jntList, vtxList, bodyMesh)
# Applies skinning to the lip joints on the specified mesh.
Parameters:

  • jntList: List of joints to be skinned specifically for the lips area.

  • vtxList: List of vertex indices to be influenced by the lip joints. If not provided, it will be taken from a user input field.

  • bodyMesh: The mesh object to which the lip joints will be skinned. If not provided, it will be selected from the Maya scene.

Return:

  • None. The function performs skinning on the specified lip joints and mesh.

Note:

  • Ensure that the mesh is already skinned before using this function.

  • The function is specifically designed for facial rigging in character animation.

graph TB Start[("fa:fa-play Start")] --> CheckMesh{"/fas:fa-cube Check Mesh"} CheckMesh --"Mesh Selected"--> SkinJoints[("/fas:fa-bone Skin Lip Joints")] CheckMesh --"No Mesh Selected"--> ErrorMesh["/fas:fa-times-circle Error: No Mesh Selected"] SkinJoints --> End[("fas:fa-stop End")] ErrorMesh --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMesh fill:#ffcc00,stroke:#000,stroke-width:2px style SkinJoints fill:#99ccff,stroke:#000,stroke-width:2px style ErrorMesh fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_Generate_LipsSkin function:

  1. The process begins by checking if a mesh is selected or specified.

  2. If a mesh is selected, it proceeds to skin the lip joints to the mesh.

  3. If no mesh is selected, it shows an error message.

  4. The process completes after successfully skinning the lip joints or showing an error.

HyperSkin.as_GetJntList_OutsideBB(self, skinMesh)#

[shArgs : none]

Purpose:

:: Identifies the list of joints located outside the bounding box of a specified skin mesh in Autodesk Maya.

  • This function is particularly useful in rigging and skinning processes, where it’s crucial to identify joints that may influence the mesh from outside its bounding box.

  • It can assist in optimizing the skinning process by identifying joints that might need special attention or exclusion from the skinning influences.

  • The function uses Maya’s lattice feature to determine the spatial relationship between joints and the skin mesh’s bounding box.

Parameters:

  • param skinMesh:

    (<str>) #The name of the skin mesh for which the joint list outside the bounding box is to be determined.

Return:

  • None. This function is marked as ‘Work In Progress’ (WIP) and may not provide an explicit return value. It’s intended for development and testing purposes.

Note:

  • Ensure that the skin mesh exists in the scene and is correctly named before executing this function.

  • The function is currently under development, and its behavior or output might not be fully implemented or reliable.

  • It demonstrates a method in development for optimizing skinning and rigging workflows in Maya.

graph LR Start[("fa:fa-play Start")] --> SelectMesh["/fas:fa-mouse-pointer Select Skin Mesh"] SelectMesh --> CreateLattice["/fas:fa-cubes Create Lattice"] CreateLattice --> IdentifyJoints["/fas:fa-users Identify Joints Outside BB"] IdentifyJoints --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMesh fill:#99ccff,stroke:#000,stroke-width:2px style CreateLattice fill:#99ccff,stroke:#000,stroke-width:2px style IdentifyJoints fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the as_GetJntList_OutsideBB function illustrates:

  1. The process starts with the execution of the function.

  2. The specified skin mesh is selected.

  3. A lattice is created around the skin mesh to determine its bounding box.

  4. The function identifies joints that are located outside the bounding box of the skin mesh.

  5. The process concludes, ideally returning a list of these joints (currently under development).

HyperSkin.as_HyperSkin(self)#

[shArgs : None]

Purpose:

:: The as_HyperSkin function serves as the main entry point for the HyperSkin tool in Maya Python. It handles UI initialization, configuration, and interaction with various HyperSkin functionalities.

  • Line 1-6, Retrieves the selected skin mesh and displays about information.

  • Line 8-17, Deletes existing UI if present and attempts to load the HyperSkin UI from various potential directories.

  • Line 19-21, Shows the main window and configures the checkBox callbacks for ExtractGCMs options.

  • Line 23-24, Refreshes the view and updates the UI options.

  • Line 26-31, Sets up pop-up menus for various actions like transferring skinning, smoothing edge loops, and selecting vertices.

  • Line 33-34, Configures pop-up menu for selecting skin joints.

  • Line 36-37, Sets up a menu for HyperSmooth functionality.

  • Line 39-46, Handles skin mesh selection and updates the UI accordingly.

Argument | Description :—- | :—- None | This function does not take any arguments.

:return: None #This function does not return any value but initiates and manages the HyperSkin tool interface in Maya.

Code Examples:

>>> as_HyperSkin()
# Initializes and displays the HyperSkin tool interface for skinning operations in Maya.
graph TB Start[("fa:fa-play Start")] --> RetrieveSkinMesh[("fas:fa-object-group Retrieve Skin Mesh")] RetrieveSkinMesh --> DisplayAbout[("fas:fa-info-circle Display About Information")] DisplayAbout --> DeleteExistingUI[("fas:fa-trash-alt Delete Existing UI")] DeleteExistingUI --> LoadUI[("fas:fa-file-import Load UI")] LoadUI --> ShowWindow[("fas:fa-window-maximize Show Window")] ShowWindow --> ConfigureExtractGCMs[("fas:fa-toggle-on Configure Extract GCMs")] ConfigureExtractGCMs --> RefreshView[("fas:fa-sync-alt Refresh View")] RefreshView --> UpdateUIOptions[("fas:fa-tools Update UI Options")] UpdateUIOptions --> SetupPopUpMenus[("fas:fa-bars Setup Pop-Up Menus")] SetupPopUpMenus --> HandleSkinMeshSelection[("fas:fa-mouse-pointer Handle Skin Mesh Selection")] HandleSkinMeshSelection --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart demonstrates the as_HyperSkin function:

  1. Starts by retrieving the selected skin mesh and displaying HyperSkin information.

  2. Deletes any existing HyperSkin UI that might be open.

  3. Attempts to load the HyperSkin UI from various directories.

  4. Shows the HyperSkin main window.

  5. Configures options for ExtractGCMs checkbox.

  6. Refreshes the HyperSkin view.

  7. Updates the UI options based on the current state.

  8. Sets up various pop-up menus for skinning-related actions.

  9. Handles skin mesh selection and updates the UI to reflect the current selection.

HyperSkin.as_ImportSkinDeformer(self)#

[shArgs : None]

Purpose:

:: Imports skin weights to selected mesh or meshes using a custom deformer tool, often used in 3D character rigging to transfer skinning data between meshes.

Parameters:
  • meshList – (<list of hsNode>) #List of mesh objects selected for importing skin weights. If no meshes are selected, the function does not proceed.

  • missingList – (<list of hsNode>) #List of meshes for which skin weight import failed. Initialized as an empty list.

Returns:

None #This function does not return a value but applies skin weight data to the selected meshes.

Usage Example:

>>> as_ImportSkinDeformer()
# This will attempt to import skin weights to all selected mesh objects.
Flow Chart Description:

The as_ImportSkinDeformer function performs the following operations:

  1. Checks for selected mesh objects to import skin weights to.

  2. Iterates through each selected mesh, attempts to import skin weights using a custom deformer tool.

  3. Tracks meshes where import was unsuccessful and reports them in missingList.

  4. Displays information about the import process and completion.

graph TB Start[("fa:fa-play Start")] --> CheckMeshes["/fas:fa-check-circle Check Meshes"] CheckMeshes --"If meshes are selected" --> ImportWeights["/fas:fa-upload Import Weights"] CheckMeshes --"If no meshes are selected" --> End[("fas:fa-stop End")] ImportWeights --> TrackFailures["/fas:fa-exclamation-triangle Track Failures"] TrackFailures --> DisplayInfo["/fas:fa-info-circle Display Information"] DisplayInfo --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshes fill:#99ccff,stroke:#000,stroke-width:2px style ImportWeights fill:#99ccff,stroke:#000,stroke-width:2px style TrackFailures fill:#ffcc00,stroke:#000,stroke-width:2px style DisplayInfo fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.as_LockJoints(self, jntList=None, skinMesh=None, lockAll=0, unlockAll=0, invLock=1)#

[shArgs : jl=jntList, sm=skinMesh, la=lockAll, ua=unlockAll, il=invLock]

Purpose:

:: Manages the lock state of joints in skinning setups within Autodesk Maya, providing flexibility in painting skin weights.

  • Enhances the control over skinning by selectively locking or unlocking joints based on user needs.

  • Facilitates the process of focusing on specific joints during weight painting, avoiding unintended modifications to others.

Parameters:
  • jntList – <list> #List of joints to be locked or unlocked. If not specified, operates on the currently selected joints.

  • skinMesh – <str> #The skinned mesh whose joints are being manipulated. Automatically determined if not provided.

  • lockAll – <int> #If set to 1, locks all joints in the skin cluster. Overrides ‘jntList’.

  • unlockAll – <int> #If set to 1, unlocks all joints in the skin cluster. Overrides ‘jntList’.

  • invLock – <int> #If set to 1, inverts the lock state of joints in ‘jntList’. Joints not in the list will have the opposite lock state.

Note:

  • Streamlines the skinning process by allowing for targeted control over joint influence.

  • Useful in complex rigs where managing the influence of numerous joints can be challenging.

Usage Example:

>>> as_LockJoints(jntList=['joint1', 'joint2'], skinMesh='characterMesh', lockAll=0, unlockAll=0, invLock=1)
# This command locks all joints except 'joint1' and 'joint2' for the specified skin mesh.
graph TD Start[("fa:fa-play Start")] --> CheckLockAll{Check Lock All} CheckLockAll -- Yes --> LockAllJoints[Lock All Joints] LockAllJoints --> End[("fas:fa-stop End")] CheckLockAll -- No --> CheckUnlockAll{Check Unlock All} CheckUnlockAll -- Yes --> UnlockAllJoints[Unlock All Joints] UnlockAllJoints --> End CheckUnlockAll -- No --> CheckInvLock{Check Invert Lock} CheckInvLock -- Yes --> InvertLock[Invert Lock State of Selected Joints] InvertLock --> End CheckInvLock -- No --> LockUnlockSelected[Lock or Unlock Selected Joints] LockUnlockSelected --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckLockAll fill:#99ccff,stroke:#000,stroke-width:2px style LockAllJoints fill:#99ccff,stroke:#000,stroke-width:2px style CheckUnlockAll fill:#99ccff,stroke:#000,stroke-width:2px style UnlockAllJoints fill:#99ccff,stroke:#000,stroke-width:2px style CheckInvLock fill:#99ccff,stroke:#000,stroke-width:2px style InvertLock fill:#99ccff,stroke:#000,stroke-width:2px style LockUnlockSelected fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_LockJoints function performs the following steps:

  1. The function starts and checks if ‘lockAll’ is enabled.

  2. If ‘lockAll’ is enabled, all joints are locked and the process ends.

  3. If ‘lockAll’ is not enabled, the function checks if ‘unlockAll’ is enabled.

  4. If ‘unlockAll’ is enabled, all joints are unlocked and the process ends.

  5. If ‘unlockAll’ is not enabled, the function checks if ‘invLock’ is enabled.

  6. If ‘invLock’ is enabled, the lock state of the selected joints is inverted.

  7. If ‘invLock’ is not enabled, the function locks or unlocks the selected joints based on their current state.

  8. The function concludes its operation.

HyperSkin.as_MakeVisibleGCM(self, endSuffix, makeVis=True)#

[shArgs : es=endSuffix, mv=makeVis]

Purpose:

:: Toggles the visibility of Geometric Control Meshes (GCM) or Discs (DSC) associated with a skinned mesh in Autodesk Maya.

  • Facilitates the process of reviewing or editing skin weights by selectively displaying or hiding the control elements.

  • Enhances the rigging workflow by providing a quick way to focus on specific parts of the rig.

Parameters:
  • endSuffix – <str> #The suffix indicating the type of geometry to be affected, either ‘GCM’ for Geometric Control Meshes or ‘DSC’ for Discs.

  • makeVis – <bool> #A boolean value to determine the visibility state. True to make visible, False to hide.

Note:

  • Streamlines the rigging and skinning process by allowing for a clear view of the control meshes or discs when needed.

  • Especially useful in complex rigs where visibility management can greatly aid in the rigging process.

Usage Example:

>>> as_MakeVisibleGCM(endSuffix='GCM', makeVis=True)
# This command will make all Geometric Control Meshes (GCMs) visible for the specified skin mesh.
Flow Chart Description:

The as_MakeVisibleGCM function performs the following steps:

  1. The function starts and retrieves the specified skin mesh and related skin cluster.

  2. It checks if a skin cluster is applied to the skin mesh, prompting an action if not found.

  3. Retrieves the joint list associated with the skin cluster.

  4. Generates a list of GCMs or DSCs based on the provided suffix and associated joints.

  5. Iterates through the GCM or DSC list, setting the visibility based on the ‘makeVis’ parameter.

  6. The function concludes its operation.

graph TD Start[("fa:fa-play Start")] --> RetrieveSkinMesh{Retrieve Skin Mesh} RetrieveSkinMesh -- Success --> CheckSkinCluster{Check Skin Cluster} CheckSkinCluster -- Not Found --> PromptAction[Prompt Action] PromptAction --> End[("fas:fa-stop End")] CheckSkinCluster -- Found --> GenerateList{Generate GCM/DSC List} GenerateList --> IterateList{Iterate Through List} IterateList --> SetVisibility{Set Visibility} SetVisibility --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveSkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style PromptAction fill:#99ccff,stroke:#000,stroke-width:2px style GenerateList fill:#99ccff,stroke:#000,stroke-width:2px style IterateList fill:#99ccff,stroke:#000,stroke-width:2px style SetVisibility fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.as_MirrorGCMs(self)#

[shArgs : none]

Purpose:

:: Mirrors Geometry Control Meshes (GCMs) for character rigging in Autodesk Maya using the ‘as_MirrorGCMs’ function from the HyperSkin tool.

  • This function is essential for creating symmetrical control meshes on both sides of a character, streamlining the rigging process.

  • It executes mirroring operations for GCMs, ensuring that both sides of the character rig have equivalent control and deformation capabilities.

  • The function manages the mirroring of meshes based on naming conventions and joint hierarchies to achieve symmetry in the rig.

Returns:

None #This function does not return a value but executes the mirroring process of GCMs.

Usage Example:

>>> as_MirrorGCMs()
# Initiates the mirroring of Geometry Control Meshes for the selected skin mesh and its associated joints.
Note:

  • The function requires the skin mesh and the related joints, along with existing GCMs, to be selected or specified.

  • It is part of the HyperSkin tool, designed to enhance rigging workflows in Maya.

  • The function intelligently mirrors GCMs based on joint names and positions, maintaining rig consistency and symmetry.

graph TB Start[("fa:fa-play Start")] --> CheckHyperSkinModule{"/fas:fa-puzzle-piece Check 'as_HyperSkin' Module"} CheckHyperSkinModule --"Module Found"--> MirrorGCMs["/fas:fa-sync-alt Mirror Geometry Control Meshes (GCMs)"] CheckHyperSkinModule --"Module Not Found"--> DisplayError["/fas:fa-exclamation-triangle Display Error Message"] MirrorGCMs --> End[("fas:fa-stop End")] DisplayError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckHyperSkinModule fill:#ffcc00,stroke:#000,stroke-width:2px style MirrorGCMs fill:#99ccff,stroke:#000,stroke-width:2px style DisplayError fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_MirrorGCMs function operates in the following manner:

  1. It starts by verifying if the ‘as_HyperSkin’ module is present and integrated.

  2. If the module is found, the function proceeds to mirror the Geometry Control Meshes based on the existing setup.

  3. The mirroring process ensures that each control mesh on one side of the rig is accurately mirrored to the other side.

  4. If the ‘as_HyperSkin’ module is not found, an error message is displayed.

  5. The process concludes after the successful mirroring of GCMs or upon displaying the error message.

HyperSkin.as_MirrorSelectedGCMs(self)#

[shArgs : none]

Purpose:

:: The function ‘as_MirrorSelectedGCMs’ is utilized to mirror selected Geometry Control Meshes (GCMs) in Autodesk Maya as part of the HyperSkin tool.

  • This function allows users to selectively mirror GCMs, providing flexibility in rigging workflows.

  • It is particularly useful when working with asymmetrical models or when adjustments are needed on specific parts of a rig.

  • The mirroring process takes into account the naming conventions and joint hierarchies to ensure accurate and symmetrical results.

Returns:

None #This function does not return a value but performs the mirroring operation on selected GCMs.

Usage Example:

>>> as_MirrorSelectedGCMs()
# Executes the mirroring process for the currently selected Geometry Control Meshes.
Note:

  • The function requires the selection of GCMs that need to be mirrored.

  • It is part of the HyperSkin toolset, designed to enhance rigging processes in Maya.

  • The function adapts to the specific needs of the rig by allowing selective mirroring of GCMs.

graph TB Start[("fa:fa-play Start")] --> CheckSelectedGCMs{"/fas:fa-puzzle-piece Check Selected GCMs"} CheckSelectedGCMs --"GCMs Selected"--> MirrorSelectedGCMs["/fas:fa-sync-alt Mirror Selected GCMs"] CheckSelectedGCMs --"No GCMs Selected"--> DisplayError["/fas:fa-exclamation-triangle Display Error Message"] MirrorSelectedGCMs --> End[("fas:fa-stop End")] DisplayError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelectedGCMs fill:#ffcc00,stroke:#000,stroke-width:2px style MirrorSelectedGCMs fill:#99ccff,stroke:#000,stroke-width:2px style DisplayError fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_MirrorSelectedGCMs function operates as follows:

  1. It begins by checking if any Geometry Control Meshes are selected.

  2. If GCMs are selected, the function proceeds to mirror the selected meshes, ensuring symmetry and consistency in the rig.

  3. The mirroring process accounts for specific selections, allowing targeted adjustments on the rig.

  4. If no GCMs are selected, an error message is displayed.

  5. The process concludes after the successful mirroring of selected GCMs or upon displaying the error message.

HyperSkin.as_PruneOppJntWeights(self)#

[shArgs : None]

Purpose:

:: The as_PruneOppJntWeights function in Maya Python API is designed to prune opposite joint influences on skinned mesh vertices. It works by removing influences of right-hand joints on left-hand vertices and vice versa, ensuring cleaner weight distribution in character rigging.

  • Line 1, It first checks for authorization before proceeding.

  • Line 4-6, Initializations for progress time and version checks.

  • Line 9-33, Identifying the skin cluster and affected vertices for the given skin mesh.

  • Line 34-39, Removing influences of right-hand joints on left-hand vertices.

  • Line 40-51, Applying the pruning process to left-hand vertices.

  • Line 52-57, Removing influences of left-hand joints on right-hand vertices.

  • Line 58-69, Applying the pruning process to right-hand vertices.

Argument | Description :—- | :—- None | This function does not take any arguments.

:return: None #This function does not return any value but performs weight pruning on skinned Maya meshes.

Code Examples:

>>> as_PruneOppJntWeights()
# Executes the pruning of opposite joint weights on a selected skinned mesh.
graph TB Start[("fa:fa-play Start")] --> CheckAuthorization[("fas:fa-user-check Check Authorization")] CheckAuthorization --> InitializeSettings[("fas:fa-cog Initialize Settings")] InitializeSettings --> IdentifySkinCluster[("fas:fa-search Identify Skin Cluster")] IdentifySkinCluster --> PruneLHWeights[("fas:fa-scissors Prune LH Weights")] PruneLHWeights --> UpdateProgressLH[("fas:fa-spinner Update Progress LH")] UpdateProgressLH --> PruneRHWeights[("fas:fa-scissors Prune RH Weights")] PruneRHWeights --> UpdateProgressRH[("fas:fa-spinner Update Progress RH")] UpdateProgressRH --> ResetInfluences[("fas:fa-undo-alt Reset Influences")] ResetInfluences --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart explains the as_PruneOppJntWeights function:

  1. The function begins by checking for proper authorization.

  2. Initializes settings like progress time and version control.

  3. Identifies the skin cluster and affected vertices of the selected mesh.

  4. Prunes weights of right-hand joints from left-hand vertices.

  5. Updates progress for left-hand weight pruning.

  6. Prunes weights of left-hand joints from right-hand vertices.

  7. Updates progress for right-hand weight pruning.

  8. Resets influences to default settings post pruning.

HyperSkin.as_ReplaceGCMs(self, snapRot=True, discShape=None)#

[shArgs : none]

Purpose:

:: The ‘as_ReplaceGCMs’ function in Autodesk Maya is designed to replace selected Geometric Control Meshes (GCMs) with new ones based on specified parameters such as rotation snapping and disc shape.

  • This function is particularly useful when updating the control meshes of a character rig in Autodesk Maya, allowing for adjustments in mesh geometry to better suit animation or deformation requirements.

  • The function provides options to control the orientation and shape of the replaced GCMs, enhancing the customization and flexibility of the rigging process.

Parameters:
  • snapRot – <bool> #Determines whether the new GCMs should snap their rotation to match the corresponding joints.

  • discShape – <None/str> #Specifies the shape of the GCMs to be created. If None, the default shape is used.

Returns:

None #This function does not return a value but replaces the selected GCMs in the scene.

Usage Example:

>>> as_ReplaceGCMs(snapRot=True, discShape='Square')
# This command will replace the selected GCMs with square-shaped ones and snap their rotation to the corresponding joints.
Note:

  • The function intelligently handles the replacement of GCMs, ensuring that the new meshes are properly aligned and oriented with respect to their associated joints.

  • It allows for selective updating of GCMs, enabling users to focus on specific areas of the rig that require modifications.

  • The function also takes into account the preferences set in the HyperSkin tool, such as the use of joint axes and specific prefixes, to maintain consistency in the rigging setup.

graph TB Start[("fa:fa-play Start")] --> SelectGCMs{"Select GCMs to Replace"} SelectGCMs --"GCMs Selected"--> ReplaceGCMs[Replace Each Selected GCM] ReplaceGCMs --> SetAttributes["Set New Attributes and Constraints"] SetAttributes --> End[("fas:fa-stop End")] SelectGCMs --"No GCMs Selected"--> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectGCMs fill:#ffcc00,stroke:#000,stroke-width:2px style ReplaceGCMs fill:#99ccff,stroke:#000,stroke-width:2px style SetAttributes fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_ReplaceGCMs function operates as follows:

  1. The process begins by checking if any GCMs are selected for replacement.

  2. If GCMs are selected, the function replaces each selected GCM with a new one. The new GCMs are created based on the provided parameters such as snapRot and discShape.

  3. After replacing the GCMs, the function sets new attributes and constraints on them to ensure proper functionality and alignment with the corresponding joints.

  4. The process concludes once all selected GCMs are replaced and configured.

  5. If no GCMs are selected, the process ends without making any changes.

HyperSkin.as_ToggleInMesh(self, endSuffix)#

[shArgs : es=endSuffix, sm=skinMesh, sc=skinClust]

Purpose:

:: Toggles the visibility of either inner mesh discs (DSCs) or geometric control meshes (GCMs) associated with skin joints in Autodesk Maya. This function is particularly useful in character rigging workflows, enhancing the visualization and management of skinning aids.

  • Facilitates the process of inspecting and adjusting the influence of skin joints on the character mesh by controlling the visibility of DSCs or GCMs.

  • Improves rigging efficiency by allowing riggers to quickly show or hide these elements as needed during skinning and weight painting.

Parameters:
  • endSuffix – <str> #Specifies the type of inner mesh to toggle. Accepts ‘GCM’ for Geometric Control Meshes or ‘DSC’ for Discs.

  • skinMesh – <str> #Automatically obtained from the user interface, it’s the name of the skinned mesh associated with the DSCs or GCMs.

  • skinClust – <str> #Automatically obtained, it’s the name of the skin cluster associated with the skinned mesh.

Note:

  • A practical tool for character riggers and animators to streamline the skinning process.

  • Offers quick access to toggle the visibility of key skinning components, aiding in the fine-tuning of joint influences on the mesh.

Usage Example:

>>> as_ToggleInMesh('DSC')
# This command toggles the visibility of all disc meshes (DSCs) associated with the skin joints of the specified skinned mesh.
graph TD Start[("fa:fa-play Start")] --> InputSuffix[Input Suffix ('GCM' or 'DSC')] InputSuffix --> CheckSkinCluster{Check Skin Cluster} CheckSkinCluster -- Exists --> RetrieveDSCsOrGCMs{Retrieve DSCs or GCMs} RetrieveDSCsOrGCMs --> CheckVisibility{Check Visibility of First DSC/GCM} CheckVisibility -- Visible --> HideAll{Hide All DSCs/GCMs} HideAll --> End[("fas:fa-stop End")] CheckVisibility -- Not Visible --> ShowAll{Show All DSCs/GCMs} ShowAll --> End CheckSkinCluster -- Does Not Exist --> ShowError[Show Error Message] ShowError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style InputSuffix fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveDSCsOrGCMs fill:#99ccff,stroke:#000,stroke-width:2px style CheckVisibility fill:#99ccff,stroke:#000,stroke-width:2px style HideAll fill:#99ccff,stroke:#000,stroke-width:2px style ShowAll fill:#99ccff,stroke:#000,stroke-width:2px style ShowError fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_ToggleInMesh function performs the following steps:

  1. The function starts with the input of the suffix (‘GCM’ or ‘DSC’).

  2. It checks if the skin cluster is applied to the specified skin mesh.

  3. Upon confirmation, it retrieves all DSCs or GCMs associated with the skin joints.

  4. The function checks the visibility state of the first DSC or GCM in the list.

  5. If the first DSC/GCM is visible, all DSCs/GCMs are hidden.

  6. If the first DSC/GCM is not visible, all DSCs/GCMs are made visible.

  7. The function concludes its operation.

  8. If the skin cluster does not exist or there are no DSCs/GCMs found, an error message is displayed, and the process ends.

HyperSkin.as_ToggleSkinJnts(self)#

[shArgs : none]

Purpose:

:: The ‘as_ToggleSkinJnts’ function in Autodesk Maya serves to toggle the template display state of all skin joints associated with a specified skinned mesh. This function is commonly used in character rigging, especially during the skinning process.

  • Facilitates the visualization and evaluation of skin joints’ influence on the mesh by enabling or disabling their template view.

  • Enhances the rigging and skinning workflow by providing an easy way to focus on specific joints and their deformation effects on the mesh.

Parameters:

skinMesh – <str> #Name of the skinned mesh associated with the skin joints whose template display state is to be toggled.

Note:

  • An essential tool in character rigging and skinning for visualizing joint influence and deformation.

  • Improves the efficiency of riggers and animators by simplifying the process of checking joint positioning and weighting during skinning.

  • Aids in achieving more accurate and desired deformation of the character mesh.

Usage Example:

>>> as_ToggleSkinJnts('pCube1')
# This command toggles the template display state of all skin joints associated with the mesh named 'pCube1'.
graph TD Start[("fa:fa-play Start")] --> InputMesh[Input Skinned Mesh Name] InputMesh --> CheckExistence{Check Mesh Existence} CheckExistence -- Exists --> RetrieveJoints{Retrieve Skin Joints} RetrieveJoints --> LoopJoints{Loop Through Skin Joints} LoopJoints --> CheckState{Check Each Joint's State} CheckState --> ToggleState{Toggle Template State} ToggleState --> UpdateJoint[Update Joint Template Display] UpdateJoint --> End[("fas:fa-stop End")] CheckExistence -- Does Not Exist --> ShowError[Show Error Message] ShowError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style InputMesh fill:#ffcc00,stroke:#000,stroke-width:2px style CheckExistence fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveJoints fill:#99ccff,stroke:#000,stroke-width:2px style LoopJoints fill:#99ccff,stroke:#000,stroke-width:2px style CheckState fill:#99ccff,stroke:#000,stroke-width:2px style ToggleState fill:#99ccff,stroke:#000,stroke-width:2px style UpdateJoint fill:#99ccff,stroke:#000,stroke-width:2px style ShowError fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_ToggleSkinJnts function performs the following steps:

  1. The function begins by receiving the name of the skinned mesh.

  2. It checks if the specified mesh exists in the scene.

  3. Upon existence, the function retrieves all skin joints associated with the mesh.

  4. It loops through each skin joint.

  5. For each joint, the function checks its current template display state.

  6. The function then toggles the template state of each joint.

  7. Each joint is updated to reflect the new template display state.

  8. The function concludes its operation.

  9. If the mesh does not exist, an error message is displayed, and the process ends.

HyperSkin.as_ToggleSkinMesh(self)#

[shArgs : none]

Purpose:

:: The ‘as_ToggleSkinMesh’ function in Autodesk Maya is designed to toggle the template display state of a specified skinned mesh. This function is typically used in the skinning process of character rigging.

  • The function assists in visualizing the impact of skinning on the mesh by enabling or disabling the template view of the mesh.

  • Enhances workflow efficiency by providing quick access to toggle the visibility state, facilitating better focus on the skinning details.

Parameters:

skinMesh – <str> #Name of the skinned mesh whose template display state is to be toggled.

Note:

  • A utility function primarily used in the rigging and skinning stages of character animation pipelines.

  • Simplifies the process of checking the deformation and weighting of the mesh during skinning.

  • Supports the animator or rigger in achieving more precise control over mesh deformation.

Usage Example:

>>> as_ToggleSkinMesh('pCube1')
# This command toggles the template display state of the mesh named 'pCube1'.
graph TD Start[("fa:fa-play Start")] --> InputMesh[Input Skinned Mesh Name] InputMesh --> CheckExistence{Check Mesh Existence} CheckExistence -- Exists --> RetrieveState{Retrieve Current Template State} CheckExistence -- Does Not Exist --> ShowError[Show Error Message] RetrieveState --> ToggleState{Toggle Template State} ToggleState --> UpdateMesh[Update Mesh Template Display] UpdateMesh --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style InputMesh fill:#ffcc00,stroke:#000,stroke-width:2px style CheckExistence fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveState fill:#99ccff,stroke:#000,stroke-width:2px style ToggleState fill:#99ccff,stroke:#000,stroke-width:2px style UpdateMesh fill:#99ccff,stroke:#000,stroke-width:2px style ShowError fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_ToggleSkinMesh function follows this process:

  1. The function starts and receives the name of the skinned mesh.

  2. It checks if the specified mesh exists in the scene.

  3. If the mesh exists, the function retrieves its current template display state.

  4. The function then toggles the template state of the mesh.

  5. The mesh is updated to reflect the new template display state.

  6. The function concludes its operation.

  7. If the mesh does not exist, an error message is displayed and the process ends.

HyperSkin.as_UpdateGCMs(self)#

[shArgs : none]

Purpose:

:: The function ‘as_UpdateGCMs’ is designed to update Geometry Control Meshes (GCMs) in Autodesk Maya as part of the HyperSkin tool.

  • This function ensures that GCMs remain synchronized with any changes made to the related skin meshes or skeleton.

  • It is crucial for maintaining the integrity of the rigging process, particularly after modifications to the skeleton or skin geometry.

  • The update process involves reassessing and adjusting parent constraints to align the GCMs accurately with the current rig state.

Returns:

None #This function does not return a value but performs the update operation on GCMs.

Usage Example:

>>> as_UpdateGCMs()
# Updates the GCMs based on the current state of the associated skin meshes or skeleton.
Note:

  • The function requires existing GCMs created by the HyperSkin tool.

  • It is part of the HyperSkin toolset, which is designed to streamline and enhance rigging processes in Maya.

  • The function plays a critical role in ensuring the rig’s stability and accuracy during and after modifications.

graph TB Start[("fa:fa-play Start")] --> CheckGCMs{"/fas:fa-puzzle-piece Check GCMs Existence"} CheckGCMs --"GCMs Exist"--> UpdateGCMs["/fas:fa-sync-alt Update GCMs"] CheckGCMs --"No GCMs Found"--> DisplayError["/fas:fa-exclamation-triangle Display Error Message"] UpdateGCMs --> End[("fas:fa-stop End")] DisplayError --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckGCMs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateGCMs fill:#99ccff,stroke:#000,stroke-width:2px style DisplayError fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The as_UpdateGCMs function operates as follows:

  1. It begins by checking if Geometry Control Meshes (GCMs) exist in the scene.

  2. If GCMs are found, the function proceeds to update them, aligning them accurately with the current rig state.

  3. The update process involves adjusting parent constraints and ensuring proper alignment of the GCMs with the skeleton and skin meshes.

  4. If no GCMs are found, an error message is displayed, indicating the need to create GCMs first.

  5. The process concludes after successfully updating the GCMs or upon displaying the error message.

HyperSkin.as_VisitBlog(self)#
HyperSkin.as_VisitPythonScripting(self)#
HyperSkin.averageSelectedVtx(self)#

[shArgs : none]

Purpose:

:: Averages the skinning weights of selected vertices in Autodesk Maya, based on the surrounding vertex weights.

  • Averages the skinning weights for better deformation and smoother transitions in skinning.

  • Helps in refining the skin weights of selected vertices by considering the weights of adjacent vertices.

  • Useful for tweaking skin weights in areas where vertices need smoother blending.

Usage Example:

>>> # Select vertices to average
>>> select('pCube1.vtx[1]', 'pCube1.vtx[3]', 'pCube1.vtx[5]')
>>> averageSelectedVtx()
# Averages the skin weights of the selected vertices based on their neighboring vertices.
Note:

  • Ensure that the vertices belong to a skinned mesh with an associated skinCluster.

  • This function is particularly useful in the skinning phase of rigging, where fine-tuning vertex weights is crucial for realistic deformations.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Vertex Selection"} CheckSelection --"Vertices Selected"--> ExpandSelection["/fas:fa-expand-arrows-alt Expand Vertex Selection"] CheckSelection --"No Vertices Selected"--> Error["/fas:fa-times-circle Display Error"] ExpandSelection --> CalculateAverageWeights{"/fas:fa-balance-scale Calculate Average Weights"} CalculateAverageWeights --> ApplyWeights["/fas:fa-hammer Apply Averaged Weights"] ApplyWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ExpandSelection fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:2px style CalculateAverageWeights fill:#99ccff,stroke:#000,stroke-width:2px style ApplyWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the averageSelectedVtx function:

  1. The process starts by checking if vertices are selected.

  2. If vertices are selected, it expands the selection to include adjacent vertices.

  3. The average skin weights of the expanded selection are calculated.

  4. The averaged weights are then applied to the originally selected vertices.

  5. The process completes, resulting in smoother skin weights for the selected vertices.

HyperSkin.averageVtxWeight(self, vtxName, skinMesh, skinClust, allJntList)#

[shArgs : none]

Purpose:

:: Calculates and applies averaged skin weights to a specific vertex in Autodesk Maya, enhancing smoothness in skin deformation.

  • Averages the skin weights of a selected vertex based on its immediate neighboring vertices.

  • Helps in refining the skin weights for more natural deformations, especially in complex areas of a character’s mesh.

  • Essential for fine-tuning skinning in character rigging to achieve more realistic animations.

Parameters:
  • vtxName – <str> #The name of the vertex for which the weights are to be averaged.

  • skinMesh – <str> #The name of the skinned mesh containing the vertex.

  • skinClust – <str> #The skinCluster node associated with the skinned mesh.

  • allJntList – <list> #List of all joints influencing the skinned mesh.

Usage Example:

>>> # Given a vertex, skinMesh, skinCluster, and a list of influencing joints
>>> averageVtxWeight('pCube1.vtx[5]', 'pCube1', 'skinCluster1', ['joint1', 'joint2', 'joint3'])
# Applies averaged skin weights to 'pCube1.vtx[5]' based on the weights of its neighboring vertices.
Note:

  • Ensure that the vertex, skinned mesh, skinCluster, and joint list are correctly defined in Maya before executing this function.

  • This function is particularly useful for addressing skinning issues at specific vertices, allowing for targeted weight adjustments.

graph TB Start[("fa:fa-play Start")] --> ExpandSelection["/fas:fa-expand-arrows-alt Expand Vertex Selection"] ExpandSelection --> CollectWeights{"/fas:fa-balance-scale Collect Weights of Expanded Selection"} CollectWeights --> CalculateAverage["/fas:fa-calculator Calculate Average Weights"] CalculateAverage --> ApplyWeights["/fas:fa-hammer Apply Averaged Weights"] ApplyWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ExpandSelection fill:#99ccff,stroke:#000,stroke-width:2px style CollectWeights fill:#99ccff,stroke:#000,stroke-width:2px style CalculateAverage fill:#99ccff,stroke:#000,stroke-width:2px style ApplyWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart details the averageVtxWeight function:

  1. The process begins with expanding the selection around the specified vertex.

  2. Skin weights of the expanded selection are collected for each influencing joint.

  3. The average weights are calculated based on the collected data.

  4. These averaged weights are then applied to the originally specified vertex.

  5. The process concludes, resulting in a more balanced weight distribution for the specific vertex.

HyperSkin.centerPiv(self, objName)#

[shArgs : on=objName]

Purpose:

:: Centers the pivot of a given object in Maya.

  • Useful for adjusting the pivot point of an object to its geometric center, which is critical for proper transformations and animations.

  • Enhances precision and ease in manipulating objects within complex scenes or rigs.

Parameters:

objName – <str> # The name of the object whose pivot is to be centered.

Returns:

None # This function does not return any value.

Code Examples:

>>> object_name = "model_part"
>>> centerPiv(object_name)
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SelectObject fill:#ff9999,stroke:#000,stroke-width:2px style CenterPivot fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> SelectObject["/fas:fa-mouse-pointer Select Object"] CheckShArgs --"If shArgs not provided"--> SelectObject SelectObject --> CenterPivot["/fas:fa-crosshairs Center Pivot"] CenterPivot --> End[("fas:fa-stop End")]
Flow Chart Description:

This flowchart illustrates the centerPiv function:

  1. The process begins by checking if shArgs are provided, updating objName accordingly.

  2. The function then selects the specified object in Maya.

  3. The pivot of the selected object is centered using Maya’s Center Pivot command.

  4. The function concludes after centering the pivot of the object.

HyperSkin.changeOptions_AdvancedGCMs(self)#

[shArgs : None]

Purpose:

:: The changeOptions_AdvancedGCMs function in Maya Python API is designed to toggle the UI options between advanced and basic modes for Geometry Control Modifiers (GCMs). It adjusts the labels and functionalities of various buttons and radio buttons based on whether the advanced mode is enabled or not.

  • Line 1, Advanced mode allows more complex and detailed control over GCMs, suitable for experienced users.

  • Line 2, Basic mode simplifies the control, making it more accessible to beginners or for quick adjustments.

Argument | Description :—- | :—- None | This function does not take any arguments.

:return: None #This function does not return any value but changes the UI elements in Autodesk Maya.

Code Examples:

>>> changeOptions_AdvancedGCMs()
# Toggles the UI options between advanced and basic modes for GCMs.
graph TB Start[("fa:fa-play Start")] --> CheckAdvanced[("fas:fa-toggle-on Check Advanced Mode")] CheckAdvanced --"If Advanced Mode"--> SetAdvancedLabels[("fas:fa-cogs Set Advanced Labels")] SetAdvancedLabels --> End[("fas:fa-stop End")] CheckAdvanced --"If Basic Mode"--> SetBasicLabels[("fas:fa-tools Set Basic Labels")] SetBasicLabels --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart explains the changeOptions_AdvancedGCMs function:

  1. The function begins by checking if the advanced mode is enabled.

  2. If the advanced mode is on, it sets the labels of UI elements to reflect advanced options.

  3. If the advanced mode is off, it changes the labels to basic mode options.

HyperSkin.checkInAHSSUsers(self)#
HyperSkin.checkPosIn_BB(self, pos, bbObj)#

[shArgs : none]

Purpose:

:: Determines if a given position (x, y, z) is within the bounding box of a specified object in Maya.

  • This function is particularly useful in scene analysis, collision detection, and spatial queries within Maya.

  • It aids in determining the spatial relationship between a point and an object’s bounding box.

Parameters:
  • pos – <list> #A list representing the position (x, y, z) to check.

  • bbObj – <str> #Name of the Maya object whose bounding box is used for the check.

Usage Example:

>>> checkPosIn_BB([1, 2, 3], 'pCube1')
# Checks if the position [1, 2, 3] is inside the bounding box of 'pCube1'.

Note: - The function is versatile and can be applied to various scenarios in 3D space where spatial relationships are crucial. - It efficiently leverages Maya’s API for precise bounding box calculations.

Flow Chart Description:

The flowchart for the checkPosIn_BB function:

  1. Starts by obtaining the bounding box of the specified Maya object.

  2. Converts the given position into an MPoint object.

  3. Checks if the MPoint is within the bounding box.

  4. Returns True if the point is inside the bounding box, otherwise False.

graph TB Start[("fa:fa-play Start")] --> ObtainBoundingBox["/fas:fa-vector-square Obtain Bounding Box"] ObtainBoundingBox --> ConvertToMPoint["/fas:fa-exchange-alt Convert Position to MPoint"] ConvertToMPoint --> CheckPosition["/fas:fa-search-location Check if Position is Inside Bounding Box"] CheckPosition --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ObtainBoundingBox fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToMPoint fill:#99ccff,stroke:#000,stroke-width:2px style CheckPosition fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.closeWindows(self)#

[shArgs : se=scriptEd, ne=nodeEd, cl=commandLine]

Purpose:

:: Closes specified windows in the Maya interface, including the script editor, node editor, and command line.

  • Useful for streamlining the Maya interface and closing unnecessary windows during specific operations.

  • Enhances user experience by providing control over the visibility of various interface components.

Parameters:
  • scriptEd – <int, optional> # Indicates whether the script editor should be closed. Default is 1.

  • nodeEd – <int, optional> # Indicates whether the node editor should be closed. Default is 1.

  • commandLine – <int, optional> # Indicates whether the command line should be closed. Default is 0.

Returns:

None # This function does not return any value.

Code Examples:

>>> close_script_editor = 1
>>> close_node_editor = 1
>>> close_command_line = 0
>>> closeWindows(close_script_editor, close_node_editor, close_command_line)
# Closes the script editor and node editor, but keeps the command line open.
graph TB Start[("fa:fa-play Start")] --> CheckScriptEditor{"/fas:fa-code Check Script Editor"} CheckScriptEditor --"If scriptEd is True" --> CloseScriptEditor["/fas:fa-window-close Close Script Editor"] CheckScriptEditor --"If scriptEd is False" --> CheckNodeEditor{"/fas:fa-project-diagram Check Node Editor"} CloseScriptEditor --> CheckNodeEditor CheckNodeEditor --"If nodeEd is True" --> CloseNodeEditor["/fas:fa-window-close Close Node Editor"] CheckNodeEditor --"If nodeEd is False" --> CheckCommandLine{"/fas:fa-terminal Check Command Line"} CloseNodeEditor --> CheckCommandLine CheckCommandLine --"If commandLine is True" --> CloseCommandLine["/fas:fa-times-circle Close Command Line"] CheckCommandLine --"If commandLine is False" --> End[("/fas:fa-stop End")] CloseCommandLine --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckScriptEditor fill:#ffcc00,stroke:#000,stroke-width:2px style CloseScriptEditor fill:#ff9999,stroke:#000,stroke-width:2px style CheckNodeEditor fill:#99ccff,stroke:#000,stroke-width:2px style CloseNodeEditor fill:#cc99ff,stroke:#000,stroke-width:2px style CheckCommandLine fill:#ffcc00,stroke:#000,stroke-width:2px style CloseCommandLine fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the closeWindows function:

  1. The process starts by checking if the script editor should be closed.

  2. If scriptEd is True, closes the script editor and then checks the node editor.

  3. If nodeEd is True, closes the node editor and then checks the command line.

  4. If commandLine is True, closes the command line.

  5. The function concludes successfully.

HyperSkin.computeTime(self, killTime=False, processName=None, runCompute=True)#

Purpose:

:: Computes and returns the time taken by a process or a set of processes in Maya.

  • Essential for tracking and analyzing the duration of various operations in Maya, especially in scripting and tool development.

  • Offers insight into performance and helps optimize processes by providing detailed timing information.

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

  • processName – <str, optional> # Name of the process for time computation. Default is None.

  • runCompute – <bool, optional> # If True, runs the time computation. Default is True.

  • overallCompute – <bool, optional> # If True, computes the overall time for all processes. Default is False.

  • refreshView – <bool, optional> # If True, refreshes the view after computation. Default is True.

Returns:

<list> # Array containing hours, minutes, seconds of computed time and a string representation of the same.

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

Code Examples:

>>> process_name = "Rigging Operation"
>>> compute_result = computeTime(processName=process_name)
# Returns an array containing the computed time and a formatted string.
graph TB Start[("fa:fa-play Start")] --> CheckComponentList{"/fas:fa-check-circle Check Component List"} CheckComponentList --"If component list is empty" --> GetSelection["/fas:fa-hand-pointer Get Selection"] GetSelection --> InitializePosition["/fas:fa-location-arrow Initialize Position"] CheckComponentList --"If component list is provided" --> FlattenList["/fas:fa-stream Flatten List"] FlattenList --> InitializePosition InitializePosition --> AppendComponentPosition["/fas:fa-plus-square Append Component Position"] AppendComponentPosition --"For each component" --> AveragePosition{"/fas:fa-calculator Average Position"} AveragePosition --"Calculate average position" --> ReturnResult["/fas:fa-share Return Result"] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckComponentList fill:#ffcc00,stroke:#000,stroke-width:2px style GetSelection fill:#ff9999,stroke:#000,stroke-width:2px style FlattenList fill:#99ccff,stroke:#000,stroke-width:2px style InitializePosition fill:#cc99ff,stroke:#000,stroke-width:2px style AppendComponentPosition fill:#99ff99,stroke:#000,stroke-width:2px style AveragePosition fill:#ff6666,stroke:#000,stroke-width:2px style ReturnResult fill:#00cc00,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getCenter function:

  1. Begins by checking if the component list is provided.

  2. If the component list is empty, it gets the current selection in Maya.

  3. Initializes a position variable to store component positions.

  4. Appends the position of each component in the provided list.

  5. Calculates the average position of all components.

  6. Returns the computed average position as [x, y, z] coordinates.

HyperSkin.confirmAction(self, action, raiseErr=False, trueVal='Yes', falseVal='No', ex1Btn=None, ex1Action=None, **shortArgs)#

[shArgs : a=action, e=raiseErr, tv=trueVal, fv=falseVal, eb1=ex1Btn, ea1=ex1Action, eb2=ex2Btn, ea2=ex2Action, eb3=ex3Btn, ea3=ex3Action, eb4=ex4Btn, ea4=ex4Action]

Purpose:

:: Displays a confirmation dialog for a specific action in Maya and returns the user’s response.

Argument | Description:

:param action: (<type str>) # The action for which confirmation is required.
:param raiseErr: (<type bool, optional>) # If True, raises an error upon a negative response.
:param trueVal: (<type str, optional>) # Value to return if the action is confirmed. Defaults to 'Yes'.
:param falseVal: (<type str, optional>) # Value to return if the action is denied. Defaults to 'No'.
:param ex1Btn: (<type str, optional>) # Additional button for extended options.
:param ex1Action: (<type function, optional>) # Action to perform if the additional button is clicked.
:param ex2Btn: (<type str, optional>) # Additional button for extended options.
:param ex2Action: (<type function, optional>) # Action to perform if the additional button is clicked.
:param ex3Btn: (<type str, optional>) # Additional button for extended options.
:param ex3Action: (<type function, optional>) # Action to perform if the additional button is clicked.
:param ex4Btn: (<type str, optional>) # Additional button for extended options.
:param ex4Action: (<type function, optional>) # Action to perform if the additional button is clicked.

:return: (<type str, bool, None>) # The user’s response to the confirmation dialog.

Usage:

>>> action_text = "Are you sure you want to delete this object?"  # Example action text
>>> confirmation = confirmAction(action_text)
# Displays a confirmation dialog and returns 'Yes', 'No', or None based on the user's response.

>>> action_text = "Are you sure you want to delete this object?"  # Example action text
>>> confirmation = confirmAction(action_text, raiseErr=True)
# Displays a confirmation dialog and raises a RuntimeError if the user responds with 'No'.

>>> action_text = "Are you sure you want to save changes?"  # Example action text
>>> confirmation = confirmAction(action_text, trueVal='Save', falseVal='Cancel', ex1Btn='Don't Save')
# Displays a confirmation dialog with extended options and returns 'Save', 'Cancel', 'Don't Save', or None based on the user's response.

This function displays a confirmation dialog for a specific action in Maya and returns the user’s response. You can customize the buttons and actions when extended options are available.

graph TB Start_confirmAction[("fa:fa-play Start")] --> CheckShArgs_confirmAction{{"/fas:fa-question Check shArgs"}} CheckShArgs_confirmAction --"If shArgs provided" --> UpdateParams_confirmAction["/fas:fa-sync-alt Update Parameters"] CheckShArgs_confirmAction --"If shArgs not provided" --> DisplayDialog_confirmAction["/fas:fa-window-maximize Display Dialog"] UpdateParams_confirmAction --> DisplayDialog_confirmAction DisplayDialog_confirmAction --> DecisionPoint_confirmAction{{"/fas:fa-hand-pointer Decision Point"}} DecisionPoint_confirmAction --"User selects TrueVal" --> ReturnTrue_confirmAction["/fas:fa-check-circle-o Return True or TrueVal"] DecisionPoint_confirmAction --"User selects FalseVal" --> ReturnFalse_confirmAction["/fas:fa-times-circle-o Return False or FalseVal"] DecisionPoint_confirmAction --"User selects Ex1Btn" --> ExecuteEx1_confirmAction["/fas:fa-play Execute Ex1 Action"] ExecuteEx1_confirmAction --> ReturnEx1_confirmAction["/fas:fa-check-circle-o Return Ex1Btn or None"] DecisionPoint_confirmAction --"User selects Ex2Btn" --> ExecuteEx2_confirmAction["/fas:fa-play Execute Ex2 Action"] ExecuteEx2_confirmAction --> ReturnEx2_confirmAction["/fas:fa-check-circle-o Return Ex2Btn or None"] DecisionPoint_confirmAction --"User selects Ex3Btn" --> ExecuteEx3_confirmAction["/fas:fa-play Execute Ex3 Action"] ExecuteEx3_confirmAction --> ReturnEx3_confirmAction["/fas:fa-check-circle-o Return Ex3Btn or None"] DecisionPoint_confirmAction --"User selects Ex4Btn" --> ExecuteEx4_confirmAction["/fas:fa-play Execute Ex4 Action"] ExecuteEx4_confirmAction --> ReturnEx4_confirmAction["/fas:fa-check-circle-o Return Ex4Btn or None"] style Start_confirmAction fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs_confirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParams_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style DisplayDialog_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style DecisionPoint_confirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnTrue_confirmAction fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFalse_confirmAction fill:#ff6666,stroke:#000,stroke-width:2px style ExecuteEx1_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEx1_confirmAction fill:#99ff99,stroke:#000,stroke-width:2px style ExecuteEx2_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEx2_confirmAction fill:#99ff99,stroke:#000,stroke-width:2px style ExecuteEx3_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEx3_confirmAction fill:#99ff99,stroke:#000,stroke-width:2px style ExecuteEx4_confirmAction fill:#99ccff,stroke:#000,stroke-width:2px style ReturnEx4_confirmAction fill:#99ff99,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the confirmAction function:

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

  2. It then displays a confirmation dialog for the specified action.

  3. Based on the user’s decision, the function returns True, False, or executes extended actions and returns their respective values.

  4. The function supports customizing the dialog with additional buttons and actions.

HyperSkin.confirmSkinMesh(self, skinMesh=None)#

[shArgs : none]

Purpose:

:: Verifies if the specified mesh is a skinned mesh and associated with a skinCluster in Autodesk Maya.

  • Essential for ensuring that the selected mesh is properly skinned and ready for further rigging or skinning processes.

  • Validates the existence of a skinCluster, which is critical for skinning and deformation in character rigging.

Usage Example:

>>> confirmSkinMesh('meshName')
# Confirms if 'meshName' is a skinned mesh with an associated skinCluster.

Note: - The function can automatically detect the selected mesh in Maya if no mesh is explicitly provided. - It’s crucial in rigging workflows to confirm that the mesh is prepared correctly for skinning and deformation tasks.

Parameters:

  • skinMesh: (<str>, optional) The name of the mesh to confirm as a skinned mesh. If not provided, the function will try to use the selected mesh in Maya.

Return:

  • List containing the skinned mesh and its associated skinCluster.

  • return [skinMesh, skinClust[0]]

graph TB Start[("fa:fa-play Start")] --> CheckMeshInput{"/fas:fa-question-circle Check Mesh Input"} CheckMeshInput -- "Mesh Provided" --> ValidateMesh["/fas:fa-check-circle Validate Mesh"] ValidateMesh --> ConfirmSkinCluster["/fas:fa-link Confirm SkinCluster"] CheckMeshInput -- "No Mesh Provided" --> UseSelectedMesh["/fas:fa-hand-pointer Use Selected Mesh"] UseSelectedMesh --> ValidateMesh ConfirmSkinCluster --> ReturnResult["/fas:fa-flag-checkered Return Result"] ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshInput fill:#ffcc00,stroke:#000,stroke-width:2px style ValidateMesh fill:#99ccff,stroke:#000,stroke-width:2px style ConfirmSkinCluster fill:#cc99ff,stroke:#000,stroke-width:2px style UseSelectedMesh fill:#99ccff,stroke:#000,stroke-width:2px style ReturnResult fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the confirmSkinMesh function:

  1. The process begins, checking if a mesh name is provided as input.

  2. If a mesh is provided, it validates the mesh and confirms its skinCluster.

  3. If no mesh is provided, the function uses the currently selected mesh in Maya.

  4. The function then confirms if the selected or provided mesh has an associated skinCluster.

  5. Finally, it returns the result, which includes the skinned mesh and its skinCluster.

  6. The process ends.

HyperSkin.create_PolyDisc(self, discName, cRadius, jntAxis=None, hideGuides=False, deleteInnerGuide=False)#

[shArgs : none]

Purpose:

:: Creates a polygonal disc rig element in Autodesk Maya, which is often used for rigging joints and providing a visual guide for skin deformation.

  • Facilitates the creation of disc-shaped controls for rigging purposes.

  • Provides options for customization such as radius, joint axis alignment, and visibility of guide controls.

  • Enhances rigging workflow by providing a quick and easy method to create disc controls.

Usage Example:

>>> polyDisc = create_PolyDisc('discName', 1.5, jntAxis='x')
# Creates a polygonal disc named 'discName' with a radius of 1.5 units and aligned along the x-axis.

Note: - This function is primarily used in rigging to create custom controls and guides for skin deformation. - The disc can be aligned to any primary axis (x, y, z) to suit the rigging requirements.

Parameters:

  • discName: (<str>) Name for the created polygonal disc.

  • cRadius: (<float>) Radius of the outer circle of the disc.

  • jntAxis: (<str>, optional) Axis alignment for the joint, if applicable. Can be ‘x’, ‘-x’, ‘y’, ‘-y’, ‘z’, ‘-z’.

  • hideGuides: (<bool>, optional) If set to True, hides the guide controls.

  • deleteInnerGuide: (<bool>, optional) If set to True, deletes the inner guide control.

Returns:

<PyNode> #The created polygonal disc as a PyNode object.

graph TB Start[("fa:fa-play Start")] --> SetVariables["/fas:fa-cogs Set Initial Variables"] SetVariables --> CreateOuterCtrl["/fas:fa-circle Create Outer Control"] SetVariables --> CreateInnerCtrl["/fas:fa-circle-notch Create Inner Control"] CreateOuterCtrl --> LoftDisc["/fas:fa-layer-group Loft Disc Shape"] CreateInnerCtrl --> LoftDisc LoftDisc --> ApplyShader["/fas:fa-paint-brush Apply Shader"] ApplyShader --> SetAttributes["/fas:fa-sliders-h Set Control Attributes"] SetAttributes --> AlignDisc["/fas:fa-arrows-alt Align Disc to Joint Axis"] AlignDisc --> HideOrDeleteGuides{"/fas:fa-eye-slash Hide/Delete Guides?"} HideOrDeleteGuides --"Hide"--> HideGuides["/fas:fa-eye-slash Hide Guides"] HideOrDeleteGuides --"Delete"--> DeleteInnerGuide["/fas:fa-trash-alt Delete Inner Guide"] HideGuides --> End[("fas:fa-stop End")] DeleteInnerGuide --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SetVariables fill:#ffcc00,stroke:#000,stroke-width:2px style CreateOuterCtrl fill:#99ccff,stroke:#000,stroke-width:2px style CreateInnerCtrl fill:#99ccff,stroke:#000,stroke-width:2px style LoftDisc fill:#99ccff,stroke:#000,stroke-width:2px style ApplyShader fill:#cc99ff,stroke:#000,stroke-width:2px style SetAttributes fill:#99ff99,stroke:#000,stroke-width:2px style AlignDisc fill:#99ff99,stroke:#000,stroke-width:2px style HideOrDeleteGuides fill:#ffcc00,stroke:#000,stroke-width:2px style HideGuides fill:#99ccff,stroke:#000,stroke-width:2px style DeleteInnerGuide fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the process of the create_PolyDisc function:

  1. The process starts and initial variables are set.

  2. Outer and inner controls are created.

  3. These controls are then lofted to form the disc shape.

  4. A shader is applied to the disc for visualization.

  5. Various attributes are set to the controls and the disc.

  6. The disc is aligned based on the specified joint axis.

  7. A decision is made whether to hide or delete the guide controls.

  8. Based on the decision, either the guides are hidden, or the inner guide is deleted.

  9. The process ends.

HyperSkin.dafaultSkin(self)#

[shArgs : none]

Purpose:

:: Resets the skin weights to their default state in Autodesk Maya, effectively restoring the original skinning setup.

  • This function is particularly useful in rigging and skinning workflows, where frequent adjustments to skin weights are common.

  • It provides a quick way to revert any changes made to the skin weights, allowing for a fresh start or comparison with the original skinning.

  • Ideal for troubleshooting and refining skinning issues in complex characters or models.

Usage Example:

>>> dafaultSkin()
# Resets the skin weights to their default values and displays a confirmation message.
Parameters:

  • None. This function operates on the currently selected skinned geometry in Maya.

Return:

  • No explicit return value, but the function provides visual feedback via Maya’s script editor or information line.

Note:

  • Ensure that the geometry with skin weights is selected before executing this function.

  • The function relies on the ResetWeightsToDefault command, which is part of Maya’s skinning toolkit.

  • It’s a utility function designed to aid in the skinning process, particularly beneficial during the initial stages of weight painting or after making significant changes to the skin weights.

graph LR Start[("fa:fa-play Start")] --> ResetSkinWeights["/fas:fa-undo-alt Reset Skin Weights"] ResetSkinWeights --> DisplayMessage["/fas:fa-comment Display Confirmation Message"] DisplayMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ResetSkinWeights fill:#99ccff,stroke:#000,stroke-width:2px style DisplayMessage fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the dafaultSkin function illustrates:

  1. The process begins with the function’s execution.

  2. The skin weights of the selected geometry are reset to their default values using the ResetWeightsToDefault command.

  3. Upon successful reset, a confirmation message is displayed to the user, indicating the completion of the operation.

HyperSkin.deleteEdgeLoops(self)#

[shArgs : none]

Purpose:

:: The function deleteEdgeLoops is designed for Autodesk Maya to facilitate the deletion of edge loops. It allows users to remove unwanted edge loops efficiently from the 3D models within their Maya scene.

  • Line 1, Additional Description as needed by sphinx HTML doc, if any

  • Line 2, Additional Description as needed by sphinx HTML doc, if any

Note:

  • This function is particularly useful for optimizing models by removing redundant geometry and maintaining a clean topology.

Returns:

None #The function does not return a value but deletes the selected edge loops from the scene.

Usage Example:

>>> deleteEdgeLoops()
# This will delete the edge loops selected by the user.
Flow Chart Description:

The deleteEdgeLoops function executes the following steps:

  1. Confirms the action to remove unwanted edge loops from the user.

  2. Retrieves a list of selected edges.

  3. Converts each edge to its respective edge loop.

  4. Collects all edge loops into a list.

  5. Selects and deletes the entire collected edge loops from the model.

  6. Clears the selection.

graph TD Start[("fa:fa-play Start")] --> ConfirmAction{Confirm Action} ConfirmAction -- No --> ActionTerminated[("fas:fa-stop Action Terminated")] ConfirmAction -- Yes --> RetrieveEdges[Retrieve Selected Edges] RetrieveEdges --> ConvertToLoop[Convert Each Edge to Edge Loop] ConvertToLoop --> CollectLoops[Collect All Edge Loops] CollectLoops --> DeleteLoops[Delete Selected Edge Loops] DeleteLoops --> ClearSelection[Clear Selection] ClearSelection --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmAction fill:#ffcc66,stroke:#000,stroke-width:2px style ActionTerminated fill:#ff6666,stroke:#000,stroke-width:3px style RetrieveEdges fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToLoop fill:#99ccff,stroke:#000,stroke-width:2px style CollectLoops fill:#99ccff,stroke:#000,stroke-width:2px style DeleteLoops fill:#99ccff,stroke:#000,stroke-width:2px style ClearSelection fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.deleteUnwanted(self)#

[shArgs : none]

Purpose:

:: The function deleteUnwanted in Autodesk Maya is designed to remove specific temporary or unwanted nodes from the scene. It primarily targets temporary groups, generic GCMs (Geometry Control Meshes), and certain vertex sets which are no longer needed.

  • Line 1, Additional Description as needed by sphinx HTML doc, if any

  • Line 2, Additional Description as needed by sphinx HTML doc, if any

Note:

  • This function is useful in cleaning up scenes by removing nodes that are no longer required, helping maintain an organized and efficient working environment.

Returns:

None #The function does not return a value but deletes specified nodes from the scene.

Usage Example:

>>> deleteUnwanted()
# This will attempt to delete 'as_TempGCM_Grp*', all nodes ending with 'GCM', and 'All_Fingers_VtxSet'.
Flow Chart Description:

The deleteUnwanted function executes the following steps:

  1. Attempts to delete any groups named “as_TempGCM_Grp*” which are typically used temporarily.

  2. Tries to delete any nodes ending with “GCM”, indicating they are generic geometry control meshes.

  3. Attempts to remove the ‘All_Fingers_VtxSet’, a specific vertex set that may no longer be needed.

graph TD Start[("fa:fa-play Start")] --> DeleteTempGCM[Delete "as_TempGCM_Grp*"] DeleteTempGCM --> DeleteGCM[Delete "*GCM"] DeleteGCM --> DeleteVtxSet[Delete 'All_Fingers_VtxSet'] DeleteVtxSet --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DeleteTempGCM fill:#99ccff,stroke:#000,stroke-width:2px style DeleteGCM fill:#99ccff,stroke:#000,stroke-width:2px style DeleteVtxSet fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.endProgressWin(self, numItems=None, stopProgress=False, useProgress=1, **shArgs)#

[shArgs : ni=numItems, sp=stopProgress, rv=refreshView, up=useProgress]

Purpose:

:: Completes and closes a progress window in Maya, with additional control over display and functionality.

  • Ideal for signaling the completion of lengthy operations or scripts in Maya, providing a clean end to progress tracking.

  • Offers options to display the number of items processed and to refresh the viewport upon completion.

Parameters:
  • numItems – <int, optional> # Number of items processed in the progress window. Default is None.

  • stopProgress – <bool, optional> # If True, stops the progress. Default is True.

  • refreshView – <bool, optional> # If True, refreshes the Maya viewport. Default is False.

  • useProgress – <bool, optional> # If True, uses the progress data for closing. Default is True.

Returns:

None # This function does not return any value but closes the progress window.

Code Examples:

>>> number_of_items = 100
>>> endProgressWin(number_of_items, stopProgress=True, refreshView=True, useProgress=True)
# Closes the progress window and displays the total number of items processed.
graph TB Start[("fa:fa-play Start")] --> CheckUseProgress{"/fas:fa-tasks Check Use Progress"} CheckUseProgress --"If useProgress is False" --> End[("/fas:fa-stop End")] CheckUseProgress --"If useProgress is True" --> CheckNumItems{"/fas:fa-list-ol Check Num Items"} CheckNumItems --"If numItems provided" --> UpdateNumItems["/fas:fa-sync Update Num Items"] UpdateNumItems --> StopProgress["/fas:fa-hand-paper Stop Progress"] StopProgress --> DisplayCompleted["/fas:fa-smile-beam Display Completed"] CheckNumItems --"If numItems not provided" --> StopProgress DisplayCompleted --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckUseProgress fill:#ffcc00,stroke:#000,stroke-width:2px style CheckNumItems fill:#ff9999,stroke:#000,stroke-width:2px style UpdateNumItems fill:#99ccff,stroke:#000,stroke-width:2px style StopProgress fill:#cc99ff,stroke:#000,stroke-width:2px style DisplayCompleted fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart depicts the endProgressWin function:

  1. Begins by checking if progress windows are utilized.

  2. If useProgress is False, the process ends.

  3. If useProgress is True, it checks if numItems are provided.

  4. Updates the progress window with the number of items processed.

  5. Stops the progress and displays a completion message.

  6. The function concludes by closing the progress window.

HyperSkin.error(self, errorMsg)#

[shArgs : em=errorMsg]

Purpose:

:: Displays an error message in a confirm dialog window and raises a RuntimeError in Maya.

Argument | Description:

:param errorMsg: (<type str, optional>) # The error message to be displayed in the dialog window.

:return: None (but raises a RuntimeError after the dialog is closed)

Code Examples:

>>> custom_error_message = "An error occurred!"  # Example error message
>>> error(errorMsg=custom_error_message)
# Displays an error dialog with the custom error message and raises a RuntimeError.

This function allows you to display an error message in a confirm dialog window and raise a RuntimeError in Maya.

graph TB Start[("fa:fa-play Start")] --> CheckErrorType{"/fas:fa-question-circle Check Error Type"} CheckErrorType --"If errorMsg is a list"--> JoinErrorMessage["/fas:fa-stream Join Error Message"] CheckErrorType --"If errorMsg is a string"--> DisplayErrorDialog["/fas:fa-exclamation-triangle Display Error Dialog"] JoinErrorMessage --> DisplayErrorDialog DisplayErrorDialog --"Display error in dialog"--> RaiseError["/fas:fa-exclamation-triangle Raise RuntimeError"] RaiseError --> End[("/fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckErrorType fill:#ffcc00,stroke:#000,stroke-width:2px style JoinErrorMessage fill:#ff9999,stroke:#000,stroke-width:2px style DisplayErrorDialog fill:#99ccff,stroke:#000,stroke-width:2px style RaiseError fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the error function:

  1. The function starts by checking if errorMsg is a list.

  2. If errorMsg is a list, it joins the list items into a single string.

  3. Displays the error message in a dialog window.

  4. Raises a RuntimeError with the error message.

HyperSkin.executeFile(self, filePath, fileName=None)#

[shArgs : none]

Purpose:

:: Executes a given Python script file line by line within Autodesk Maya.

  • Enables the execution of external Python scripts directly within Maya.

  • Useful for importing or applying complex operations stored in external files.

  • Provides a way to run scripts that modify or interact with Maya scenes.

Usage Example:

>>> executeFile('path/to/script.py')
# Executes the Python script located at 'path/to/script.py'.
Parameters:

  • None. The function requires the full path to the Python script file to be executed.

Return:

  • None. The Python script is executed, and any effects are applied directly to the Maya scene.

Note:

  • The function reads the script file and executes each line individually, ensuring that the entire script is processed.

  • If any line in the script fails to execute, the function collects and prints these lines at the end, indicating possible errors or issues in the script.

  • Progress of the script execution is displayed, providing feedback on the number of lines processed.

graph TB Start[("fa:fa-play Start")] --> CheckFileExists{"/fas:fa-file-alt Check File Exists"} CheckFileExists -- "File Found" --> OpenFile["/fas:fa-folder-open Open File"] CheckFileExists -- "File Not Found" --> DisplayWarning["/fas:fa-exclamation-triangle Display Warning"] OpenFile --> ReadFileLineByLine["/fas:fa-code Read File Line by Line"] ReadFileLineByLine --> TryExecuteLine{"/fas:fa-code-branch Try Execute Line"} TryExecuteLine -- "Execution Success" --> UpdateProgress["/fas:fa-sync-alt Update Progress"] TryExecuteLine -- "Execution Fail" --> CollectFailedLines["/fas:fa-times-circle Collect Failed Lines"] CollectFailedLines --> UpdateProgress UpdateProgress --> EndProgress[("/fas:fa-flag-checkered End Progress")] DisplayWarning --> End[("fas:fa-stop End")] EndProgress --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckFileExists fill:#ffcc00,stroke:#000,stroke-width:2px style OpenFile fill:#99ccff,stroke:#000,stroke-width:2px style ReadFileLineByLine fill:#99ccff,stroke:#000,stroke-width:2px style TryExecuteLine fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateProgress fill:#99ff99,stroke:#000,stroke-width:2px style CollectFailedLines fill:#ff6666,stroke:#000,stroke-width:2px style EndProgress fill:#ff6666,stroke:#000,stroke-width:3px style DisplayWarning fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the executeFile function:

  1. The process starts by checking if the specified file exists.

  2. If the file is found, it is opened for reading.

  3. The script reads each line of the file and attempts to execute it.

  4. If a line is executed successfully, the progress is updated.

  5. If a line fails to execute, it is collected in a list for later reporting.

  6. Once all lines are processed, the progress ends, and any failed lines are reported.

  7. If the file is not found, a warning is displayed, and the process ends.

HyperSkin.expandSkinArea(self, vtxList, valList, infName, skinClust=None, smoothCount=1, prevVtxList=None, **shortArgs)#

[shArgs : vl=vtxList, inf=infName, sc=smoothCount]

Purpose:

:: Expands skin weights from a base vertex list to a larger area with specified influence and values in Autodesk Maya.

  • Gradually decreases influence on vertices farther from the base list.

  • Useful for refining skin weights in a specific area of a skinned mesh.

Usage Example:

>>> expandSkinArea(vtxList, [0.75, 0.5], 'joint1', skinCluster1, smoothCount=2)
# Expands the skin weights from the base vertices in vtxList with decreasing influence values on surrounding vertices.
Parameters:

  • vtxList: (<list>) #List of base vertices to start skin weight expansion from.

  • valList: (<list>) #List of influence values to apply, decreasing with each recursive step.

  • infName: (<str>) #Name of the influence object (usually a joint).

  • skinClust: (<str>, optional) #The skinCluster node associated with the mesh. If not provided, it’s derived from vtxList.

  • smoothCount: (<int>, optional) #Number of times to smooth the skin weights after expansion.

Return:

  • Returns a list of all vertices affected by the expansion process.

Note:

  • The function is recursive and decreases influence values in valList with each call.

  • It’s important to provide a correct infName and skinClust for accurate skin weight application.

  • The smoothCount parameter can be adjusted to smooth the transition of skin weights for a more natural deformation.

graph TD Start[("fa:fa-play Start")] --> DefineBaseVertices[("fas:fa-object-group Define Base Vertices")] DefineBaseVertices --> ExpandArea[("fas:fa-expand-arrows-alt Expand Weight Area")] ExpandArea --> RecursionCheck{"/fas:fa-sync-alt Check More Values in valList?"} RecursionCheck --"Yes, More Values"--> ExpandArea RecursionCheck --"No More Values"--> SmoothSkinWeights["/fas:fa-brush Smooth Skin Weights"] SmoothSkinWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DefineBaseVertices fill:#ffcc00,stroke:#000,stroke-width:2px style ExpandArea fill:#99ccff,stroke:#000,stroke-width:2px style RecursionCheck fill:#ffcc00,stroke:#000,stroke-width:2px style SmoothSkinWeights fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the expandSkinArea function:

  1. Start with a defined base vertex list (vtxList).

  2. Expand the weight area to surrounding vertices, applying decreasing values from valList.

  3. Check if more values are present in valList for further expansion.

  4. If more values exist, continue the expansion process.

  5. Once all values are applied, smooth the skin weights.

  6. The process ends after smoothing the skin weights.

HyperSkin.exportAttributes(self, objList, attrList, filePath, fileName=None)#

[shArgs : none]

Purpose:

:: Exports specified attributes of a list of objects to a file using Maya commands in Autodesk Maya.

  • Efficiently exports custom attributes from multiple objects into a script file.

  • Creates a reusable script file that can be executed to replicate attribute settings.

  • Ideal for transferring attribute settings between different Maya scenes or projects.

Usage Example:

>>> exportAttributes(objList=["pCube1", "pSphere1"], attrList=["translateX", "rotateY"], filePath="C:/MyScripts", fileName="attributeExport.py")
# Exports the 'translateX' and 'rotateY' attributes of 'pCube1' and 'pSphere1' to 'attributeExport.py' in 'C:/MyScripts'.
Parameters:

  • objList: (<list>) List of objects whose attributes need to be exported.

  • attrList: (<list>) List of attribute names to be exported.

  • filePath: (<str>) Path to the directory where the export file will be saved.

  • fileName: (<str>, optional) Name of the file to save the exported attributes. Default is None.

Return:

  • None. The function generates a Python script file at the specified location.

Note:

  • Ensure the objects and attributes exist in the scene before running the function.

  • The exported file can be executed in any Maya scene to apply the same attribute settings.

  • The function is useful for backing up attribute settings or transferring them between scenes.

graph TB Start[("fa:fa-play Start")] --> PrepareExportScript{"/fas:fa-cog Prepare Export Script"} PrepareExportScript --> WriteToFile{"/fas:fa-file-alt Write to File"} WriteToFile --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style PrepareExportScript fill:#ffcc00,stroke:#000,stroke-width:2px style WriteToFile fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart outlines the exportAttributes function:

  1. The process starts and prepares the export script by iterating through the object list and attribute list.

  2. For each object and attribute, the function retrieves the attribute value and formats it into a Maya command string.

  3. These command strings are compiled into a script file, which is then written to the specified file path.

  4. The process completes once the file is successfully created with all the attribute export commands.

HyperSkin.exportAttrs_DSCs(self)#

[shArgs : none]

Purpose:

:: Exports attributes related to Hyper Discs or joints in a rigging setup in Autodesk Maya to a specified file.

  • Allows for the export of key attributes related to Hyper Discs or joints, essential for rigging tasks.

  • Provides flexibility to choose between exporting attributes from Hyper Discs or joints only.

  • Supports saving the exported data to a user-defined file path for easy access and reusability.

Usage Example:

>>> exportAttrs_DSCs()
# Exports attributes related to Hyper Discs or joints and saves them in a specified file.
Parameters:

  • None. The function uses internal checks and user preferences set in the GUI.

Return:

  • None. The exported attributes are saved to a file specified by the user.

Note:

  • The function allows selecting whether to export attributes from Hyper Discs or joints only, based on user preference set in the GUI.

  • It is crucial to have the Hyper Discs or joints present in the scene for successful export.

  • The user has the option to specify the file path where the exported data should be saved.

graph TB Start[("fa:fa-play Start")] --> CheckDiscBind{"/fas:fa-question-circle Check Disc Binding Option"} CheckDiscBind --"Disc Binding Enabled"--> SelectDiscs["/fas:fa-mouse-pointer Select Hyper Discs"] CheckDiscBind --"Disc Binding Disabled"--> SelectJoints["/fas:fa-mouse-pointer Select Joints"] SelectDiscs --> ExportAttrs["/fas:fa-save Export Disc Attributes"] SelectJoints --> ExportAttrs ExportAttrs --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckDiscBind fill:#ffcc00,stroke:#000,stroke-width:2px style SelectDiscs fill:#99ccff,stroke:#000,stroke-width:2px style SelectJoints fill:#99ccff,stroke:#000,stroke-width:2px style ExportAttrs fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the exportAttrs_DSCs function:

  1. The process begins by checking if Disc Binding is enabled or disabled in the GUI.

  2. If Disc Binding is enabled, the function selects all Hyper Discs present in the scene.

  3. If Disc Binding is disabled, it selects all joints in the scene.

  4. The function then exports the attributes of the selected Hyper Discs or joints.

  5. The process completes once the attributes are exported and saved to the specified file.

HyperSkin.exportBlendWeights(self, skinMesh=None, filePath=None, fileName=None)#

[shArgs : sm=skinMesh, fp=filePath, fn=fileName]

Purpose:

:: Exports blend weights from selected vertices or the entire skin mesh to a Python file. Useful for saving and transferring skinning data in character rigging workflows.

Parameters:
  • skinMesh – (<str> | <hsNode>, optional) #Name or hsNode of the skin mesh to export blend weights from. If not provided, the function uses the selected object. Default is None.

  • filePath – (<str>, optional) #Path to the directory where the export file will be saved. If not provided, uses the directory of the current scene. Default is None.

  • fileName – (<str>, optional) #Name of the file to save the blend weights. If not provided, the file is named after the skin mesh. Default is None.

Returns:

None #This function does not return a value but creates a Python file with blend weight data.

Usage Example:

>>> exportBlendWeights('body_geo', '/path/to/export/', 'body_geo_blendWeights.py')
# This will export blend weights of 'body_geo' mesh to the specified file and path.
Flow Chart Description:

The exportBlendWeights function performs the following operations:

  1. Determines the skin mesh to export blend weights from, either from provided argument or selection.

  2. Extracts blend weights from the specified vertices or entire skin mesh.

  3. Formats the blend weights into a Python dictionary string.

  4. Checks and prepares the file path and name for export.

  5. Writes the blend weight data to the specified Python file.

graph TB Start[("fa:fa-play Start")] --> DetermineMesh["/fas:fa-cube Determine Skin Mesh"] DetermineMesh --> ExtractWeights["/fas:fa-balance-scale Extract Blend Weights"] ExtractWeights --> FormatData["/fas:fa-code Format Data as Python Dictionary"] FormatData --> CheckFilePath["/fas:fa-folder-open Check & Prepare File Path"] CheckFilePath --> WriteFile["/fas:fa-save Write Data to File"] WriteFile --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineMesh fill:#99ccff,stroke:#000,stroke-width:2px style ExtractWeights fill:#99ccff,stroke:#000,stroke-width:2px style FormatData fill:#99ccff,stroke:#000,stroke-width:2px style CheckFilePath fill:#99ccff,stroke:#000,stroke-width:2px style WriteFile fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.exportDSCs_2File(self)#

[shArgs : none]

Purpose:

:: Exports all Hyper Discs from the scene to a specified file for rigging setups in Autodesk Maya.

  • Facilitates the backup or transfer of Hyper Disc configurations from one scene to another.

  • Offers a straightforward way to save rigging setups for future use or sharing.

  • Allows users to choose the file format and location for the exported Hyper Discs.

Usage Example:

>>> exportDSCs_2File()
# Exports all Hyper Discs to a specified file.
Parameters:

  • None. The function relies on GUI elements for user input and preferences.

Return:

  • None. The Hyper Discs are exported to a file at the specified location.

Note:

  • Users need to ensure that ‘as_HyperSkin_Grp’ exists in the scene for successful export.

  • The function provides options to select the file format (Maya ASCII or Maya Binary) and the directory for saving the exported file.

  • A confirmation prompt appears if a file with the same name already exists at the destination, giving the user an option to overwrite or cancel the operation.

graph TB Start[("fa:fa-play Start")] --> CheckHyperSkinGrp{"/fas:fa-question-circle Check for as_HyperSkin_Grp"} CheckHyperSkinGrp -- "Group Found" --> SelectDSCs["/fas:fa-mouse-pointer Select Hyper Discs"] CheckHyperSkinGrp -- "Group Not Found" --> Error["/fas:fa-exclamation-triangle Display Error"] SelectDSCs --> ChooseFileFormat["/fas:fa-file-alt Choose File Format"] ChooseFileFormat --> ExportDSCs["/fas:fa-save Export Hyper Discs"] Error --> End[("fas:fa-stop End")] ExportDSCs --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckHyperSkinGrp fill:#ffcc00,stroke:#000,stroke-width:2px style SelectDSCs fill:#99ccff,stroke:#000,stroke-width:2px style ChooseFileFormat fill:#99ccff,stroke:#000,stroke-width:2px style ExportDSCs fill:#cc99ff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the exportDSCs_2File function:

  1. The process starts by checking if the ‘as_HyperSkin_Grp’ exists in the scene.

  2. If the group is found, the function selects all Hyper Discs within it.

  3. The user is prompted to choose the file format for export (Maya ASCII or Maya Binary).

  4. The Hyper Discs are then exported to the specified file.

  5. If the ‘as_HyperSkin_Grp’ is not found, an error message is displayed, and the process ends.

HyperSkin.exportSkinDeformer(self, filePath, meshList)#

[shArgs : none]

Purpose:

:: Exports the skin deformer data of the specified meshes to an external file for backup or transfer purposes.

  • Facilitates the process of exporting skinning data, such as weights and influences, from one or more meshes in Autodesk Maya.

  • Useful for transferring skinning information between different scenes or projects.

Usage Example:

>>> exportSkinDeformer(filePath, meshList)
# Exports the skin deformer data for the meshes listed in 'meshList' to the specified 'filePath'.
Parameters:

  • filePath: The destination file path where the skin deformer data will be saved.

  • meshList: A list of mesh names whose skinning data is to be exported.

Return:

  • None. The function writes the skin deformer data to an external file.

Note:

  • The meshes in the meshList must be skinned for the function to work correctly.

  • The version of Maya influences the file format for exporting the data (.hyperSkin for Maya versions below 2019 and .xml for Maya 2019 and above).

graph TB Start[("fa:fa-play Start")] --> GetMeshList["/fas:fa-list Get Mesh List"] GetMeshList --> CheckSkinning{"/fas:fa-user-md Check If Mesh Is Skinned"} CheckSkinning --"If Skinned"--> ExportSkinData["/fas:fa-download Export Skin Deformer Data"] CheckSkinning --"If Not Skinned"--> Warning["/fas:fa-exclamation-triangle Display Warning"] ExportSkinData --> End[("fas:fa-stop End")] Warning --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetMeshList fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinning fill:#ffcc00,stroke:#000,stroke-width:2px style ExportSkinData fill:#99ff99,stroke:#000,stroke-width:2px style Warning fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the exportSkinDeformer function:

  1. The process begins by retrieving the list of meshes provided in meshList.

  2. Each mesh is checked to see if it is skinned.

  3. If a mesh is skinned, its skin deformer data is exported to the specified filePath.

  4. If a mesh is not skinned, a warning message is displayed.

  5. The process completes after exporting the data or displaying the warning.

HyperSkin.exportSkinWeights(self, vtxList=None, filePath=None, fileName=None, advExport=False)#

[shArgs : none]

Purpose:

:: Exports skin weights for selected vertices or entire mesh objects in Autodesk Maya.

It supports both advanced and standard export modes.

  • Facilitates the export of skin weights for rigging and animation workflows.

  • Offers options to export weights for the entire mesh, selected vertices, or specific sides (left, right, both).

  • Advanced export mode allows saving skin weights as JSON or XML files for detailed customization.

Usage Example:

>>> exportSkinWeights(vtxList, filePath, fileName, advExport=False)
# Exports the skin weights of the specified vertices or selected meshes.
Parameters:

  • vtxList: Optional. List of vertices for which skin weights are to be exported.

  • filePath: Optional. The path where the export file will be saved.

  • fileName: Optional. The name of the export file.

  • advExport: Boolean. Specifies whether to use advanced export mode.

Return:

  • None. The function exports skin weights to the specified location.

Note:

  • Advanced export mode is useful for complex rigging setups where precise control over skin weights is needed.

  • Ensure the correct selection of mesh objects or vertices before executing the function.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-check-circle Check Selection"} CheckSelection --> DefineExportMode{"/fas:fa-cogs Define Export Mode"} DefineExportMode --"Standard Export"--> ExportStandard["/fas:fa-save Export Standard Weights"] DefineExportMode --"Advanced Export"--> ExportAdvanced["/fas:fa-save Export Advanced Weights"] ExportStandard --> End[("fas:fa-stop End")] ExportAdvanced --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style DefineExportMode fill:#99ccff,stroke:#000,stroke-width:2px style ExportStandard fill:#99ff99,stroke:#000,stroke-width:2px style ExportAdvanced fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the exportSkinWeights function:

  1. The process begins by checking the selection in Maya.

  2. The export mode is defined based on user input or function parameters.

  3. If standard export is chosen, skin weights are exported in a simple format.

  4. If advanced export is selected, skin weights are saved in a detailed file format like JSON or XML.

  5. The process concludes once the export is completed.

HyperSkin.exportSkinWeights2(self, vtxList=None, filePath=None, fileName=None)#

[shArgs : vl=vtxList, fp=filePath, fn=fileName, bs=bothSides, isl=importSelList]

Purpose:

:: Exports skin weights of a mesh or selected vertices to a Python file, useful for saving and transferring skinning data in 3D character rigging.

Parameters:
  • vtxList – (<list of str>, optional) #List of vertex names to export skin weights for. If not provided, uses selected vertices or entire skin mesh. Default is None.

  • filePath – (<str>, optional) #Directory path to save the exported file. If not provided, uses the directory of the current scene. Default is None.

  • fileName – (<str>, optional) #Name of the file to save skin weights data. If not provided, uses the skin mesh’s name with ‘_SkinWeights.py’ suffix. Default is None.

  • bothSides – (<bool>) #Flag to determine if weights for both sides of the mesh should be exported. Default is False.

  • importSelList – (<bool>) #Flag to include selection commands in the exported script. Default is False.

Returns:

None #This function does not return a value but saves the skin weights data to a Python file.

Usage Example:

>>> exportSkinWeights2(['body_geo.vtx[0]', 'body_geo.vtx[1]'], '/path/to/export/', 'body_geo_SkinWeights.py')
# This will export skin weights of specified vertices to the specified file and path.
Flow Chart Description:

The exportSkinWeights2 function performs the following operations:

  1. Determines the vertices to export skin weights for, either from provided argument, selection, or entire mesh.

  2. Prepares the file path and name for exporting data.

  3. Iterates over each vertex, retrieves its skin weight data, and formats it into a Python script.

  4. Saves the formatted skin weight data to the specified Python file.

graph TB Start[("fa:fa-play Start")] --> DetermineVertices["/fas:fa-cube Determine Vertices"] DetermineVertices --> PrepareFile["/fas:fa-file-alt Prepare File"] PrepareFile --> ExportWeights["/fas:fa-upload Export Weights"] ExportWeights --> SaveFile["/fas:fa-save Save File"] SaveFile --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineVertices fill:#99ccff,stroke:#000,stroke-width:2px style PrepareFile fill:#99ccff,stroke:#000,stroke-width:2px style ExportWeights fill:#99ccff,stroke:#000,stroke-width:2px style SaveFile fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.exportSkinWeights_Deformer(self, fileName=None)#

[shArgs : fileName=fName]

Purpose:

:: Exports the skin deformer weights from selected mesh objects in Autodesk Maya to a specified file for backup or reuse.

  • Facilitates the backup or transfer of skinning data between different Maya scenes or projects.

  • Allows selective export of skin weights from one or more selected mesh objects.

  • Provides an option to overwrite existing files with updated skinning data.

Usage Example:

>>> exportSkinWeights_Deformer('character_skin.hyperSkin')
# Exports skin weights of the selected meshes to 'character_skin.hyperSkin' file.
Parameters:

  • param fileName:

    <str> #File name for exporting the skin weights. If not specified, the function uses the name of the selected mesh.

Return:

  • None. The function exports the skin weights to a file in a specified library directory.

Note:

  • Ensure that the selected mesh objects have skinning data before attempting to export.

  • The export path is derived from the current scene’s directory, ensuring consistency with the project structure.

graph TB Start[("fa:fa-play Start")] --> SelectMeshes["/fas:fa-mouse-pointer Select Meshes"] SelectMeshes --> CheckSkinning{"/fas:fa-check-circle Check for Skinning"} CheckSkinning --"If Skinned"--> ExportWeights["/fas:fa-save Export Skin Weights"] CheckSkinning --"If Not Skinned"--> Error["/fas:fa-times-circle Display Error"] ExportWeights --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSkinning fill:#99ccff,stroke:#000,stroke-width:2px style ExportWeights fill:#99ff99,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the exportSkinWeights_Deformer function:

  1. The process begins with the user selecting the mesh objects in Maya.

  2. The function checks if the selected meshes are skinned.

  3. If skinned, it proceeds to export the skin weights to the specified file.

  4. If the meshes are not skinned, it displays an error message.

  5. The process completes after exporting the skin weights or displaying the error.

HyperSkin.exportSkinWeights_Sides(self, vtxList=None, filePath=None, fileName=None)#

[shArgs : none]

Purpose:

:: Exports the skin weights for selected vertices or specified sides of a skinned mesh in Autodesk Maya.

  • Allows selective export of skin weights based on the side of the mesh (left, right, or both).

  • Can be used to export skin weights for specific vertices, facilitating focused weight adjustments.

Usage Example:

>>> exportSkinWeights_Sides()
# Exports the skin weights based on the selected vertices or specified side options.
Parameters:

  • vtxList: List of vertices for which the skin weights will be exported. If not provided, selection or side options are used.

  • filePath: The path to save the export file. If not specified, the script uses the scene’s directory.

  • fileName: Name of the export file. Generated based on the mesh name and side options if not provided.

Return:

  • None. The function writes the skin weight data to a specified file.

Note:

  • The function requires a skinned mesh with properly assigned skin weights.

  • The side options (left, right, both) are determined based on the user’s selection in the GUI.

  • If no vertices are selected or provided, the function defaults to exporting weights for the entire mesh.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-search Check Vertex Selection"} CheckSelection --"Vertices Selected"--> ExportSelected["/fas:fa-save Export Selected Vertices"] CheckSelection --"No Selection"--> DetermineSide{"/fas:fa-arrows-alt-h Determine Side (L/R/Both)"} DetermineSide --> ExportSide["/fas:fa-save Export by Side"] ExportSelected --> WriteToFile["/fas:fa-file-code Write to File"] ExportSide --> WriteToFile WriteToFile --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ExportSelected fill:#99ccff,stroke:#000,stroke-width:2px style DetermineSide fill:#99ccff,stroke:#000,stroke-width:2px style ExportSide fill:#cc99ff,stroke:#000,stroke-width:2px style WriteToFile fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the exportSkinWeights_Sides function:

  1. The process begins by checking if vertices are selected.

  2. If vertices are selected, their skin weights are exported.

  3. If no vertices are selected, the function determines which side’s weights to export based on user input.

  4. The skin weights for the chosen side are exported.

  5. The skin weight data is written to a file.

  6. The process completes after the data is saved.

HyperSkin.export_DSCsOrAttrs(self)#

[shArgs : none]

Purpose:

:: Provides an option to export either Discs or Attributes related to a rigging setup in Autodesk Maya.

  • Facilitates the export of either Discs (control shapes) or Attributes, based on user choice.

  • Enhances rigging workflow by allowing easy transfer of rig components or settings between scenes or projects.

Usage Example:

>>> export_DSCsOrAttrs()
# Displays a dialog box to choose between exporting Discs or Attributes.
Parameters:

  • None. The function uses an interactive dialog box to determine the user’s choice.

Return:

  • None. Depending on the user’s choice, it either exports Discs or Attributes.

Note:

  • The function relies on user interaction to determine the export type.

  • It is essential to have the required Discs or Attributes present in the scene for successful export.

graph TB Start[("fa:fa-play Start")] --> UserChoice{"/fas:fa-user-circle User Choice: Discs or Attrs?"} UserChoice --"Choose Discs"--> ExportDSCs["/fas:fa-save Export Discs"] UserChoice --"Choose Attrs"--> ExportAttrs["/fas:fa-save Export Attributes"] ExportDSCs --> End[("fas:fa-stop End")] ExportAttrs --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style UserChoice fill:#ffcc00,stroke:#000,stroke-width:2px style ExportDSCs fill:#99ccff,stroke:#000,stroke-width:2px style ExportAttrs fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the export_DSCsOrAttrs function:

  1. The process begins, presenting the user with a choice to export either Discs or Attributes.

  2. If the user selects “Discs”, the function proceeds to export the Discs related to the rigging setup.

  3. If the user selects “Attributes”, the function exports the specified Attributes.

  4. The process completes once the selected items (Discs or Attributes) are exported.

HyperSkin.export_skin(self, file_path, mesh_list=None)#

[shArgs : none]

Purpose:

:: Exports skin weights from selected meshes to a JSON file, allowing for easy transfer and backup of skinning data in Autodesk Maya.

  • Streamlines the process of saving skin weights from multiple meshes.

  • Useful for backing up skinning information or transferring skinning data between different characters or projects.

  • The export is done in a JSON format for compatibility and ease of use.

Usage Example:

>>> export_skin('C:/path/to/save/skinWeights.json')
# Exports skin weights of selected meshes to the specified JSON file.
Parameters:

  • file_path: The file path where the skin weights JSON file will be saved.

  • mesh_list: Optional. List of mesh objects to export skin weights from. If not provided, it uses the currently selected meshes in Maya.

Return:

  • None. The function writes skin weight data to a JSON file at the specified location.

Note:

  • Ensure that the selected meshes have a skinCluster deformer applied.

  • The function iterates over each vertex of the provided meshes, collecting skin weight data for each joint influence.

graph TB Start[("fa:fa-play Start")] --> IterateMeshes{"/fas:fa-project-diagram Iterate Meshes"} IterateMeshes --> GetSkinCluster["/fas:fa-cogs Get SkinCluster"] GetSkinCluster --> GetWeights["/fas:fa-balance-scale Get Weights per Vertex"] GetWeights --> StoreWeights["/fas:fa-database Store Weights in Dictionary"] StoreWeights --> WriteToFile["/fas:fa-file-export Write to JSON File"] WriteToFile --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style IterateMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style GetSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style GetWeights fill:#cc99ff,stroke:#000,stroke-width:2px style StoreWeights fill:#99ff99,stroke:#000,stroke-width:2px style WriteToFile fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the export_skin function:

  1. The process begins with iterating through the provided list of meshes (or selected meshes if no list is given).

  2. For each mesh, it retrieves the associated skinCluster node.

  3. The skin weights for each vertex influenced by the skinCluster are gathered.

  4. These weights are organized in a dictionary, mapping each vertex to its influencing joints and corresponding weights.

  5. The final step involves writing this dictionary to a JSON file at the specified file path.

  6. The process ends after successfully writing the data to the file.

HyperSkin.export_vtx_skin(self, vertices_list=None, file_path=None, side_vertices=None)#

[shArgs : none]

Purpose:

:: Exports skin weights for selected vertices or for an entire mesh in Autodesk Maya to a specified JSON file.

  • Facilitates the backup or transfer of skinning data for specific vertices or entire meshes.

  • Allows for the option to export skinning data based on side vertices (left or right).

  • Ensures precise skinning data is preserved for complex character rigs or models.

Usage Example:

>>> export_vtx_skin(vertices_list, file_path, side_vertices='left')
# Exports skin weights for vertices on the left side of the mesh to a JSON file.
Parameters:

  • vertices_list: Optional. A list of vertices whose skin weights are to be exported. If not provided, the function will use the current selection.

  • file_path: Optional. The path to save the exported JSON file. If not provided, a file dialog will prompt for the location.

  • side_vertices: Optional. Specify ‘left’ or ‘right’ to filter vertices by their side. Useful for symmetrical models.

Return:

  • None. The function saves the skin weight data to a JSON file at the specified location.

Note:

  • The function requires a mesh with a skin cluster applied.

  • It’s crucial to have the correct vertices selected or specify the vertices_list for successful export.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Selection"} CheckSelection --"Vertices Selected"--> FilterVertices{"/fas:fa-filter Filter Vertices by Side"} FilterVertices --> GetSkinCluster["/fas:fa-user-md Get Skin Cluster"] CheckSelection --"Mesh Selected"--> Error["/fas:fa-exclamation-triangle Error"] Error --> End[("fas:fa-stop End")] GetSkinCluster --> ExportWeights["/fas:fa-save Export Skin Weights"] ExportWeights --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style FilterVertices fill:#99ccff,stroke:#000,stroke-width:2px style GetSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style ExportWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the export_vtx_skin function:

  1. The process begins by checking the selection in Maya.

  2. If vertices are selected, the function filters the vertices by side if specified.

  3. It then retrieves the skin cluster associated with the mesh.

  4. If a mesh is selected without vertices, the function displays an error.

  5. The skin weights for the vertices are exported to a JSON file.

  6. The process completes once the skin weights are successfully exported.

HyperSkin.extractNum(self, objName, fromEnd=True, skipCount=0)#

[**shArgs : on=objName, fe=fromEnd, sc=skipCount]

Purpose:

:: Extracts a number from the end of an object’s name in Maya.

  • Helpful in scripts that need to parse and utilize numerical suffixes in object names for various reasons.

  • Analyzes an object’s name to extract a numerical value, typically used for indexing or identification.

Parameters:
  • objName – <str> # The name of the object from which the number is to be extracted.

  • fromEnd – <bool, optional> # If True, extracts the number from the end of the name. Defaults to True.

  • skipCount – <int, optional> # Number of characters to skip from the end while extracting. Defaults to 0.

Returns:

<list> [int, str] # The extracted number as an integer, and the number as a string.

Usage Examples:

>>> object_name = "cube105"
>>> extracted_number = extractNum(object_name)
# Returns [105, '105'] from 'cube105'.
graph TD Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> ExtractNumbers{"/fas:fa-search Extract Numbers"} ExtractNumbers --> CheckNumbers{"/fas:fa-question-circle Check Numbers"} CheckNumbers --"If Numbers Exist"--> ExtractNumber{"/fas:fa-plus Extract Number"} CheckNumbers --"If Numbers Do Not Exist"--> NoNumber["/fas:fa-stop No Number Found"] ExtractNumber --> End["/fas:fa-stop End"] NoNumber --> 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 ExtractNumbers fill:#ccffcc,stroke:#000,stroke-width:2px style CheckNumbers fill:#ffcc99,stroke:#000,stroke-width:2px style ExtractNumber fill:#cc99ff,stroke:#000,stroke-width:2px style NoNumber fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the extractNum function:

  • Checks if shArgs exist, and if so, parses the on, fe, and sc from it.

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

  • Extracts numbers from the object name.

  • Checks if numbers exist in the object name.

  • If numbers exist, extracts the number and its string representation.

  • If no numbers are found, it terminates with a message.

HyperSkin.generateCurv(self, curvName, deg=3, step=1, objOrPosList=None, showCVs=True)#

[shArgs : none]

Purpose:

:: Creates a NURBS curve in Autodesk Maya from a list of objects or positions, offering flexibility in curve creation for rigging and animation.

  • Constructs a curve using positions extracted from selected objects, vertices, or a provided list of positions.

  • Allows control over the degree of the curve and the step size for position sampling, enabling customization of the curve’s complexity and shape.

  • Useful for creating custom rig controls, path animations, or any scenario where a specific curve shape is needed.

Parameters:
  • curvName – <str> #Name to assign to the created curve.

  • deg – <int> #Degree of the curve, affecting its smoothness and number of control vertices.

  • step – <int> #Step size for sampling positions, controlling the density of the curve points.

  • objOrPosList – <list> #List of objects or positions from which the curve will be generated.

  • showCVs – <bool> #If True, shows the control vertices (CVs) of the curve for editing.

Usage Example:

>>> generateCurv('customCurve', deg=3, step=1, objOrPosList=['pSphere1', 'pSphere2', 'pSphere3'], showCVs=True)
# Creates a NURBS curve named 'customCurve' of degree 3 using positions from the objects 'pSphere1', 'pSphere2', 'pSphere3'.
Note:

  • Ensure the objects or positions provided are valid and exist in the Maya scene before executing this function.

  • The curve degree and step size can significantly impact the final shape and complexity of the curve.

graph TB Start[("fa:fa-play Start")] --> ConfirmInputs["/fas:fa-check-square Confirm Inputs and Settings"] ConfirmInputs --> ExtractPositions["/fas:fa-map-marker-alt Extract Positions from Inputs"] ExtractPositions --> BuildCurveCommand["/fas:fa-pencil-ruler Build Curve Creation Command"] BuildCurveCommand --> ExecuteCurveCommand["/fas:fa-code Execute Curve Creation Command"] ExecuteCurveCommand --> RenameCurve["/fas:fa-i-cursor Rename Created Curve"] RenameCurve --> ShowCVs{"/fas:fa-question-circle Show CVs?"} ShowCVs -- "If True" --> ToggleCVsVisibility["/fas:fa-eye Toggle CVs Visibility"] ShowCVs -- "If False" --> End[("fas:fa-stop End")] ToggleCVsVisibility --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmInputs fill:#99ccff,stroke:#000,stroke-width:2px style ExtractPositions fill:#99ccff,stroke:#000,stroke-width:2px style BuildCurveCommand fill:#99ccff,stroke:#000,stroke-width:2px style ExecuteCurveCommand fill:#99ff99,stroke:#000,stroke-width:2px style RenameCurve fill:#99ff99,stroke:#000,stroke-width:2px style ShowCVs fill:#ffcc00,stroke:#000,stroke-width:2px style ToggleCVsVisibility fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The generateCurv function follows this process:

  1. Starts by confirming the input parameters such as curve name, degree, step size, and the list of objects or positions.

  2. Extracts positions from the provided inputs, forming the basis for the curve’s shape.

  3. Constructs a command string to create the NURBS curve using Maya’s curve command, incorporating the extracted positions.

  4. Executes the curve creation command, generating the curve in the scene.

  5. Renames the created curve to the specified curvName.

  6. Depending on the showCVs parameter, either toggles the visibility of the curve’s control vertices or concludes the process.

HyperSkin.getCVList(self, curv, get_asNodes=0, getEditPoints=0, **shArgs)#

[shArgs : gan=get_asNodes, gep=getEditPoints]

Purpose:

:: Retrieves the control vertex (CV) list from a NURBS curve, mesh, or NURBS surface in Autodesk Maya.

  • This function is versatile, working with different geometry types (curves, meshes, surfaces).

  • Optionally, it can return edit points instead of CVs for curves.

  • Useful for scripts that need to manipulate or query the CVs or edit points of a geometry.

Parameters:
  • curv – <str> #The name of the curve, mesh, or surface from which to retrieve CVs.

  • get_asNodes – <bool, optional> #If True, returns the CVs as node objects. If False, returns them as string names.

  • getEditPoints – <bool, optional> #If True and the input is a curve, returns edit points instead of CVs.

Usage Example:

>>> getCVList('curveShape1', get_asNodes=True, getEditPoints=False)
# Returns a list of CVs as node objects for 'curveShape1'.

Note: - The function adapts based on the input geometry’s type, providing a flexible way to access CVs or edit points. - For curves, you can choose between CVs and edit points, which are different types of control points.

Flow Chart Description:

The flowchart for the getCVList function:

  1. Starts by identifying the type of the input geometry (curve, mesh, surface).

  2. Based on the ‘getEditPoints’ parameter, decides to fetch either CVs or edit points for curves.

  3. Retrieves the list of CVs or edit points based on the geometry type and parameters.

  4. Optionally converts the list to node objects if ‘get_asNodes’ is True.

  5. Returns the list of CVs or edit points.

graph TB Start[("fa:fa-play Start")] --> IdentifyGeometry{"/fas:fa-shapes Identify Geometry Type"} IdentifyGeometry --"If Curve"--> CheckEditPoints{"/fas:fa-pencil-ruler Check 'getEditPoints' Parameter"} IdentifyGeometry --"If Mesh/Surface"--> FetchCVList{"/fas:fa-vector-square Fetch CV List"} CheckEditPoints --"If True"--> GetEditPoints{"/fas:fa-edit Get Edit Points"} CheckEditPoints --"If False"--> GetCVs{"/fas:fa-bezier-curve Get CVs"} GetEditPoints --> ConvertToNodes{"/fas:fa-code-branch Convert to Nodes (if 'get_asNodes')"} GetCVs --> ConvertToNodes FetchCVList --> ConvertToNodes ConvertToNodes --> ReturnList{"/fas:fa-check-circle Return CV/Edit Point List"} ReturnList --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style IdentifyGeometry fill:#ffcc00,stroke:#000,stroke-width:2px style CheckEditPoints fill:#ffcc00,stroke:#000,stroke-width:2px style GetEditPoints fill:#99ccff,stroke:#000,stroke-width:2px style GetCVs fill:#99ccff,stroke:#000,stroke-width:2px style FetchCVList fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToNodes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnList fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px

Returns(hsNodes):

if self.isNodeType('nurbsCurve'):
        return [cvList, numCVs]
elif self.isNodeType('mesh'):
        return [vtxList, numVtx]
elif self.isNodeType('nurbsSurface'):
        return [cvList, numCVs]
HyperSkin.getChild_DSC(self, obj)#

[shArgs : none]

Purpose:

:: Retrieves the child of a specified object in Autodesk Maya, focusing on children connected through a custom ‘dscChd’ attribute.

  • Designed to work with objects that have an implied child connected via the ‘dscChd’ attribute, commonly used in advanced rigging setups.

  • Supports various node types including meshes, curves, locators, joints, and transforms.

  • Useful in rigging scenarios where standard hierarchy relationships are supplemented with custom connections.

Parameters:

obj – <str/PyNode> #Object from which to retrieve the connected child.

Usage Example:

>>> getChild_DSC('controller1')
# Returns the child object of 'controller1' connected via the 'dscChd' attribute, if it exists.
Note:

  • Ensure the object provided has the ‘dscChd’ attribute and it’s properly connected to a child object.

  • The function returns None if no child is connected through the ‘dscChd’ attribute.

graph TB Start[("fa:fa-play Start")] --> ConfirmObject["/fas:fa-check-square Confirm Given Object Exists"] ConfirmObject --> CheckDscChdAttr{"/fas:fa-question-circle Check 'dscChd' Attribute"} CheckDscChdAttr -- "If Exists" --> RetrieveChild["/fas:fa-child Retrieve Connected Child"] CheckDscChdAttr -- "If Not Exists" --> End[("fas:fa-stop End")] RetrieveChild --> ReturnChild[("fas:fa-arrow-right Return Child")] ReturnChild --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmObject fill:#99ccff,stroke:#000,stroke-width:2px style CheckDscChdAttr fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveChild fill:#99ff99,stroke:#000,stroke-width:2px style ReturnChild fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getChild_DSC function executes the following steps:

  1. Initiates by confirming the existence of the given object in the Maya scene.

  2. Checks if the object has the custom ‘dscChd’ attribute, which indicates a special connection to a child object.

  3. If the ‘dscChd’ attribute exists, the function retrieves the connected child object.

  4. Returns the child object, if found, or concludes the process if the attribute does not exist or no child is connected.

HyperSkin.getClosestDist(self, vtxName, geoObj)#

[shArgs : none]

Purpose:

:: Calculates the shortest distance between a given mesh vertex and a geometry object in Autodesk Maya.

  • Ideal for precision tasks in modeling and rigging, where the exact distance between points on different geometries is crucial.

  • Utilizes Maya’s API for efficient computation of the closest point and its distance.

  • Supports both meshes and NURBS surfaces as the target geometry.

Parameters:
  • vtxName – <str/PyNode> #The name or PyNode of the vertex from which the distance is measured.

  • geoObj – <str/PyNode> #The target geometry object to which the closest distance is calculated.

Returns:

<float> #The shortest distance from the specified vertex to the geometry object.

Usage Example:

>>> getClosestDist('pSphere1.vtx[0]', 'pCube1')
# Returns the shortest distance from vertex 0 of pSphere1 to the closest point on pCube1.
Note:

  • The function requires both the vertex and the geometry object to exist in the Maya scene.

  • For Maya versions prior to 2022, the function uses a different method to calculate the closest point and normal.

graph TB Start[("fa:fa-play Start")] --> ConfirmObjects["/fas:fa-check-square Confirm Vertex and Geo Object Exist"] ConfirmObjects --> CalculateClosestPoint["/fas:fa-ruler-combined Calculate Closest Point"] CalculateClosestPoint --> ReturnDistance[("fas:fa-ruler-horizontal Return Distance")] ReturnDistance --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmObjects fill:#99ccff,stroke:#000,stroke-width:2px style CalculateClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style ReturnDistance fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getClosestDist function performs the following steps:

  1. Starts by verifying the existence of the specified vertex and geometry object in the Maya scene.

  2. Calculates the closest point on the geometry object to the given vertex.

  3. Returns the distance between the vertex and this closest point on the geometry object.

  4. Concludes the process by returning the calculated distance.

HyperSkin.getClosestDist_Obj(self, vtxName, meshObj)#

[shArgs : none]

Purpose:

:: Calculates the closest distance from a specified vertex or point to a mesh object in Autodesk Maya.

  • Provides a precise measurement of the shortest distance between a point (or vertex) and a mesh surface.

  • Essential for tasks requiring accuracy in spatial relationships, such as collision detection or dynamic positioning.

Parameters:
  • vtxName – <str> #Name of the vertex or a point in 3D space from which the distance is measured.

  • meshObj – <str> #The mesh object to which the closest distance is calculated.

Usage Example:

>>> getClosestDist_Obj('pSphere1.vtx[5]', 'pCube1')
# Returns the closest distance between the vertex 'pSphere1.vtx[5]' and the mesh object 'pCube1'.

Note: - The function uses Maya’s closestPointOnMesh node for precise calculations. - Suitable for scenarios where minimal distance between geometry elements needs to be evaluated, like in rigging or dynamic simulations.

Flow Chart Description:

The flowchart for the getClosestDist_Obj function:

  1. Starts by creating a closestPointOnMesh node for calculation.

  2. Retrieves the world space position of the input vertex or point.

  3. Connects the mesh object to the closestPointOnMesh node.

  4. Calculates the closest point on the mesh to the input point.

  5. Measures the distance between the input point and the closest point on the mesh.

  6. Deletes the closestPointOnMesh node and returns the measured distance.

graph TB Start[("fa:fa-play Start")] --> CreateNode["/fas:fa-plus-square Create 'closestPointOnMesh' Node"] CreateNode --> RetrievePosition["/fas:fa-map-marker-alt Retrieve Vertex/Point Position"] RetrievePosition --> ConnectMesh["/fas:fa-link Connect Mesh to 'closestPointOnMesh'"] ConnectMesh --> CalculateClosestPoint["/fas:fa-ruler-combined Calculate Closest Point"] CalculateClosestPoint --> MeasureDistance["/fas:fa-tape Measure Distance"] MeasureDistance --> DeleteNode["/fas:fa-trash-alt Delete 'closestPointOnMesh' Node"] DeleteNode --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CreateNode fill:#99ccff,stroke:#000,stroke-width:2px style RetrievePosition fill:#99ccff,stroke:#000,stroke-width:2px style ConnectMesh fill:#99ccff,stroke:#000,stroke-width:2px style CalculateClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style MeasureDistance fill:#99ff99,stroke:#000,stroke-width:2px style DeleteNode fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getClosestPos_Dir(self, posLoc, dirLoc, meshObj, giveLoc=True)#

[shArgs : none]

Purpose:

:: Finds the closest position on a mesh object from a given point, following a specified direction in Autodesk Maya.

  • Essential for determining the intersection point on a mesh along a vector direction.

  • Useful in scenarios where spatial calculations are critical, such as collision detection or aligning objects to mesh surfaces.

Parameters:
  • posLoc – <str/list> #Starting point location, either as an object name or a list of coordinates (x, y, z).

  • dirLoc – <str/list> #Direction point location, defining the vector direction for intersection calculation.

  • meshObj – <str> #The mesh object to check for intersection.

  • giveLoc – <bool> #If True, returns a locator at the closest position; if False, returns coordinates of the closest position.

Usage Example:

>>> getClosestPos_Dir([1, 2, 3], 'directionLocator', 'pMesh', True)
# Finds the closest position on 'pMesh' from [1, 2, 3] towards 'directionLocator', and returns a locator at that position.

>>> getClosestPos_Dir('startLocator', [4, 5, 6], 'pMesh', False)
# Calculates the closest position on 'pMesh' from 'startLocator' towards [4, 5, 6], and returns the coordinates of that position.

Note: - The function uses vector calculations to determine the nearest point on the mesh in the given direction. - Ideal for precision-oriented tasks like snapping objects, ray-mesh intersection checks, and custom rigging tools in Maya.

Flow Chart Description:

The flowchart for the getClosestPos_Dir function:

  1. Starts by converting the starting point and direction point into MPoint objects for precise calculations.

  2. Creates a vector from the start point towards the direction point.

  3. Uses mesh intersection calculations to find the closest point on the specified mesh along the vector.

  4. Depending on the ‘giveLoc’ parameter, returns either a locator at the closest point or the coordinates of the closest point.

graph TB Start[("fa:fa-play Start")] --> ConvertStartPoint["/fas:fa-map-marker-alt Convert Start Point to MPoint"] ConvertStartPoint --> ConvertDirectionPoint["/fas:fa-directions Convert Direction Point to MPoint"] ConvertDirectionPoint --> CreateVector["/fas:fa-arrows-alt Create Direction Vector"] CreateVector --> IntersectMesh["/fas:fa-crosshairs Calculate Intersection with Mesh"] IntersectMesh --"If Intersection Found"--> ReturnClosestPoint{"/fas:fa-location-arrow Return Closest Point"} IntersectMesh --"If No Intersection"--> ReturnNone{"/fas:fa-times-circle Return None"} ReturnClosestPoint --"If giveLoc is True"--> CreateLocator["/fas:fa-map-pin Create Locator at Closest Point"] ReturnClosestPoint --"If giveLoc is False"--> ReturnCoordinates["/fas:fa-map-marker-alt Return Coordinates of Closest Point"] CreateLocator --> End[("fas:fa-stop End")] ReturnCoordinates --> End ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConvertStartPoint fill:#99ccff,stroke:#000,stroke-width:2px style ConvertDirectionPoint fill:#99ccff,stroke:#000,stroke-width:2px style CreateVector fill:#99ccff,stroke:#000,stroke-width:2px style IntersectMesh fill:#99ff99,stroke:#000,stroke-width:2px style ReturnClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style CreateLocator fill:#99ccff,stroke:#000,stroke-width:2px style ReturnCoordinates fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getDupeNode(self, srcNode, dupName, centerPiv=False, grpDupNode=False, grpLevel=1)#

[**shArgs : sn=srcNode, dn=dupName, cp=centerPiv, gdn=grpDupNode, gl=grpLevel]

Purpose:

:: Creates a duplicate of a given Maya node with optional center pivot and group duplication features.

  • Useful in scenarios where duplicates of nodes are required with specific configurations like pivot centering or grouping.

  • Allows customization of the duplication process, catering to various rigging and scene setup needs.

Parameters:
  • srcNode – <str> # The source node that is to be duplicated.

  • dupName – <str> # The name for the duplicate node.

  • centerPiv – <bool, optional> # Specifies whether to center the pivot on the duplicate node. Defaults to False.

  • grpDupNode – <bool, optional> # Determines if the duplicated node should be grouped. Defaults to False.

  • grpLevel – <int, optional> # Defines the group level for the duplicated node. Defaults to 1.

Returns:

<asNode or list> # The duplicated node with the specified configurations, optionally within a group.

Usage:

>>> getDupeNode("pCube1", "pCube1_dup", True, True, 2)
# Creates a duplicate of 'pCube1', centers its pivot, groups it, and names the duplicate 'pCube1_dup'.
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectSourceNode fill:#ffcc00,stroke:#000,stroke-width:2px style DuplicateNode fill:#ff9999,stroke:#000,stroke-width:2px style CenterPivot fill:#99ccff,stroke:#000,stroke-width:2px style GroupDuplicateNode fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> SelectSourceNode{"/fas:fa-mouse-pointer Select Source Node"} SelectSourceNode --> DuplicateNode["/fas:fa-copy Duplicate Node"] DuplicateNode --> CenterPivot{"/fas:fa-bullseye Center Pivot"} CenterPivot --> GroupDuplicateNode{"/fas:fa-object-group Group Duplicate Node"} GroupDuplicateNode --> End["/fas:fa-stop End"]
Flow Chart Description:

This flowchart illustrates the getDupeNode function:

  1. Starts the process by selecting the source node specified in the arguments.

  2. Duplicates the selected source node to create a new node with the specified name.

  3. Checks if the centerPiv flag is set to True.

  4. If centerPiv is True, centers the pivot on the duplicated node.

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

  6. If grpDupNode is True, groups the duplicated node and assigns a group level.

  7. The function concludes successfully.

HyperSkin.getFaceList(self, objName, sidePos=None, mirrAxis='x')#

[shArgs: n=objectName, sp=sidePos, ma=mirrAxis]

Purpose:

Generates a list of face indices for a specified object, with options for side position and mirror axis.

Parameters:
  • objectName – (<str>) # Name of the object to get faces from.

  • sidePos – (<str, optional>) # Position of the faces (’L_’ or ‘R_’).

  • mirrAxis – (<str, default: ‘x’>) # The axis used for mirroring, if applicable.

Returns:

(<list>) # A list of face indices based on the specified criteria.

Code Examples:

>>> face_indices = getFaceList(objName='myObject', sidePos='L_', mirrAxis='x')
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveObject fill:#ff9999,stroke:#000,stroke-width:2px style CheckSidePos fill:#99ccff,stroke:#000,stroke-width:2px style IterateFaces fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMirrorAxis fill:#99ff99,stroke:#000,stroke-width:2px style SelectSideFaces fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFaceList fill:#99ff99,stroke:#000,stroke-width:2px style ReturnSideFaces fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> RetrieveObject["/fas:fa-search-plus Retrieve Object"] CheckShArgs --"If shArgs not provided"--> RetrieveObject RetrieveObject --> CheckSidePos{"/fas:fa-code-branch Check Side Position"} CheckSidePos --"If sidePos is provided"--> IterateFaces["/fas:fa-sync-alt Iterate Faces"] CheckSidePos --"If sidePos is not provided"--> IterateFaces IterateFaces --> CheckMirrorAxis{"/fas:fa-arrows-alt-h Check Mirror Axis"} CheckMirrorAxis --"Determine faces based on axis"--> SelectSideFaces["/fas:fa-filter Select Side Faces"] SelectSideFaces --> ReturnSideFaces["/fas:fa-check-circle Return Side Faces"] CheckMirrorAxis --"No mirroring, all faces"--> ReturnFaceList["/fas:fa-check-circle Return Face List"] ReturnFaceList --> End[("fas:fa-stop End")] ReturnSideFaces --> End
Flow Chart Description:

This flowchart illustrates the getFaceList function:

  1. The process starts by checking if shArgs are provided to update parameters.

  2. Retrieves the object based on the provided objName.

  3. Checks if a side position is specified.

  4. Iterates through the faces of the object.

  5. Checks the mirror axis to determine face selection.

  6. If side position is provided, selects faces based on the mirror axis.

  7. Returns the list of faces based on side position or all faces if no side position is specified.

HyperSkin.getInfluenceID(self, infJnt, skinClust)#

[shArgs : ij=infJnt, sc=skinClust]

Purpose:

:: Determines the influence ID of a specified joint within a skin cluster. This function is essential for identifying joint indices in skin weighting and rigging tasks in Autodesk Maya.

Parameters:
  • infJnt – (<str>) #Name of the influence joint whose ID needs to be found in the skin cluster.

  • skinClust – (<str>) #Name of the skinCluster node connected to the geometry.

Returns:

<list> #A list containing the influence ID and the skin cluster matrix attribute of the joint.

Usage Example:

>>> influence_data = getInfluenceID('L_Hip_Bendy04_BindJnt', 'bodylow_GEO_1_SC')
>>> print(influence_data)
# This will display the influence ID and matrix attribute of the joint 'L_Hip_Bendy04_BindJnt' in the skin cluster 'bodylow_GEO_1_SC'.
Flow Chart Description:

The getInfluenceID function performs the following operations:

  1. Extracts the worldMatrix connections for the given joint.

  2. Searches for the matrix attribute related to the specified skin cluster.

  3. Splits the matrix attribute string to extract the influence ID.

  4. Returns the influence ID and the corresponding matrix attribute.

graph TB Start[("fa:fa-play Start")] --> ExtractConnections["/fas:fa-plug Extract WorldMatrix Connections"] ExtractConnections --> SearchSkinCluster["/fas:fa-search-plus Search For Skin Cluster Matrix Attribute"] SearchSkinCluster --> ExtractInfluenceID["/fas:fa-code-branch Extract Influence ID"] ExtractInfluenceID --> ReturnData["/fas:fa-check Return Influence ID and Matrix Attribute"] ReturnData --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ExtractConnections fill:#99ccff,stroke:#000,stroke-width:2px style SearchSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style ExtractInfluenceID fill:#99ccff,stroke:#000,stroke-width:2px style ReturnData fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getInfluenceJoint(self, skinClust, influenceId)#

[shArgs : sc=skinClust, iid=influenceId]

Purpose:

:: Retrieves the joint influencing a skin cluster at a specified influence index, crucial for managing skinning in character rigging and animation in Autodesk Maya.

Parameters:
  • skinClust – (<str>) #Name of the skinCluster node associated with the skinned geometry.

  • influenceId – (<int>) #The index of the influence (joint) in the skin cluster.

Returns:

<str> #The name of the joint that corresponds to the given influence ID in the skin cluster.

Usage Example:

>>> joint_name = getInfluenceJoint('skinCluster1', 2)
>>> print(joint_name)
# This will print the name of the joint at index 2 in the skin cluster 'skinCluster1'.
Flow Chart Description:

The getInfluenceJoint function executes the following steps:

  1. Retrieves the skin cluster node.

  2. Obtains the list of joints influencing the skin cluster.

  3. Returns the joint corresponding to the specified influence index.

graph TB Start[("fa:fa-play Start")] --> RetrieveSkinCluster["/fas:fa-sitemap Retrieve Skin Cluster Node"] RetrieveSkinCluster --> GetJointsList["/fas:fa-list Get Joints Influencing the Skin Cluster"] GetJointsList --> ReturnJoint["/fas:fa-check Return Joint at Influence ID"] ReturnJoint --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style GetJointsList fill:#99ccff,stroke:#000,stroke-width:2px style ReturnJoint fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getJntFromDisc(self)#

[shArgs : none]

Purpose:

:: Retrieves the joint associated with a specified disc in Autodesk Maya, used for skinning or other rigging purposes.

  • Tailored for use in scenarios where mesh discs are linked to joints for rigging, especially in skinning setups.

  • Facilitates quick selection of either the joint or the corresponding disc based on the current selection.

  • Enhances rigging workflows by streamlining the process of switching between mesh discs and their associated joints.

Usage Example:

>>> getJntFromDisc()
# If a mesh disc is selected, the corresponding joint is selected. If a joint is selected, the associated mesh disc is selected.
Note:

  • The function expects the naming convention of the mesh discs to follow a specific pattern, typically including a suffix related to the skinCluster number.

graph TB Start[("fa:fa-play Start")] --> ConfirmSkinMesh["/fas:fa-check-square Confirm Skin Mesh and Cluster"] ConfirmSkinMesh --> DetermineObjectType{"/fas:fa-question-circle Determine Object Type"} DetermineObjectType -- "If Mesh" --> RetrieveJoint["/fas:fa-link Retrieve Associated Joint"] DetermineObjectType -- "If Joint" --> RetrieveDisc["/fas:fa-cog Retrieve Corresponding Disc"] RetrieveJoint --> SelectJoint[("fas:fa-hand-pointer Select Joint")] RetrieveDisc --> SelectDisc[("fas:fa-hand-pointer Select Disc")] SelectJoint --> End[("fas:fa-stop End")] SelectDisc --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmSkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style DetermineObjectType fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveJoint fill:#99ff99,stroke:#000,stroke-width:2px style RetrieveDisc fill:#99ff99,stroke:#000,stroke-width:2px style SelectJoint fill:#99ff99,stroke:#000,stroke-width:2px style SelectDisc fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getJntFromDisc function executes the following steps:

  1. Starts by confirming the existence of a skin mesh and its corresponding skinCluster in the Maya scene.

  2. Determines the type of the selected object (either mesh or joint).

  3. If a mesh disc is selected, the function retrieves the joint associated with that disc.

  4. If a joint is selected, the function retrieves the corresponding mesh disc.

  5. Selects the retrieved joint or disc in the Maya scene, facilitating further actions or modifications.

HyperSkin.getJntNum_fromEnd(self, jnt, jntCount=0, is_hsNode=0)#

[shArgs : none]

Purpose:

:: Determines the number of joints from the specified joint to the end of the joint hierarchy in Autodesk Maya.

  • Useful for rigging and skinning tasks where joint hierarchy depth needs to be determined.

  • Allows for a better understanding of joint chain lengths, aiding in the setup of IK/FK systems or procedural rigging.

Parameters:
  • jnt – (<str/PyNode>) #The starting joint from which to count towards the end of the joint hierarchy.

  • jntCount – (<int>, optional) #Initial joint count, usually set to 0. Used internally for recursion.

  • is_hsNode – (<bool>, optional) #Flag indicating if the joint is already converted to an hsNode. Defaults to False.

Usage Example:

>>> joint_count = getJntNum_fromEnd('L_Arm_Jnt')
# Returns the number of joints from 'L_Arm_Jnt' to the end of its joint hierarchy.
Flow Chart Description:

The getJntNum_fromEnd function follows these steps:

  1. Check if the input joint is the last joint in the hierarchy.

  2. If not the last joint, traverse to the next joint and increment the joint count.

  3. Repeat until the last joint is reached.

  4. Return the total count of joints from the specified joint to the end of the hierarchy.

graph LR Start[("fa:fa-play Start")] --> CheckIsLastJoint{"/fas:fa-question-circle Check If Last Joint"} CheckIsLastJoint --"Not Last Joint"--> TraverseNextJoint["/fas:fa-arrow-right Traverse to Next Joint"] TraverseNextJoint --> IncrementCount["/fas:fa-plus-circle Increment Joint Count"] IncrementCount --> CheckIsLastJoint CheckIsLastJoint --"Last Joint"--> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckIsLastJoint fill:#ffcc00,stroke:#000,stroke-width:2px style TraverseNextJoint fill:#99ccff,stroke:#000,stroke-width:2px style IncrementCount fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

Integer. Number of joints from the specified joint to the end of the joint hierarchy.

HyperSkin.getLongestObj(self, src, objList, objType='obj')#

[shArgs : s=src, ol=objList, ot=objType]

Purpose:

:: Identifies the longest object in a list based on a specified type.

  • Useful in scenarios where spatial relationships between objects are critical, such as in scene layout or rigging.

  • Helps in selecting the farthest object relative to a specified source, which can be crucial in various modeling and animation tasks.

Parameters:
  • src – <str> # The source object for comparison.

  • objList – <list> # A list of objects to compare against the source.

  • objType – <str, optional> # The type of objects being compared (objects/components). Default is ‘obj’.

Returns:

<str> # The name of the longest object from the provided list.

Code Examples:

>>> source_object = "central_obj"
>>> comparison_objects = ["obj1", "obj2", "obj3"]
>>> object_type = "obj"
>>> longest_object = getLongestObj(source_object, comparison_objects, object_type)
graph TB style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style DistanceDict fill:#00ccff,stroke:#000,stroke-width:2px style Loop fill:#00cc00,stroke:#000,stroke-width:2px style CalculateDistance fill:#00cc00,stroke:#000,stroke-width:2px style SelectLongestObject fill:#00cc00,stroke:#000,stroke-width:2px style ReturnResult fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px CheckShArgs --"If shArgs Exist"--> DistanceDict{"/fas:fa-cogs Check Arguments"} CheckShArgs --"If shArgs Does Not Exist"--> DistanceDict DistanceDict --"Initialize Distance Dictionary"--> Loop{"/fas:fa-loop Loop Over Object List"} Loop --"Iterate Over Object List"--> CalculateDistance{"/fas:fa-calculator Calculate Distance"} CalculateDistance --"Calculate Distance"--> SelectLongestObject{"/fas:fa-arrows-alt-h Select Longest Object"} SelectLongestObject --"Select Longest Object"--> ReturnResult{"/fas:fa-check Return Result"} ReturnResult --"Return Result"--> End
Flow Chart Description:

This flowchart illustrates the getLongestObj function:

  1. Starts the process by checking if shArgs exist.

  2. If shArgs exist, it proceeds to initialize the distance dictionary.

  3. If shArgs do not exist, it defaults to initializing the distance dictionary.

  4. It then loops over the object list, calculating distances.

  5. During the loop, it selects the longest object(s) based on the specified objType.

  6. The function returns the result.

HyperSkin.getMBBox(self, bbObj)#

[shArgs : none]

Purpose:

:: Obtains the bounding box of a specified Maya object using the MFnDagNode function set.

  • Useful for calculations involving the spatial dimensions or position of objects in a scene.

  • Can be used in rigging, modeling, and animation to determine the size and position of objects.

Parameters:

bbObj – <str> #Name of the Maya object for which the bounding box is needed.

Usage Example:

>>> getMBBox('pCube1')
# Returns the bounding box object for 'pCube1'.

Note: - Bounding boxes are essential in 3D graphics for collision detection, visibility testing, and spatial queries. - This function provides an API-level approach to access bounding box information, which is more efficient than using standard Maya commands.

Flow Chart Description:

The flowchart for the getMBBox function:

  1. Begins by retrieving the MDagPath of the specified object.

  2. Initializes an MFnDagNode function set.

  3. Sets the object’s MDagPath to the MFnDagNode.

  4. Obtains the object’s bounding box using the MFnDagNode function set.

  5. Returns the bounding box.

graph TB Start[("fa:fa-play Start")] --> RetrieveMDagPath["/fas:fa-arrow-right Retrieve MDagPath"] RetrieveMDagPath --> InitMFnDagNode["/fas:fa-cubes Initialize MFnDagNode"] InitMFnDagNode --> SetObject["/fas:fa-arrow-circle-right Set Object to MFnDagNode"] SetObject --> GetBoundingBox["/fas:fa-vector-square Get Bounding Box"] GetBoundingBox --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveMDagPath fill:#99ccff,stroke:#000,stroke-width:2px style InitMFnDagNode fill:#99ccff,stroke:#000,stroke-width:2px style SetObject fill:#99ccff,stroke:#000,stroke-width:2px style GetBoundingBox fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getMPathDg(self, obj)#

[shArgs : none]

Purpose:

:: Retrieves the MDagPath object for a given node in Autodesk Maya, which represents the node’s path in the DAG (Directed Acyclic Graph).

  • Essential for operations requiring node manipulation or querying at the DAG level.

  • Facilitates access to node transformations, shapes, and hierarchy relationships.

Parameters:

obj – <str> #Name of the Maya node for which the MDagPath is required.

Usage Example:

>>> getMPathDg('pSphere1')
# Returns the MDagPath object for the node 'pSphere1'.

Note: - MDagPath is a fundamental concept in Maya’s API, representing the path to a node in the DAG. - Useful in scenarios requiring low-level access to nodes, like in custom rigging tools or complex scene queries.

Flow Chart Description:

The flowchart for the getMPathDg function:

  1. Starts by selecting the given node in Maya.

  2. Initializes an MSelectionList and MDagPath objects.

  3. Populates the MSelectionList with the active selection.

  4. Retrieves the MDagPath from the MSelectionList for the specified node.

  5. Returns the MDagPath object.

graph TB Start[("fa:fa-play Start")] --> SelectNode["/fas:fa-mouse-pointer Select Node"] SelectNode --> InitObjects["/fas:fa-cubes Initialize MSelectionList and MDagPath"] InitObjects --> PopulateSelectionList["/fas:fa-list-ol Populate MSelectionList"] PopulateSelectionList --> RetrieveMDagPath["/fas:fa-arrow-right Retrieve MDagPath"] RetrieveMDagPath --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectNode fill:#99ccff,stroke:#000,stroke-width:2px style InitObjects fill:#99ccff,stroke:#000,stroke-width:2px style PopulateSelectionList fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveMDagPath fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getMPoint(self, objOrPos)#

[shArgs : none]

Purpose:

:: Converts a given object or position into an MPoint object in Autodesk Maya.

  • Facilitates the conversion of an object’s position or a specified coordinate into an MPoint for further operations.

  • Essential for operations that require MPoint data types, like advanced calculations or API operations.

Parameters:

objOrPos – <str/list> #Either the name of an object or a list of coordinates (x, y, z).

Usage Example:

>>> getMPoint('pCube1')
# Converts the position of 'pCube1' into an MPoint object.

>>> getMPoint([1.0, 2.0, 3.0])
# Converts the coordinates [1.0, 2.0, 3.0] into an MPoint object.

Note: - Useful in scenarios where precise 3D point manipulation is required, especially in custom tools or advanced scripts. - Enhances the flexibility and accuracy of scripts dealing with spatial calculations in Maya.

Flow Chart Description:

The flowchart for the getMPoint function:

  1. Starts by checking the type of the input (object name or coordinate list).

  2. If the input is an object name, retrieves the object’s world position.

  3. If the input is a list of coordinates, uses these values directly.

  4. Converts the obtained position into an MPoint object.

  5. Returns the MPoint object representing the specified position.

graph TB Start[("fa:fa-play Start")] --> CheckInputType{"/fas:fa-question-circle Check Input Type"} CheckInputType --"If Object Name"--> RetrieveObjectPosition["/fas:fa-arrows-alt Retrieve Object Position"] CheckInputType --"If Coordinate List"--> UseGivenCoordinates["/fas:fa-map-marker-alt Use Given Coordinates"] RetrieveObjectPosition --> ConvertToMPoint["/fas:fa-exchange-alt Convert Position to MPoint"] UseGivenCoordinates --> ConvertToMPoint ConvertToMPoint --> ReturnMPoint{"/fas:fa-check-circle Return MPoint Object"} ReturnMPoint --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckInputType fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveObjectPosition fill:#99ccff,stroke:#000,stroke-width:2px style UseGivenCoordinates fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToMPoint fill:#99ff99,stroke:#000,stroke-width:2px style ReturnMPoint fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getMeshFn(self, obj)#

[**shArgs : m=mesh]

Purpose:

:: Generates an MFnMesh function set for a specified polygon mesh in Maya.

  • Essential for advanced manipulation and analysis of polygon mesh geometry.

  • Provides access to numerous mesh-related operations and attributes.

Parameters:

mesh – <str> # The name of the mesh to generate the MFnMesh function set for.

Returns:

<MFnMesh> # An MFnMesh function set corresponding to the specified mesh.

Usage:

>>> meshFn = getMeshFn('pCubeShape1')
# Creates an MFnMesh function set for 'pCubeShape1'.
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMeshType fill:#ff9999,stroke:#000,stroke-width:2px style GetMeshPath fill:#99ccff,stroke:#000,stroke-width:2px style CreateMFnMesh fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> CheckMeshType["/fas:fa-check-square Check Mesh Type"] CheckShArgs --"If shArgs not provided"--> CheckMeshType CheckMeshType --"If mesh is transform"--> GetMeshPath["/fas:fa-sitemap Get Mesh Path"] CheckMeshType --"If mesh is shape"--> CreateMFnMesh["/fas:fa-cogs Create MFnMesh"] GetMeshPath --> CreateMFnMesh CreateMFnMesh --> End[("fas:fa-stop End")]
Flow Chart Description:

This flowchart illustrates the getMeshFn function:

  1. The process begins by checking if shArgs are provided, updating mesh accordingly.

  2. It then checks if the provided mesh is a transform or a shape.

  3. If mesh is a transform, it retrieves the shape node.

  4. The function then gets the DAG path of the mesh.

  5. Using the DAG path, it creates an MFnMesh function set.

  6. The function concludes by returning the MFnMesh function set.

HyperSkin.getMeshVtx(self, meshObj, sidePos=None, mirrAxis='x', includeMidVtx=True)#

[shArgs : none]

Purpose:

:: Retrieves vertices of a mesh object in Autodesk Maya based on specified criteria like side position and mirroring axis.

  • Useful for scripts that need to manipulate or query specific vertices of a mesh based on their spatial position.

  • Can handle both individual mesh objects and lists of vertices.

  • Offers options for mirrored selection and inclusion of midline vertices.

Parameters:
  • meshObj – <str/list> #The mesh object or a list of vertices from which to retrieve vertices.

  • sidePos – <str, optional> #The side of the mesh to select vertices from (’L_’ for left, ‘R_’ for right).

  • mirrAxis – <str, optional> #The axis along which to mirror the selection (‘x’, ‘y’, ‘z’).

  • includeMidVtx – <bool, optional> #Whether to include vertices along the midline of the mesh in the selection.

Usage Example:

>>> getMeshVtx('pCube1', sidePos='L_', mirrAxis='x', includeMidVtx=True)
# Returns a list of vertices on the left side of 'pCube1' including midline vertices.

Note: - If ‘sidePos’ is not specified, the function returns all vertices of the mesh object. - The mirroring axis determines which vertices are considered for left or right side selection. - The ‘includeMidVtx’ parameter decides whether vertices exactly on the mirroring axis should be included.

Flow Chart Description:

The flowchart for the getMeshVtx function:

  1. Begins by identifying the type of the input (single mesh object or list of vertices).

  2. If the input is a single mesh object, it retrieves all vertices of that mesh.

  3. If ‘sidePos’ is specified, it filters vertices based on their position relative to the specified mirroring axis.

  4. The function considers the ‘includeMidVtx’ parameter to include or exclude midline vertices in the selection.

  5. Returns a list of vertices based on the specified criteria.

graph TB Start[("fa:fa-play Start")] --> IdentifyInputType{"/fas:fa-question-circle Identify Input Type"} IdentifyInputType --"If Single Mesh Object"--> RetrieveAllVertices{"/fas:fa-vector-square Retrieve All Vertices"} IdentifyInputType --"If List of Vertices"--> ProcessVertexList{"/fas:fa-list-ol Process Vertex List"} RetrieveAllVertices --> CheckSidePos{"/fas:fa-arrows-alt Check 'sidePos' Parameter"} ProcessVertexList --> CheckSidePos CheckSidePos --"If Specified"--> FilterVertices{"/fas:fa-filter Filter Vertices"} CheckSidePos --"If Not Specified"--> ReturnAllVertices{"/fas:fa-check-circle Return All Vertices"} FilterVertices --> IncludeMidVtxCheck{"/fas:fa-check-double Include Midline Vertices Check"} IncludeMidVtxCheck --> ReturnFilteredVertices{"/fas:fa-check-circle Return Filtered Vertices"} ReturnAllVertices --> End[("fas:fa-stop End")] ReturnFilteredVertices --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style IdentifyInputType fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveAllVertices fill:#99ccff,stroke:#000,stroke-width:2px style ProcessVertexList fill:#99ccff,stroke:#000,stroke-width:2px style CheckSidePos fill:#ffcc00,stroke:#000,stroke-width:2px style FilterVertices fill:#99ccff,stroke:#000,stroke-width:2px style IncludeMidVtxCheck fill:#99ccff,stroke:#000,stroke-width:2px style ReturnAllVertices fill:#99ff99,stroke:#000,stroke-width:2px style ReturnFilteredVertices fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getMeshVtx_Overlap(self, outerMesh, innerMesh, checkType='in', inMeshDir='L_', outMeshDir='L_', outTolerance=None)#

[shArgs : none]

Purpose:

:: Finds overlapping vertices between two mesh objects based on specified criteria in Autodesk Maya.

  • Capable of identifying vertices of one mesh that overlap with another mesh, considering their relative positioning and direction.

  • Offers flexibility in defining which mesh’s overlapping vertices to retrieve and allows setting a tolerance for the overlap detection.

Parameters:
  • outerMesh – <str> #The name of the outer mesh object in the overlap check.

  • innerMesh – <str> #The name of the inner mesh object in the overlap check.

  • checkType – <str> #Determines which mesh’s overlapping vertices are returned (‘in’ for innerMesh, ‘out’ for outerMesh).

  • inMeshDir – <str> #Direction (left or right) to consider for the inner mesh vertices.

  • outMeshDir – <str> #Direction (left or right) to consider for the outer mesh vertices.

  • outTolerance – <float/None> #Tolerance level for considering vertices as overlapping in the ‘out’ check type.

Usage Example:

>>> getMeshVtx_Overlap('pantMesh', 'shoeMesh', 'in', 'L_', 'L_', None)
# Returns the vertices of 'shoeMesh' that overlap with 'pantMesh' considering left side vertices.

Args:

outerMesh = mesh placed outer side with respect to innerMesh [For Ex: part of pant on top of shoe]
innerMesh = mesh placed inside with respect to outerMesh [For Ex: part of shoe inside the pant]
checkType = 'in' or 'In' | 'out' or 'Out'
                        ['in' --> innerMesh vertices (overlapped) will be returned]
                        ['out' --> outerMesh vertices (overlapped) will be returned]
innerMeshDir = 'L_' | 'R_' | None
outerMeshDir = 'L_' | 'R_' | None
outTolerance = None | any number

Note: - Useful in scenarios like cloth simulation or collision detection where mesh interactions are critical. - The function enhances rigging and modeling workflows by allowing precise control over mesh overlap detection.

Flow Chart Description:

The flowchart for the getMeshVtx_Overlap function:

  1. Starts by determining the check type (‘in’ or ‘out’) to decide which mesh’s overlapping vertices to find.

  2. Retrieves vertices from the specified mesh and direction (inner or outer mesh, left or right side).

  3. Iterates over the vertices to check if they overlap with the other mesh using the hasMeshContainsPoint function.

  4. If the ‘out’ check type is used, considers the specified tolerance for overlap detection.

  5. Collects and returns the overlapping vertices as a list.

  6. If no overlapping vertices are found, returns None.

graph TB Start[("fa:fa-play Start")] --> DetermineCheckType{"/fas:fa-question-circle Determine Check Type"} DetermineCheckType --"In Check"--> RetrieveInnerVertices["/fas:fa-object-group Retrieve Inner Mesh Vertices"] DetermineCheckType --"Out Check"--> RetrieveOuterVertices["/fas:fa-object-group Retrieve Outer Mesh Vertices"] RetrieveInnerVertices --> CheckOverlapInner{"/fas:fa-search-location Check Overlap for Inner Vertices"} RetrieveOuterVertices --> CheckOverlapOuter{"/fas:fa-search-location Check Overlap for Outer Vertices"} CheckOverlapInner --> CollectInnerVertices["/fas:fa-layer-group Collect Overlapping Inner Vertices"] CheckOverlapOuter --> CollectOuterVertices["/fas:fa-layer-group Collect Overlapping Outer Vertices"] CollectInnerVertices --> ReturnResult{"/fas:fa-thumbs-up-down Return Result"} CollectOuterVertices --> ReturnResult ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineCheckType fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveInnerVertices fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveOuterVertices fill:#99ccff,stroke:#000,stroke-width:2px style CheckOverlapInner fill:#99ccff,stroke:#000,stroke-width:2px style CheckOverlapOuter fill:#99ccff,stroke:#000,stroke-width:2px style CollectInnerVertices fill:#99ff99,stroke:#000,stroke-width:2px style CollectOuterVertices fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getNearestCurv(self, vtx, curvList)#

[shArgs : none]

Purpose:

:: Finds the nearest curve to a specified vertex from a given list of curves in Autodesk Maya.

  • Tailored for rigging, deformation, and procedural modeling tasks where proximity to curve objects is crucial.

  • Efficiently computes the closest point on each curve in the list to the provided vertex, identifying the nearest curve.

  • Beneficial in scenarios like creating curve-driven deformations or nearest point-based constraints.

Parameters:
  • vtx – <PyNode> #The vertex for which the nearest curve is to be determined.

  • curvList – <list> #A list of curve objects to check against the specified vertex.

Returns:

<PyNode> #The curve object closest to the provided vertex.

Usage Example:

>>> closest_curve = getNearestCurv('pCube1.vtx[10]', [curve1, curve2])
# Determines the curve closest to vertex 10 of 'pCube1' from a list containing 'curve1' and 'curve2'.
Note:

  • Ensure the vertex and a list of curves are correctly specified for the function to execute effectively.

  • This function is especially useful in rigging setups involving curves, such as spline IK handles or custom rig controls.

graph TB Start[("fa:fa-play Start")] --> RetrieveVertex["/fas:fa-location-arrow Retrieve Vertex Position"] RetrieveVertex --> CalculateDistances{"/fas:fa-ruler-combined Calculate Distances to Curves"} CalculateDistances --"For Each Curve"--> ComputeClosestPoint["/fas:fa-map-pin Compute Closest Point on Curve"] ComputeClosestPoint --> StoreDistance["/fas:fa-save Store Distance Value"] StoreDistance --> EvaluateDistances["/fas:fa-balance-scale Evaluate Shortest Distance"] EvaluateDistances --> ReturnClosestCurve["/fas:fa-thumbs-up Return Closest Curve"] ReturnClosestCurve --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveVertex fill:#99ccff,stroke:#000,stroke-width:2px style CalculateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ComputeClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style StoreDistance fill:#99ff99,stroke:#000,stroke-width:2px style EvaluateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnClosestCurve fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getNearestCurv function operates as follows:

  1. Starts by retrieving the position of the given vertex.

  2. Iterates through each curve in the provided list, computing the distance between the vertex and the curve.

  3. For each curve, it calculates the closest point to the vertex and records the corresponding distance.

  4. Compares all recorded distances to identify the shortest one.

  5. Returns the curve that is closest to the specified vertex based on the shortest distance calculated.

  6. Completes its operation by providing the nearest curve as the result.

HyperSkin.getNearestGeo(self, vtx, geoList, manageJunk=True)#

[shArgs : none]

Purpose:

:: Determines the nearest geometry to a specified vertex from a list of geometries in Autodesk Maya.

  • This function is essential in applications where proximity between a vertex and various geometries is crucial, such as rigging and modeling.

  • It calculates and compares the distances between the vertex and each geometry in the list, identifying the closest one.

  • Useful in scenarios like vertex weighting, collision detection, and nearest point-based dynamics.

Parameters:
  • vtx – <PyNode> #The vertex for which the nearest geometry is to be identified.

  • geoList – <list> #A list of geometry objects to compare against the provided vertex.

  • manageJunk – <bool> #Option to manage cleanup of temporary data and handle undo operations.

Returns:

<PyNode> #The geometry object nearest to the specified vertex.

Usage Example:

>>> closest_geometry = getNearestGeo('pCube1.vtx[10]', [geo1, geo2, geo3], manageJunk=True)
# Determines the closest geometry object to vertex 10 of 'pCube1' from a list containing 'geo1', 'geo2', and 'geo3'.
Note:

  • The function requires a vertex and a list of geometries for proximity comparison.

  • The manageJunk parameter allows for handling memory and undo operations efficiently.

graph TB Start[("fa:fa-play Start")] --> RetrieveVertex["/fas:fa-location-arrow Retrieve Vertex Position"] RetrieveVertex --> CalculateDistances{"/fas:fa-ruler-combined Calculate Distances to Geometries"} CalculateDistances --"For Each Geometry"--> ComputeClosestPoint["/fas:fa-map-pin Compute Closest Point on Geometry"] ComputeClosestPoint --> StoreDistance["/fas:fa-save Store Distance Value"] StoreDistance --> EvaluateDistances["/fas:fa-balance-scale Evaluate Shortest Distance"] EvaluateDistances --> ReturnClosestGeometry["/fas:fa-thumbs-up Return Closest Geometry"] ReturnClosestGeometry --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveVertex fill:#99ccff,stroke:#000,stroke-width:2px style CalculateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ComputeClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style StoreDistance fill:#99ff99,stroke:#000,stroke-width:2px style EvaluateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnClosestGeometry fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getNearestGeo function operates as follows:

  1. Starts by obtaining the position of the specified vertex.

  2. Iteratively calculates the distance to each geometry in the provided list, determining the closest point on each geometry.

  3. Records the distance to the closest point for each geometry.

  4. Compares all distances to identify the shortest one.

  5. Returns the geometry object that is closest to the vertex, as determined by the shortest distance.

  6. Concludes the process by outputting the nearest geometry to the specified vertex.

HyperSkin.getNearestGeo02(self, vtx, geoList, manageJunk=False)#

[shArgs : none]

Purpose:

:: Identifies the nearest geometry object to a specified vertex from a list of geometry objects in Autodesk Maya.

  • Essential for tasks involving proximity calculations between vertices and various geometry objects.

  • Efficiently identifies the closest geometry to the specified vertex, optimizing rigging and modeling workflows.

  • Useful in scenarios like creating proximity-based deformations or nearest point-based dynamics.

Parameters:
  • vtx – <PyNode> #The vertex for which the nearest geometry object is to be determined.

  • geoList – <list> #A list of geometry objects to compare against the specified vertex.

  • manageJunk – <bool> #Optionally manages the cleanup of temporary data generated during the process.

Returns:

<PyNode> #The geometry object closest to the provided vertex.

Usage Example:

>>> closest_geometry = getNearestGeo02('pCube1.vtx[10]', [geo1, geo2, geo3], manageJunk=True)
# Finds the nearest geometry object to vertex 10 of 'pCube1' from a list containing 'geo1', 'geo2', and 'geo3'.
Note:

  • The function requires a vertex and a list of geometry objects to perform the proximity calculations.

  • The manageJunk parameter can be used to handle additional memory management and undo operations.

graph TB Start[("fa:fa-play Start")] --> RetrieveVertex["/fas:fa-location-arrow Retrieve Vertex Position"] RetrieveVertex --> CalculateDistances{"/fas:fa-ruler-combined Calculate Distances to Geometries"} CalculateDistances --"For Each Geometry"--> ComputeClosestPoint["/fas:fa-map-pin Compute Closest Point on Geometry"] ComputeClosestPoint --> StoreDistance["/fas:fa-save Store Distance Value"] StoreDistance --> EvaluateDistances["/fas:fa-balance-scale Evaluate Shortest Distance"] EvaluateDistances --> ReturnClosestGeometry["/fas:fa-thumbs-up Return Closest Geometry"] ReturnClosestGeometry --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveVertex fill:#99ccff,stroke:#000,stroke-width:2px style CalculateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ComputeClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style StoreDistance fill:#99ff99,stroke:#000,stroke-width:2px style EvaluateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnClosestGeometry fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getNearestGeo02 function operates as follows:

  1. Begins by retrieving the position of the specified vertex.

  2. Iterates through each geometry object in the provided list, computing the distance between the vertex and the geometry.

  3. For each geometry object, it calculates the closest point to the vertex and records the corresponding distance.

  4. Compares all recorded distances to find the shortest one.

  5. Returns the geometry object that is closest to the specified vertex based on the shortest distance.

  6. Concludes its operation by providing the nearest geometry as the result.

HyperSkin.getNearestGeoList02(self, vtx, geoList, numGeos=1)#

To Get Nearest Geos from given geometries From Vtx Using om2

Args:

vtx (str): The vertex (in the format 'pCube1.vtx[0]') from which to find the nearest geometries.
geoList (list): List of geometries as strings or MObjects.
numGeos (int): Number of nearest geometries to return in order [nearestOne, next1, next2, etc].

Returns:

tuple: Tuple containing two lists:
    1) List of nearest geometry names.
    2) List of nearest geometry MObjects.

.. mermaid::

        graph TB
                Start[("fa:fa-play Start")] --> GetVtxPoint[("fas:fa-location-arrow Get Vertex Point")]
                GetVtxPoint --> CalculateDistances[("fas:fa-ruler-combined Calculate Distances")]
                CalculateDistances --> SortGeometries[("fas:fa-sort-amount-up Sort Geometries")]
                SortGeometries --> GetNearestGeos[("fas:fa-object-group Get Nearest Geos")]
                GetNearestGeos --> ReturnResults[("fas:fa-check Return Results")]
                ReturnResults --> End[("fas:fa-stop End")]

                style Start fill:#00cc00,stroke:#000,stroke-width:3px
                style GetVtxPoint fill:#99ccff,stroke:#000,stroke-width:2px
                style CalculateDistances fill:#99ccff,stroke:#000,stroke-width:2px
                style SortGeometries fill:#99ccff,stroke:#000,stroke-width:2px
                style GetNearestGeos fill:#99ccff,stroke:#000,stroke-width:2px
                style ReturnResults fill:#99ccff,stroke:#000,stroke-width:2px
                style End fill:#ff6666,stroke:#000,stroke-width:3px

:Flow Chart Description:
        The **getNearestGeoList02** function flowchart illustrates the following process:

        1. The function starts by getting the world position of the specified vertex.
        2. It then calculates the distances between this vertex and the pivot points of each geometry in the provided list.
        3. The geometries are sorted based on their distances from the vertex.
        4. The function retrieves the specified number of nearest geometries.
        5. It returns a tuple with two lists: one of the nearest geometry names, and one of their corresponding MObjects.
HyperSkin.getNearestGeo_(self, vtx, geoList)#
HyperSkin.getNearestGeo_orig(self, vtx, geoList)#

[shArgs : none]

Purpose:

:: Determines the closest geometry object to a given vertex from a list of geometries in Autodesk Maya.

  • Essential for tasks like skinning, rigging, or collision detection, where proximity between vertices and other objects plays a critical role.

  • Utilizes Maya’s API for precise calculation of the nearest point on each geometry in the list to the specified vertex.

  • Enhances efficiency in workflows requiring frequent checks for spatial relationships between mesh components.

Parameters:
  • vtx – <PyNode> #The vertex for which the nearest geometry is to be found.

  • geoList – <list> #A list of geometry objects (meshes or curves) to be considered for proximity checking.

Returns:

<PyNode> #The geometry object closest to the specified vertex.

Usage Example:

>>> closest_geo = getNearestGeo_orig('pCube1.vtx[5]', [pCube2, pSphere1])
# Finds the closest geometry object to vertex 5 of 'pCube1' from a list containing 'pCube2' and 'pSphere1'.
Note:

  • The function requires a vertex and a list of geometries to operate. Ensure these inputs are correctly provided for accurate results.

  • The function is versatile and can be used with various types of geometry, such as meshes or curves.

graph TB Start[("fa:fa-play Start")] --> RetrieveVertex["/fas:fa-location-arrow Retrieve Vertex"] RetrieveVertex --> CalculateDistances{"/fas:fa-ruler-combined Calculate Distances to Geometries"} CalculateDistances --"For Each Geometry"--> ComputeClosestPoint["/fas:fa-map-pin Compute Closest Point on Geometry"] ComputeClosestPoint --> StoreDistance["/fas:fa-save Store Distance Value"] StoreDistance --> EvaluateDistances["/fas:fa-balance-scale Evaluate Shortest Distance"] EvaluateDistances --> ReturnClosestGeometry["/fas:fa-thumbs-up Return Closest Geometry"] ReturnClosestGeometry --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveVertex fill:#99ccff,stroke:#000,stroke-width:2px style CalculateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ComputeClosestPoint fill:#99ff99,stroke:#000,stroke-width:2px style StoreDistance fill:#99ff99,stroke:#000,stroke-width:2px style EvaluateDistances fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnClosestGeometry fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getNearestGeo_orig function follows these steps:

  1. Starts by retrieving the specified vertex and its position.

  2. Iterates through the given list of geometries, calculating the distance to the vertex for each geometry.

  3. Computes the closest point on each geometry to the vertex and stores the distance value.

  4. Evaluates all stored distances to determine the shortest distance.

  5. Returns the geometry object that is closest to the specified vertex.

  6. Completes the process by providing the closest geometry as the output.

HyperSkin.getNearestObj(self, srcObj, destList, srcType='obj', destType='obj', nearCount=1)#

[shArgs : None]

Purpose:

:: The getNearestObj function calculates and returns the nearest object(s) from a source object to a list of destination objects. :: This function can be particularly useful in 3D environments like Autodesk Maya for proximity-based operations.

  • Line 1, The function takes five parameters: the source object (srcObj), a list of destination objects (destList),

    and optional parameters to specify the type of the source (srcType) and destination (destType) objects, as well as the number of nearest objects to find (nearCount).

  • Line 2, A dictionary (distanceDict) is created to hold the distance between the source object and each destination object.

Parameters:
  • srcObj – <str> #The source object from which to calculate distances.

  • destList – <list> #A list of destination objects to compare distances to.

  • srcType – <str, optional> #The type of the source object (default is ‘obj’).

  • destType – <str, optional> #The type of the destination objects (default is ‘obj’).

  • nearCount – <int, optional> #The number of nearest objects to find (default is 1).

Returns:

<str/list> #Returns the nearest object (or objects, if nearCount > 1) from the source to the destination list.

Code Examples:

>>> srcObject = "cube1"
>>> destObjects = ["sphere1", "cone1", "cylinder1"]
>>> nearestObject = getNearestObj(srcObject, destObjects)
# This will return the nearest object to "cube1" from the list of destination objects.
>>> nearestObjects = getNearestObj(srcObject, destObjects, nearCount=2)
# This will return the two nearest objects to "cube1" from the list of destination objects.
graph TB Start[("fa:fa-play Start")] --> GetDistances[("fas:fa-ruler-vertical Calculate Distances")] GetDistances --> SortDistances[("fas:fa-sort-amount-up Sort Distances")] SortDistances --> DetermineResults[("fas:fa-list-ol Determine Nearest Object(s)")] DetermineResults --> SelectObjects[("fas:fa-hand-pointer Select Nearest Object(s)")] SelectObjects --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetDistances fill:#99ccff,stroke:#000,stroke-width:2px style SortDistances fill:#99ccff,stroke:#000,stroke-width:2px style DetermineResults fill:#99ccff,stroke:#000,stroke-width:2px style SelectObjects fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getNearestObj function flowchart illustrates the following process:

  1. The function starts by calculating the distance between the source object and each destination object in the provided list.

  2. It then sorts these objects based on their calculated distances in ascending order.

  3. The function determines the nearest object(s) based on the ‘nearCount’ parameter.

  4. It selects the nearest object(s) in the Maya scene (if applicable).

  5. The process ends by returning the nearest object(s) as per the specified count.

HyperSkin.getPos(self, objList, objType='obj')#

[**shArgs : ol=objList, ot=objType]

Purpose:

:: Obtains the position of one or more Maya objects, with an option for object type specification.

  • Ideal for scripts requiring positional data of objects.

  • Supports various object types, enhancing versatility in usage.

Parameters:
  • objList – <list/str> # List or name of Maya objects to retrieve positions for.

  • objType – <str> # The type of objects for position retrieval, like ‘obj’, ‘vtx’, ‘edg’, etc. Defaults to ‘obj’.

Returns:

<list of lists> # A list containing the position vectors of the specified objects. For Ex: [[0, 2, 1]] or [[0, 2, 1], [1, 0, 1], ..] etc >> get single pos with : eRig.getPos(obj)[0]

Usage:

>>> positions = getPos(['pCube1', 'pSphere1'])
# Retrieves the positions of 'pCube1' and 'pSphere1' as a list.
graph TB style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckObjType fill:#99ccff,stroke:#000,stroke-width:2px style LoopObjects fill:#cc99ff,stroke:#000,stroke-width:2px style GetPosition fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px CheckShArgs --"If shArgs Exist"--> CheckObjType{"/fas:fa-cogs Check Object Type"} CheckShArgs --"If shArgs Does Not Exist"--> CheckObjType CheckObjType --"Determine Object Type"--> LoopObjects{"/fas:fa-list Loop Objects"} LoopObjects --"Loop Through Objects"--> GetPosition{"/fas:fa-cogs Get Position"} GetPosition --"Get Position"--> LoopObjects LoopObjects --"Repeat for Each Object"--> End["/fas:fa-stop End"]
Flow Chart Description:

This flowchart illustrates the getPos function:

  1. Starts the process by checking if shArgs exist.

  2. If shArgs exist, it proceeds to check the specified object type.

  3. If shArgs do not exist, it defaults to ‘obj’ as the object type.

  4. Loops through the provided list of objects.

  5. Gets the position of each object based on the specified object type.

  6. Repeats this process for each object in the list.

HyperSkin.getRootJnt_FromJntsList(self, jntList=None)#

[shArgs : None]

Purpose:

:: The getRootJnt_FromJntsList function identifies the root joint in a hierarchy of joints. :: This function is particularly useful in 3D animation and rigging in Autodesk Maya for identifying the base joint of a skeletal structure.

  • Lines 1-3, The function accepts a list of joints (jntList). If no list is provided, it defaults to selecting the currently selected joints in the scene.

  • Lines 5-12, Iteratively determines the root joint. It checks each joint in the list to see if it is a parent of the subsequent joint. The joint that is a parent to the most others is considered the root.

  • Lines 14-19, Verifies if the identified root joint is indeed a parent of all other joints in the list. If any joint is not a child of the root, it sets the flag ‘noRoot’ to True.

Parameters:

jntList – <list, optional> #A list of joint names. If None, defaults to the currently selected joints.

Returns:

<str/None> #Returns the name of the root joint if found, or None if no common root exists.

Code Examples:

>>> joints = ["spine1_jnt", "spine2_jnt", "neck_jnt", "head_jnt"]
>>> rootJoint = getRootJnt_FromJntsList(joints)
# This will return the root joint from the provided list of joints.

>>> rootJoint = getRootJnt_FromJntsList()
# This will return the root joint from the currently selected joints in Maya.
graph TB Start[("fa:fa-play Start")] --> CheckJoints[("fas:fa-check-circle Check Joints")] CheckJoints --"If no jntList provided" --> SelectJoints[("fas:fa-hand-pointer Select Joints")] CheckJoints --"If jntList is provided" --> DetermineRootJnt[("fas:fa-code-branch Determine Root Joint")] SelectJoints --> DetermineRootJnt DetermineRootJnt --> VerifyRootJnt[("fas:fa-search-plus Verify Root Joint")] VerifyRootJnt --"Root joint found" --> End[("fas:fa-stop End")] VerifyRootJnt --"No common root joint" --> ReturnNone[("fas:fa-ban Return None")] ReturnNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckJoints fill:#99ccff,stroke:#000,stroke-width:2px style SelectJoints fill:#99ccff,stroke:#000,stroke-width:2px style DetermineRootJnt fill:#99ccff,stroke:#000,stroke-width:2px style VerifyRootJnt fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getRootJnt_FromJntsList function flowchart illustrates the following process:

  1. The function starts by checking if a list of joints is provided.

  2. If no list is provided, it selects the currently active joints in the scene.

  3. It then determines the root joint by checking the parent-child relationships among the joints.

  4. The function verifies if the identified joint is indeed the root of all provided joints.

  5. If a common root joint is found, it is returned; otherwise, the function returns None.

HyperSkin.getRot(self, objList)#

[**shArgs : ol=objList]

Purpose:

:: Retrieves the rotation values of specified Maya objects.

  • Useful for scripts requiring rotational data of objects.

  • Provides rotation values in a convenient list format.

Parameters:

objList – <list> # A list of Maya objects whose rotation values are to be obtained.

Returns:

<list> # A list containing the rotation values of the specified objects.

Usage:

>>> rotations = getRot(['pCube1', 'pSphere1'])
# Retrieves the rotation values of 'pCube1' and 'pSphere1'.
graph TB style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style LoopObjects fill:#cc99ff,stroke:#000,stroke-width:2px style GetRotation fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px CheckShArgs --"If shArgs Exist"--> LoopObjects{"/fas:fa-cogs Check Arguments"} CheckShArgs --"If shArgs Does Not Exist"--> LoopObjects LoopObjects --"Loop Through Object List"--> GetRotation{"/fas:fa-sync-alt Get Rotation"} GetRotation --"Get Rotation Values for Each Object"--> LoopObjects LoopObjects --"Repeat for Each Object"--> End["/fas:fa-stop End"]
Flow Chart Description:

This flowchart illustrates the getRot function:

  1. Starts the process by checking if shArgs exist.

  2. If shArgs exist, it proceeds to loop through the object list.

  3. If shArgs do not exist, it defaults to retrieving rotation values for each object.

  4. Loops through the object list.

  5. Gets the rotation values for each object using getAttr(obj + ‘.r’).

  6. Repeats this process for each object in the list.

HyperSkin.getSkinJnts(self, skinMesh, allInfs=False)#

[shArgs : none]

Purpose:

:: Retrieves the joint influences from the skin cluster of a specified mesh in Autodesk Maya.

  • Essential for skinning workflows, allowing for extraction and manipulation of skinning data.

  • Can return either all influencing joints or only the weighted influences.

Parameters:
  • skinMesh – <str> #The name of the skinned mesh whose skinCluster influences are to be retrieved.

  • allInfs – <bool, optional> #If True, returns all joints influencing the skinCluster. If False, returns only joints with actual weight influence.

Usage Example:

>>> getSkinJnts(skinMesh='characterMesh', allInfs=False)
# Returns a list of joints that have weight influence on 'characterMesh'.

Note: - Ensure the skinMesh is skinned with a skinCluster before using this function. - The function is handy for rigging scripts and tools that need to interact with skinCluster data.

Flow Chart Description:

The flowchart for the getSkinJnts function:

  1. Starts by identifying the skinCluster associated with the specified skinMesh.

  2. Checks if the skinCluster exists on the given mesh.

  3. Based on the ‘allInfs’ parameter, decides to fetch either all influencing joints or only weighted ones.

  4. Retrieves the appropriate list of joints from the skinCluster.

  5. Returns the list of influencing joints.

graph TB Start[("fa:fa-play Start")] --> IdentifySkinCluster{"/fas:fa-search-plus Identify Skin Cluster"} IdentifySkinCluster --"If Found"--> CheckAllInfs{"/fas:fa-list-ul Check 'allInfs' Parameter"} IdentifySkinCluster --"If Not Found"--> Error{"/fas:fa-times-circle Error: No Skin Cluster"} CheckAllInfs --"If True"--> GetAllInfluences{"/fas:fa-users Get All Influences"} CheckAllInfs --"If False"--> GetWeightedInfluences{"/fas:fa-weight-hanging Get Weighted Influences"} GetAllInfluences --> ReturnJoints{"/fas:fa-check-circle Return Joint List"} GetWeightedInfluences --> ReturnJoints ReturnJoints --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style IdentifySkinCluster fill:#ffcc00,stroke:#000,stroke-width:2px style CheckAllInfs fill:#ffcc00,stroke:#000,stroke-width:2px style GetAllInfluences fill:#99ccff,stroke:#000,stroke-width:2px style GetWeightedInfluences fill:#99ccff,stroke:#000,stroke-width:2px style ReturnJoints fill:#99ff99,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getSkinJntsList(self, vtxList)#

[shArgs : none]

Purpose:

:: The ‘getSkinJntsList’ function in Autodesk Maya is designed to retrieve a list of joints influencing a given set of mesh vertices, specifically within a skinning context.

  • This function is particularly useful in character rigging and skinning processes, allowing for targeted influence and weight adjustments on specific vertices.

  • It enhances the precision in skin weight painting by identifying the exact joints affecting selected vertices.

Parameters:

vtxList – <list> #A list of vertices for which the influencing joints are to be determined.

Returns:

<list> #A list of joints that have significant influence (more than 50% weight) on the provided vertices.

Usage Example:

>>> getSkinJntsList(['pCube1.vtx[0]', 'pCube1.vtx[1]'])
# This command returns a list of joints influencing the vertices 'pCube1.vtx[0]' and 'pCube1.vtx[1]'.
Note:

  • Essential for refining skinning and weight distribution on animated characters.

  • Offers a focused approach to manipulating vertex weights, reducing the time and effort required for weight adjustments.

  • Enhances the animator’s control over the deformation of mesh during animation, leading to more realistic and nuanced character movements.

graph TD Start[("fa:fa-play Start")] --> GetSkinCluster{Get Skin Cluster} GetSkinCluster --> RetrieveJoints{Retrieve Influencing Joints} RetrieveJoints --> EvaluateInfluence{Evaluate Joint Influence} EvaluateInfluence --> FinalList{Compile Final Joint List} FinalList --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetSkinCluster fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveJoints fill:#99ccff,stroke:#000,stroke-width:2px style EvaluateInfluence fill:#99ccff,stroke:#000,stroke-width:2px style FinalList fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The getSkinJntsList function follows this process:

  1. The function starts and immediately retrieves the skin cluster associated with the given vertex list.

  2. It then retrieves the list of joints associated with the skin cluster.

  3. The function evaluates each joint’s influence on the provided vertices.

  4. Based on the evaluation, a final list of influencing joints is compiled.

  5. The function concludes by returning the list of significant influencing joints.

HyperSkin.getSkinWeights(self, vtxMesh, vtxName, skinClust, get_hsNodes=False)#

[shArgs : vm=vtxMesh, vn=vtxName, sc=skinClust, ghn=get_hsNodes]

Purpose:

:: The function getSkinWeights is designed for Autodesk Maya to retrieve skin weight values of a specific vertex on a skinned mesh. It’s essential for tasks like weight painting, rigging, and animation, where precise control over vertex skinning is required.

  • Line 1, Additional Description as needed by sphinx HTML doc, if any

  • Line 2, Additional Description as needed by sphinx HTML doc, if any

Parameters:
  • vtxMesh – (<str>) #Name of the mesh that contains the vertex.

  • vtxName – (<str>) #Name of the vertex whose skin weights are to be retrieved.

  • skinClust – (<str>) #Name of the skinCluster node associated with the skinned mesh.

  • get_hsNodes – (<bool, optional>) #Determines whether to return hsNode objects or string names of influencing joints. Default is False.

Returns:

<dict> #A dictionary mapping influencing joints to their corresponding skin weight values for the specified vertex.

Usage Example:

>>> skin_weights = getSkinWeights('body_geo', 'body_geo.vtx[5317]', 'skinCluster1')
>>> print(skin_weights)
# This will print the skin weights of the specified vertex.
Flow Chart Description:

The getSkinWeights function executes the following steps:

  1. Checks if there are valid skin weight values for the specified vertex.

  2. If not, selects the vertex and returns None.

  3. If valid, retrieves the indices of influencing joints with non-zero weights.

  4. Creates a dictionary mapping influencing joints to their corresponding skin weight values.

  5. Returns the dictionary with skin weight values.

graph TD Start[("fa:fa-play Start")] --> CheckWeights{Check Skin Weights} CheckWeights -- None --> SelectVertex[Select Vertex] SelectVertex --> ReturnNone[Return None] CheckWeights -- Valid --> RetrieveIndices[Retrieve Indices of Influencing Joints] RetrieveIndices --> CreateMap[Create Skin Weights Dictionary] CreateMap --> ReturnDictionary[Return Dictionary] ReturnNone --> End[("fas:fa-stop End")] ReturnDictionary --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckWeights fill:#ffcc66,stroke:#000,stroke-width:2px style SelectVertex fill:#99ccff,stroke:#000,stroke-width:2px style ReturnNone fill:#ff6666,stroke:#000,stroke-width:3px style RetrieveIndices fill:#99ccff,stroke:#000,stroke-width:2px style CreateMap fill:#99ccff,stroke:#000,stroke-width:2px style ReturnDictionary fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.getSolvedJntsNGCMs(self, skinJntList, nonSknEndJnts, gcmSuffix=None)#

[shArgs : none]

Purpose:

:: Identifies and organizes solved joints and their corresponding Geometry Constraint Managers (GCMs) in Autodesk Maya.

  • Primarily used in rigging setups where certain joints are designated as ‘solved’ based on specific criteria, such as having a child locator ending with ‘_Solve’.

  • Compiles lists of solved joints, their upstream joint hierarchy, and associated GCMs, facilitating easier management and access during rigging or animation processes.

  • Useful in complex rigging systems, especially for characters with intricate mechanics like fingers or mechanical parts.

Usage Example:

>>> solved_joints_data = getSolvedJntsNGCMs(skinJntList, nonSknEndJnts, gcmSuffix='GCM')
# Returns lists of solved joints, their upstream joints, associated GCMs, and additional data structures for further processing.
Parameters:

  • None. This function operates based on the current rig setup in Maya, utilizing joints and specific naming conventions.

Return:

  • A tuple containing multiple lists and dictionaries:
    • All solved end vertex sets

    • All upstream line GCMs for solved joints

    • All upstream line joints for solved joints

    • Dictionary mapping end vertex sets to their corresponding end joints

    • Dictionary mapping end joints to their upstream joint hierarchy

Note:

  • The function relies on a specific naming convention where a child locator of a joint ends with ‘_Solve’ to designate that joint as solved.

  • It is essential for GCMs (if used) to follow a consistent naming convention, typically the joint name followed by a specified suffix (e.g., ‘GCM’).

  • This function is part of a larger rigging system and may require context from the surrounding setup for optimal use.

graph TB Start[("fa:fa-play Start")] --> IdentifySolvedJoints{"/fas:fa-search Identify Solved Joints"} IdentifySolvedJoints --> CollectEndVtxSets["/fas:fa-layer-group Collect End Vertex Sets"] CollectEndVtxSets --> CompileUpstreamJoints["/fas:fa-code-branch Compile Upstream Joint Hierarchy"] CompileUpstreamJoints --> CheckGCMs{"/fas:fa-check-circle Check for GCMs"} CheckGCMs -- "GCMs Present" --> AppendGCMs["/fas:fa-plus Append GCMs to List"] CheckGCMs -- "No GCMs" --> SkipGCMs["/fas:fa-times Skip GCMs"] AppendGCMs --> CreateDataStructures["/fas:fa-database Create Data Structures"] SkipGCMs --> CreateDataStructures CreateDataStructures --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style IdentifySolvedJoints fill:#ffcc00,stroke:#000,stroke-width:2px style CollectEndVtxSets fill:#99ccff,stroke:#000,stroke-width:2px style CompileUpstreamJoints fill:#99ccff,stroke:#000,stroke-width:2px style CheckGCMs fill:#ffcc00,stroke:#000,stroke-width:2px style AppendGCMs fill:#99ff99,stroke:#000,stroke-width:2px style SkipGCMs fill:#ff6666,stroke:#000,stroke-width:2px style CreateDataStructures fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the getSolvedJntsNGCMs function demonstrates:

  1. The process starts by identifying joints designated as ‘solved’ based on their child locators ending with ‘_Solve’.

  2. The function then collects vertex sets associated with these solved joints.

  3. It compiles the upstream joint hierarchy for each solved joint.

  4. The function checks if Geometry Constraint Managers (GCMs) are associated with the joints.

  5. If GCMs are present, they are appended to the list; otherwise, GCM processing is skipped.

  6. Finally, the function creates and returns data structures containing all relevant information about solved joints, their upstream hierarchy, and GCMs (if applicable).

HyperSkin.getVisVolume(self)#

[shArgs : none]

Purpose:

:: Creates a lattice to visualize the volume of selected objects in Autodesk Maya.

  • This function is useful for rigging and animation to quickly assess the spatial volume of objects.

  • Enhances rigging and animation workflows by allowing a clear view of object extents.

Usage Example:

>>> getVisVolume()
# Creates and applies a lattice to selected objects for visualizing their volume.
Flow Chart Description:

The getVisVolume function follows these steps:

  1. Create a lattice with specific divisions around the selected objects.

  2. Delete the base lattice node.

  3. Enable color override on the lattice shape.

  4. Set a specific color (yellow) to the lattice for better visibility.

  5. Rename the lattice for easier identification.

graph TB Start[("fa:fa-play Start")] --> CreateLattice["/fas:fa-cube Create Lattice"] CreateLattice --> DeleteBaseNode["/fas:fa-trash-alt Delete Base Node"] DeleteBaseNode --> EnableColorOverride["/fas:fa-palette Enable Color Override"] EnableColorOverride --> SetLatticeColor["/fas:fa-tint Set Lattice Color"] SetLatticeColor --> RenameLattice["/fas:fa-i-cursor Rename Lattice"] RenameLattice --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CreateLattice fill:#99ccff,stroke:#000,stroke-width:2px style DeleteBaseNode fill:#99ccff,stroke:#000,stroke-width:2px style EnableColorOverride fill:#99ccff,stroke:#000,stroke-width:2px style SetLatticeColor fill:#cc99ff,stroke:#000,stroke-width:2px style RenameLattice fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

None. The function creates a lattice to visualize the volume of selected objects but does not return any value.

HyperSkin.getVtxList(self, objName)#

[shArgs: n=objName]

Function:: getVtxList

Purpose:

:: Retrieves a list of vertices for the specified object, depending on its node type.

Parameters:

objName – (<type str>) # The name of the object for which vertices are to be retrieved.

Returns:

A list of vertices (cvList or vtxList), depending on the node type (nurbsCurve, mesh, or nurbsSurface).

Returns(asNodes):

if self.isNodeType('nurbsCurve'):
        return cvList
elif self.isNodeType('mesh'):
        return vtxList
elif self.isNodeType('nurbsSurface'):
        return cvList
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveObject fill:#ff9999,stroke:#000,stroke-width:2px style CheckNodeType fill:#99ccff,stroke:#000,stroke-width:2px style GetNurbsCurveCVs fill:#cc99ff,stroke:#000,stroke-width:2px style GetMeshVertices fill:#99ff99,stroke:#000,stroke-width:2px style GetNurbsSurfaceCVs fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnCVList fill:#99ff99,stroke:#000,stroke-width:2px style ReturnVtxList fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> RetrieveObject["/fas:fa-search-plus Retrieve Object"] CheckShArgs --"If shArgs not provided"--> RetrieveObject RetrieveObject --> CheckNodeType{"/fas:fa-code-branch Check Node Type"} CheckNodeType --"If NurbsCurve"--> GetNurbsCurveCVs["/fas:fa-bezier-curve Get NurbsCurve CVs"] CheckNodeType --"If Mesh"--> GetMeshVertices["/fas:fa-th Get Mesh Vertices"] CheckNodeType --"If NurbsSurface"--> GetNurbsSurfaceCVs["/fas:fa-vector-square Get NurbsSurface CVs"] GetNurbsCurveCVs --> ReturnCVList["/fas:fa-check-circle Return CV List"] GetMeshVertices --> ReturnVtxList["/fas:fa-check-circle Return Vertex List"] GetNurbsSurfaceCVs --> ReturnCVList ReturnCVList --> End[("fas:fa-stop End")] ReturnVtxList --> End
Flow Chart Description:

This flowchart illustrates the getVtxList function:

  1. The process starts by checking if shArgs are provided to update the objName parameter.

  2. The object is retrieved based on the provided objName.

  3. The node type of the object is checked.

  4. If the object is a NurbsCurve, it retrieves the Curve CVs.

  5. If the object is a Mesh, it retrieves the Mesh vertices.

  6. If the object is a NurbsSurface, it retrieves the Surface CVs.

  7. Depending on the node type, the function returns either the CV list or the vertex list.

HyperSkin.getWeightsData(self, skinClust, dataType=1)#

[shArgs : sc=skinClust, dt=dataType]

Purpose:

:: Extracts either joint names with their respective IDs or vertex weights from a skin cluster in Autodesk Maya. This function is vital for skin weight analysis and transfer operations in character rigging.

Parameters:
  • skinClust – (<str>) #Name of the skinCluster node connected to the geometry.

  • dataType – (<int>, optional) #Determines the type of data to retrieve. ‘1’ returns a dictionary mapping joint names to their IDs, while ‘2’ returns vertex weight data. Default is ‘1’.

Returns:

<dict> #A dictionary containing either joint names with IDs or vertex weight data, depending on the dataType parameter.

Usage Example:

>>> weights_data = getWeightsData('skinCluster1', dataType=1)
>>> print(weights_data)
# This will display the mapping of joint names to their IDs in the skin cluster 'skinCluster1'.
Flow Chart Description:

The getWeightsData function performs the following operations:

  1. Accesses the MFnSkinCluster and MDagPath for the given skin cluster.

  2. Constructs a dictionary mapping influence IDs to joint names or vertices to their weights.

  3. Iterates over vertices (if dataType=2) and extracts weight data for each influence.

  4. Returns the constructed dictionary with the requested data.

graph TB Start[("fa:fa-play Start")] --> AccessSkinCluster["/fas:fa-sitemap Access MFnSkinCluster"] AccessSkinCluster --> ConstructDictionary["/fas:fa-table Construct Data Dictionary"] ConstructDictionary --> IterateVertices["/fas:fa-sync-alt Iterate Over Vertices (If dataType=2)"] IterateVertices --> ExtractWeights["/fas:fa-balance-scale Extract Weights per Influence"] ExtractWeights --> ReturnData["/fas:fa-check Return Data Dictionary"] ReturnData --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style AccessSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style ConstructDictionary fill:#99ccff,stroke:#000,stroke-width:2px style IterateVertices fill:#99ccff,stroke:#000,stroke-width:2px style ExtractWeights fill:#99ccff,stroke:#000,stroke-width:2px style ReturnData fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
if dataType ==1:

{jointName : jointID}

elif dataType ==2: {vtx1_ID{joint1_IDweightVal, joint2_IDweightVal}, vtx2_ID{joint1_IDweightVal, joint2_IDweightVal}}
{

0: {23: 1.0}, 1: {23: 1.0}, 2: {23: 1.0} }

HyperSkin.get_2PosExtn(self, sel01, sel02, ratioAmount, locName='Extn_Loc', getLoc=True)#

[shArgs : none]

Purpose:

:: Calculates the extended position between two objects in Autodesk Maya, based on a specified ratio.

  • Useful for rigging and animation, where extending a vector to a specific ratio is required.

  • Allows for dynamic adjustment of position based on the relative location of two objects.

Parameters:
  • sel01 – <str> #The first object or position to start the vector calculation.

  • sel02 – <str> #The second object or position where the vector calculation ends.

  • ratioAmount – <float> #The ratio by which the vector is extended beyond sel02.

  • locName – <str> #The name for the locator to be created at the extended position.

  • getLoc – <bool> #Whether to return a locator at the extended position or just the coordinates.

Usage Example:

>>> get_2PosExtn('pCube1', 'pSphere1', 0.5)
# Extends the vector from 'pCube1' to 'pSphere1' by 50% and returns a locator at that position.

Note: - The function assumes that both sel01 and sel02 exist in the Maya scene. - The extension is calculated in the direction from sel01 to sel02. - The ratioAmount determines how far beyond sel02 the extended position will be.

Flow Chart Description:

The flowchart for the get_2PosExtn function:

  1. The process begins by creating joints at the positions of sel01 and sel02.

  2. Calculates the vector between sel01 and sel02.

  3. Extends this vector by the specified ratioAmount.

  4. Creates a locator (or returns coordinates) at the extended position.

  5. Returns the locator or the extended position based on getLoc.

graph TB Start[("fa:fa-play Start")] --> CreateJoints["/fas:fa-bone Create Joints at sel01 & sel02"] CreateJoints --> CalculateVector["/fas:fa-ruler-combined Calculate Vector"] CalculateVector --> ExtendVector["/fas:fa-expand-arrows-alt Extend Vector by Ratio"] ExtendVector --> CreateLocator["/fas:fa-map-pin Create Locator at Extended Position"] CreateLocator --> ReturnResult["/fas:fa-arrow-right Return Locator/Position"] ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CreateJoints fill:#99ccff,stroke:#000,stroke-width:2px style CalculateVector fill:#99ccff,stroke:#000,stroke-width:2px style ExtendVector fill:#99ff99,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.get_2PosVect(self, srcObj, destObj)#

[shArgs : none]

Purpose:

:: Calculates the vector from one object to another in Autodesk Maya, based on their world space positions.

  • Essential for rigging and animation tasks where directional relationships between objects are important.

  • Can be used to determine direction and distance between two points in 3D space.

Parameters:
  • srcObj – <str> #The source object from which the vector calculation starts.

  • destObj – <str> #The destination object to which the vector is calculated.

Usage Example:

>>> get_2PosVect('pCube1', 'pSphere1')
# Calculates the vector from 'pCube1' to 'pSphere1'.

Note: - The function assumes that both source and destination objects exist in the Maya scene. - Returns an MVector representing the direction and magnitude of the vector from srcObj to destObj.

Flow Chart Description:

The flowchart for the get_2PosVect function:

  1. The process begins by obtaining the world space positions of the srcObj and destObj.

  2. Calculates the difference in x, y, and z coordinates between the two objects.

  3. Constructs an MVector representing the direction and distance from srcObj to destObj.

  4. Returns the MVector as the result.

graph TB Start[("fa:fa-play Start")] --> GetSrcPos["/fas:fa-map-pin Get Source Position"] GetSrcPos --> GetDestPos["/fas:fa-map-pin Get Destination Position"] GetDestPos --> CalculateVector["/fas:fa-ruler-combined Calculate Vector"] CalculateVector --> ReturnVector["/fas:fa-arrow-right Return Vector"] ReturnVector --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetSrcPos fill:#99ccff,stroke:#000,stroke-width:2px style GetDestPos fill:#99ccff,stroke:#000,stroke-width:2px style CalculateVector fill:#99ff99,stroke:#000,stroke-width:2px style ReturnVector fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.get_ClosestGeoLoc(self, loc, mesh, locName='Geo_Loc', giveLoc=True)#

[Note: Mesh should be freezed for correct snapping]

Purpose:

:: Finds the closest point on a given mesh to a specified locator and creates a new locator at that point in Autodesk Maya.

  • Ideal for precision alignment tasks in rigging and modeling workflows.

  • Useful for snapping objects to a mesh’s surface accurately.

Parameters:
  • loc – <str> #The locator whose position is used to find the closest point on the mesh.

  • mesh – <str> #The mesh object to which the closest point calculation is done.

  • locName – <str, optional> #Name for the created locator at the closest point. Defaults to ‘Geo_Loc’.

  • giveLoc – <bool, optional> #Determines the return type - locator (True) or position (False). Defaults to True.

Usage Example:

>>> get_ClosestGeoLoc('locator1', 'pSphere1', 'ClosestPointLoc')
# Finds the closest point on 'pSphere1' to 'locator1' and creates a new locator 'ClosestPointLoc' at that point.

Note: - Ensure the locator and mesh exist in the scene and the mesh is freezed for accurate results. - The function can return either the new locator at the closest point or just the position, based on the giveLoc parameter.

Flow Chart Description:

The flowchart for the get_ClosestGeoLoc function:

  1. Starts by taking the position of the input locator loc.

  2. Utilizes a closestPointOnMesh node to calculate the nearest point on the specified mesh.

  3. Creates a new locator and positions it at the closest point on the mesh.

  4. Deletes the closestPointOnMesh node to clean up the scene.

  5. Depending on giveLoc parameter, returns either the new locator or the position of the closest point.

graph TB Start[("fa:fa-play Start")] --> GetLocatorPos["/fas:fa-map-pin Get Locator Position"] GetLocatorPos --> CalculateClosestPoint["/fas:fa-ruler-combined Calculate Closest Point on Mesh"] CalculateClosestPoint --> CreateNewLocator["/fas:fa-map-marker-alt Create New Locator"] CreateNewLocator --> CleanUp["/fas:fa-broom Clean Up"] CleanUp --> ReturnResult{"/fas:fa-question-circle Return Result"} ReturnResult --"Locator"--> ReturnLocator["/fas:fa-map-marker-alt Return Locator"] ReturnResult --"Position"--> ReturnPosition["/fas:fa-map-pin Return Position"] ReturnLocator --> End[("fas:fa-stop End")] ReturnPosition --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetLocatorPos fill:#99ccff,stroke:#000,stroke-width:2px style CalculateClosestPoint fill:#99ccff,stroke:#000,stroke-width:2px style CreateNewLocator fill:#99ff99,stroke:#000,stroke-width:2px style CleanUp fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnLocator fill:#99ccff,stroke:#000,stroke-width:2px style ReturnPosition fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.get_GeoCentricLoc(self, baseLoc, baseGeo, giveLoc=True, gcmSuffix='_asSC1000GCM')#

[shArgs : none]

Purpose:

:: Generates a geometrically central locator (or position) relative to a base geometry and a base locator in Autodesk Maya.

  • The function is useful for accurately positioning elements in 3D space relative to a base geometry.

  • It calculates the midpoint between two points on the geometry that are determined based on the base locator’s position.

  • This method is particularly valuable in rigging and modeling for establishing pivot points or alignment references.

Parameters:
  • baseLoc – <PyNode> #The base locator from which the central position is calculated.

  • baseGeo – <PyNode> #The geometry relative to which the central position is determined.

  • giveLoc – <bool> #Specifies whether to return a locator or just the position.

  • gcmSuffix – <str> #A suffix to be added to the generated locator’s name.

Returns:

<PyNode> or <list> #Returns a locator at the central position or the position itself, depending on the giveLoc parameter.

Usage Example:

>>> central_locator = get_GeoCentricLoc('pCube1', 'pSphere1', giveLoc=True)
# Creates a locator at a position central to 'pSphere1' based on the position of 'pCube1'.
Note:

  • The function requires a base locator and a geometry for reference.

  • The generated locator or position is central between two points on the geometry, offering precision in placement.

graph TB Start[("fa:fa-play Start")] --> RetrieveBaseLocPosition["/fas:fa-location-arrow Retrieve Base Locator Position"] RetrieveBaseLocPosition --> GetFirstGeoLoc["/fas:fa-map-pin Get First Geometric Locator"] GetFirstGeoLoc --> ExtendLocator["/fas:fa-expand-arrows-alt Extend Locator Position"] ExtendLocator --> GetSecondGeoLoc["/fas:fa-map-pin Get Second Geometric Locator"] GetSecondGeoLoc --> CalculateCenter["/fas:fa-bullseye Calculate Central Position"] CalculateCenter --> EvaluateJointType{"/fas:fa-bone Evaluate if Base Locator is Joint"} EvaluateJointType --"If Joint"--> ProcessJoint["/fas:fa-tools Process for Joint"] ProcessJoint --> AdjustForJoint["/fas:fa-sliders-h Adjust Position for Joint"] AdjustForJoint --> ReturnFinalLocator["/fas:fa-thumbs-up Return Final Locator"] EvaluateJointType --"Not a Joint"--> DirectReturn["/fas:fa-arrow-right Directly Return Locator"] DirectReturn --> ReturnFinalLocator ReturnFinalLocator --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveBaseLocPosition fill:#99ccff,stroke:#000,stroke-width:2px style GetFirstGeoLoc fill:#99ff99,stroke:#000,stroke-width:2px style ExtendLocator fill:#99ff99,stroke:#000,stroke-width:2px style GetSecondGeoLoc fill:#99ff99,stroke:#000,stroke-width:2px style CalculateCenter fill:#ffcc00,stroke:#000,stroke-width:2px style EvaluateJointType fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessJoint fill:#99ccff,stroke:#000,stroke-width:2px style AdjustForJoint fill:#99ccff,stroke:#000,stroke-width:2px style DirectReturn fill:#99ccff,stroke:#000,stroke-width:2px style ReturnFinalLocator fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The get_GeoCentricLoc function operates in the following manner:

  1. Begins by obtaining the position of the base locator.

  2. Finds the first geometric locator based on the base locator’s position relative to the base geometry.

  3. Extends the position from the base locator to create a second point.

  4. Determines the second geometric locator based on the extended position.

  5. Calculates the central position between the first and second geometric locators.

  6. If the base locator is a joint, processes the position differently for joint-specific requirements.

  7. Adjusts the central position if necessary and returns the final locator at this position.

  8. If the base locator is not a joint, directly returns the calculated central locator.

  9. Completes the operation by providing the locator or position as specified.

HyperSkin.get_NormLoc(self, obj_Piv, obj_Vec1, obj_Vec2, locName='Norm_Loc', giveLoc=True)#

[shArgs : none]

Purpose:

:: Calculates the normal vector from two vectors defined by three objects and creates a locator at the normal’s end point in Autodesk Maya.

  • Useful for rigging and scripting tasks that require normal vector calculations.

  • Simplifies the process of determining directional relationships between objects.

Parameters:
  • obj_Piv – <str> #The pivot object from which the normal vector is calculated.

  • obj_Vec1 – <str> #The first object defining the direction of the first vector.

  • obj_Vec2 – <str> #The second object defining the direction of the second vector.

  • locName – <str, optional> #Name for the created locator. Defaults to ‘Norm_Loc’.

  • giveLoc – <bool, optional> #Determines the return type - locator (True) or position (False). Defaults to True.

Usage Example:

>>> get_NormLoc('pCube1', 'pCube2', 'pCube3', 'MyNormLoc')
# Calculates the normal vector based on positions of 'pCube1', 'pCube2', 'pCube3' and creates a locator named 'MyNormLoc' at the end point.

Note: - Ensure the objects (obj_Piv, obj_Vec1, obj_Vec2) exist in the scene and have distinct positions. - The function can return either the locator at the normal’s end point or just the position, based on the giveLoc parameter.

Flow Chart Description:

The flowchart for the get_NormLoc function:

  1. Starts by calculating two directional vectors based on the positions of obj_Piv to obj_Vec1 and obj_Piv to obj_Vec2.

  2. Computes the normal vector using the cross product of these two vectors.

  3. Creates a locator and places it at the end point of the normal vector.

  4. Optionally, creates temporary joints for precise positioning and then deletes them.

  5. Depending on giveLoc parameter, returns either the locator or the position of the normal’s end point.

graph TB Start[("fa:fa-play Start")] --> CalculateVectors["/fas:fa-arrows-alt Calculate Directional Vectors"] CalculateVectors --> ComputeNormal["/fas:fa-vector-square Compute Normal Vector"] ComputeNormal --> CreateLocator["/fas:fa-map-marker-alt Create Locator"] CreateLocator --> CreateJoints["/fas:fa-bone Create Temporary Joints"] CreateJoints --> PositionLocator["/fas:fa-map-pin Position Locator"] PositionLocator --> DeleteJoints["/fas:fa-trash-alt Delete Temporary Joints"] DeleteJoints --> ReturnResult{"/fas:fa-question-circle Return Result"} ReturnResult --"Locator"--> ReturnLocator["/fas:fa-map-marker-alt Return Locator"] ReturnResult --"Position"--> ReturnPosition["/fas:fa-map-pin Return Position"] ReturnLocator --> End[("fas:fa-stop End")] ReturnPosition --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CalculateVectors fill:#99ccff,stroke:#000,stroke-width:2px style ComputeNormal fill:#99ccff,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style CreateJoints fill:#99ff99,stroke:#000,stroke-width:2px style PositionLocator fill:#99ff99,stroke:#000,stroke-width:2px style DeleteJoints fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnLocator fill:#99ccff,stroke:#000,stroke-width:2px style ReturnPosition fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.grpIt(self, objName, grpLevel=1, snapPiv=True, grpSufxList=None)#

[**shArgs : on=objName, gl=grpLevel, sp=snapPiv, gsl=grpSufxList]

Purpose:

:: Groups the given object at specified levels and optionally snaps the pivot, returning the group(s).

  • Utilized in organizing Maya scenes by grouping objects, which is essential in complex projects.

  • Supports various levels of grouping and pivot snapping, facilitating a cleaner and more manageable scene structure.

Parameters:
  • objName – <str> # Name of the object to be grouped.

  • grpLevel – <int, optional> # The number of grouping levels. Defaults to 1.

  • snapPiv – <bool, optional> # Determines whether to snap the pivot to the object. Defaults to True.

  • grpSufxList – <list, optional> # List of suffixes for the group names.

Returns:

<list or str> # Returns a list of group names or a single group name based on the number of groups created.

Usage:

    if len(grpList) > 1:
            return grpList  # grp1, grp2, ....grpTop
    else:
            return grpList[0]

>>> grpIt("pCube1", 2, True, ["_Main", "_Secondary"])
# Groups pCube1 into two levels with custom suffixes and snaps pivot to the original object.
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckGrpSufxList fill:#ff9999,stroke:#000,stroke-width:2px style SetObjName fill:#99ccff,stroke:#000,stroke-width:2px style CheckGrpLevel fill:#cc99ff,stroke:#000,stroke-width:2px style GroupItFunction fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnGrpList fill:#99ff99,stroke:#000,stroke-width:2px style ReturnSingleGrp fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> CheckGrpSufxList["/fas:fa-list Check grpSufxList"] CheckShArgs --"If shArgs not provided"--> CheckGrpSufxList CheckGrpSufxList --> SetObjName["/fas:fa-object-ungroup Set ObjName"] SetObjName --> CheckGrpLevel{"/fas:fa-sort-amount-up Check GrpLevel"} CheckGrpLevel --"If grpLevel is 0"--> ReturnSingleGrp["/fas:fa-check Return Single Group"] CheckGrpLevel --"If grpLevel > 0"--> GroupItFunction["/fas:fa-layer-group GroupIt Function"] GroupItFunction --"Loop for grpLevel times"--> ReturnGrpList{"/fas:fa-list-ul Return grpList"} ReturnGrpList --"If more than one group"--> End[("fas:fa-check-circle End (List)")] ReturnGrpList --"If only one group"--> End[("fas:fa-check-circle End (Single)")] ReturnSingleGrp --> End
Flow Chart Description:

This flowchart illustrates the grpIt function:

  1. The process starts by checking if shArgs are provided, updating parameters like objName, grpLevel, snapPiv, and grpSufxList.

  2. It then ensures that grpSufxList is a list, even if a single suffix is provided.

  3. The object name is converted to a node, and the initial group object is set.

  4. The function checks the grpLevel. If it’s 0, it returns the object name as a single group.

  5. If grpLevel is greater than 0, it calls the groupIt function, which recursively groups the object at specified levels.

  6. After grouping, it returns a list of group names if there are multiple groups, or a single group name if only one group is created.

HyperSkin.hasMeshContainsPoint(self, checkMesh, checkPointOrObj, precision=5)#

[shArgs : none]

Purpose:

:: Determines whether a specified point is inside a given mesh object with a specified precision level in Autodesk Maya.

  • Utilizes Maya’s OpenMaya API to find the closest point on the mesh to the given point and assesses its position relative to the mesh surface.

  • Allows specifying the precision level for the position calculation to manage computational accuracy and efficiency.

Parameters:
  • checkMesh – <str> #The name of the mesh object to check against.

  • checkPointOrObj – <list/str> #A 3D point as a list [x, y, z] or the name of an object to check its position.

  • precision – <int> #The number of decimal places to consider for rounding the point’s coordinates.

Usage Example:

>>> hasMeshContainsPoint('pCube1', [1, 2, 3], 5)
# Returns True if the point [1, 2, 3] is inside 'pCube1' mesh, otherwise False.

Note: - This function is useful for collision detection, spatial queries, or determining the inside/outside status of a point relative to a mesh. - The precision parameter helps in fine-tuning the accuracy level for the point’s position calculation.

Flow Chart Description:

The flowchart for the hasMeshContainsPoint function:

  1. Initializes by checking the type of input for the point (list or object name) and rounding the point coordinates based on the specified precision.

  2. Loads the necessary Maya plugin if not already loaded.

  3. Retrieves the mesh object and validates it.

  4. Calculates the closest point on the mesh and its normal vector relative to the given point.

  5. Determines the relation between the point and the mesh’s surface (inside or outside) based on the dot product of the ray from the point to the closest point and the normal at that point.

  6. Returns True if the point is inside the mesh, otherwise False.

graph TB Start[("fa:fa-play Start")] --> CheckInputType{"/fas:fa-question-circle Check Input Type"} CheckInputType --"If List"--> RoundCoordinates["/fas:fa-ruler-combined Round Coordinates"] CheckInputType --"If Object Name"--> GetObjectPosition["/fas:fa-crosshairs Get Object Position"] RoundCoordinates --> LoadPlugin{"/fas:fa-plug Load Maya Plugin"} GetObjectPosition --> LoadPlugin LoadPlugin --> RetrieveMesh{"/fas:fa-cube Retrieve Mesh Object"} RetrieveMesh --> ComputeClosestPoint{"/fas:fa-ruler-combined Compute Closest Point and Normal"} ComputeClosestPoint --> DeterminePosition{"/fas:fa-search-location Determine Position Relative to Mesh"} DeterminePosition --> ReturnResult{"/fas:fa-thumbs-up-down Return Result"} ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckInputType fill:#ffcc00,stroke:#000,stroke-width:2px style RoundCoordinates fill:#99ccff,stroke:#000,stroke-width:2px style GetObjectPosition fill:#99ccff,stroke:#000,stroke-width:2px style LoadPlugin fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveMesh fill:#99ccff,stroke:#000,stroke-width:2px style ComputeClosestPoint fill:#99ccff,stroke:#000,stroke-width:2px style DeterminePosition fill:#99ccff,stroke:#000,stroke-width:2px style ReturnResult fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.hasMeshContainsPos(self, checkMesh, checkPointOrObj)#

[shArgs : none]

Purpose:

:: Determines if a given point or object position is inside or outside of a specified mesh in Autodesk Maya.

  • Utilizes Maya’s OpenMaya API to compute the closest point and normal on the mesh relative to the given point.

  • Checks if the point lies on the normal side of the mesh, indicating whether it is inside or outside.

Parameters:
  • checkMesh – <str> #The name of the mesh object to check against.

  • checkPointOrObj – <list/str> #A 3D point as a list [x, y, z] or the name of an object to check its position.

Usage Example:

>>> hasMeshContainsPos('pCube1', [1, 2, 3])
# Returns True if the point [1, 2, 3] is inside 'pCube1', otherwise False.

Note: - The function is ideal for collision detection or spatial queries within a 3D environment. - Ensure the mesh and the point or object specified are valid and exist in the scene.

Flow Chart Description:

The flowchart for the hasMeshContainsPos function:

  1. Starts by identifying whether the input is a list representing a point or an object name.

  2. Retrieves the mesh object and the point’s position in world space.

  3. Computes the closest point and normal on the mesh to the given point.

  4. Checks if the point lies on the normal side of the mesh (outside) or the opposite side (inside).

  5. Returns True if the point is inside the mesh, otherwise False.

graph TB Start[("fa:fa-play Start")] --> IdentifyInputType{"/fas:fa-question-circle Identify Input Type"} IdentifyInputType --"If List"--> SetPoint["/fas:fa-map-marker Set Point"] IdentifyInputType --"If Object Name"--> GetObjectPosition["/fas:fa-crosshairs Get Object Position"] SetPoint --> RetrieveMesh{"/fas:fa-cube Retrieve Mesh Object"} GetObjectPosition --> RetrieveMesh RetrieveMesh --> ComputeClosestPoint{"/fas:fa-ruler-combined Compute Closest Point on Mesh"} ComputeClosestPoint --> CheckPosition{"/fas:fa-search-location Check Position Relative to Mesh"} CheckPosition --> ReturnResult{"/fas:fa-thumbs-up-down Return Result"} ReturnResult --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style IdentifyInputType fill:#ffcc00,stroke:#000,stroke-width:2px style SetPoint fill:#99ccff,stroke:#000,stroke-width:2px style GetObjectPosition fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveMesh fill:#99ccff,stroke:#000,stroke-width:2px style ComputeClosestPoint fill:#99ccff,stroke:#000,stroke-width:2px style CheckPosition fill:#99ccff,stroke:#000,stroke-width:2px style ReturnResult fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.hideNodes(self, nodeList)#

[shArgs : none]

Purpose:

:: The function hideNodes in Autodesk Maya is used for hiding nodes in the scene. This is particularly useful in rigging and animation workflows where certain objects need to be temporarily hidden for clarity or performance reasons.

  • Line 1, Additional Description as needed by sphinx HTML doc, if any

  • Line 2, Additional Description as needed by sphinx HTML doc, if any

Parameters:

nodeList – <list/str> #List of nodes or a single node name to be hidden.

Note:

  • Suitable for use in complex scenes to improve viewport performance or declutter the workspace.

  • The function is versatile, able to handle mesh, joint, and curve nodes.

Returns:

None #The function does not return a value but performs an action on the scene.

Usage Example:

>>> hideNodes(['pCube1', 'joint1'])
# This will hide both 'pCube1' and 'joint1' in the scene.
Flow Chart Description:

The hideNodes function follows these steps:

  1. Checks if the input is a list or a single node and converts it into a list if necessary.

  2. Iterates through each node in the list.

  3. Depending on the node type (mesh, joint, or curve), sets various attributes to hide the node in the scene.

  4. Locks the visibility attribute in the channel box to prevent accidental unhide.

  5. Optionally applies an invisible shader to mesh nodes for complete invisibility.

graph TD Start[("fa:fa-play Start")] --> InputCheck{Input Type Check} InputCheck -- Single Node --> ConvertToList[Convert to List] InputCheck -- List --> IterateNodes{Iterate Nodes} ConvertToList --> IterateNodes IterateNodes --> HideNode[Hide Node] HideNode --> LockVisibility[Lock Visibility] HideNode --> ApplyShader{Apply Invisible Shader?} ApplyShader -- Yes --> InvisibleShader[Apply Invisible Shader] ApplyShader -- No --> LockVisibility InvisibleShader --> LockVisibility LockVisibility --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style InputCheck fill:#99ccff,stroke:#000,stroke-width:2px style ConvertToList fill:#99ccff,stroke:#000,stroke-width:2px style IterateNodes fill:#99ccff,stroke:#000,stroke-width:2px style HideNode fill:#99ccff,stroke:#000,stroke-width:2px style LockVisibility fill:#99ccff,stroke:#000,stroke-width:2px style ApplyShader fill:#99ccff,stroke:#000,stroke-width:2px style InvisibleShader fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
class HyperSkin.hyperSkinDeformer(jointList=None, shape=None, skin=None, vtxList=None)#

Bases: object

__init__(jointList=None, shape=None, skin=None, vtxList=None)#
HyperSkin.importAttrs_DSCs(self)#

[shArgs : none]

Purpose:

:: Imports attributes for Hyper Discs in Autodesk Maya from a specified file, with options to adjust and update Hyper Discs.

  • Allows the import of predefined attributes from an external file, which can be applied to Hyper Discs in the scene.

  • Provides an option to automatically adjust and update Hyper Discs after importing attributes.

  • Streamlines the process of configuring Hyper Discs by using predefined attribute settings.

Usage Example:

>>> importAttrs_DSCs()
# Imports attributes from a specified file and applies them to Hyper Discs in the Maya scene.
Parameters:

  • None. This function operates based on the user interface elements in Maya, such as checkboxes and file paths.

Return:

  • None. The primary operation of this function is to import and apply attribute settings to Hyper Discs in the Maya scene.

Note:

  • Ensure that the correct file path is specified for importing attributes.

  • The function provides options to adjust and update Hyper Discs based on the imported attributes.

  • Use this function when you need to apply consistent attribute settings across multiple Hyper Discs in your scene.

graph TB Start[("fa:fa-play Start")] --> CheckFilePath{"/fas:fa-question-circle Check File Path"} CheckFilePath -- "File Exists" --> ExecuteFile["/fas:fa-file-import Execute File"] CheckFilePath -- "File Not Found" --> End[("fas:fa-stop End")] ExecuteFile --> CheckAdjustDiscs{"/fas:fa-sliders-h Check Adjust Discs Option"} CheckAdjustDiscs -- "Adjust Discs" --> AdjustDiscs["/fas:fa-wrench Adjust Hyper Discs"] CheckAdjustDiscs -- "No Adjustment" --> DisplaySuccess["/fas:fa-check Display Success Message"] AdjustDiscs --> DisplaySuccess DisplaySuccess --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckFilePath fill:#ffcc00,stroke:#000,stroke-width:2px style ExecuteFile fill:#99ccff,stroke:#000,stroke-width:2px style CheckAdjustDiscs fill:#ffcc00,stroke:#000,stroke-width:2px style AdjustDiscs fill:#99ff99,stroke:#000,stroke-width:2px style DisplaySuccess fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the importAttrs_DSCs function outlines:

  1. The process begins by checking if the specified file path for the attribute file exists.

  2. If the file exists, it proceeds to execute the file, importing the attribute settings.

  3. Next, the function checks if the ‘Adjust Discs’ option is enabled.

  4. If enabled, it adjusts and updates Hyper Discs based on the imported attributes.

  5. Finally, it displays a success message, indicating the completion of the import and adjustment process.

HyperSkin.importBlendWeights(self, skinMesh=None, filePath=None, fileName=None)#

[shArgs : sm=skinMesh, fp=filePath, fn=fileName]

Purpose:

:: Imports blend weights from a Python file to a specified skin mesh. This function is beneficial for restoring skinning data in character rigging workflows.

Parameters:
  • skinMesh – (<str> | <hsNode>, optional) #Name or hsNode of the skin mesh to import blend weights to. If not provided, the function uses the selected object. Default is None.

  • filePath – (<str>, optional) #Path to the directory where the blend weight file is located. If not provided, uses the directory of the current scene. Default is None.

  • fileName – (<str>, optional) #Name of the file from which to import blend weights. If not provided, the file is assumed to be named after the skin mesh with ‘_blendWeights.py’ suffix. Default is None.

Returns:

None #This function does not return a value but applies the blend weight data to the specified skin mesh.

Usage Example:

>>> importBlendWeights('body_geo', '/path/to/import/', 'body_geo_blendWeights.py')
# This will import blend weights to 'body_geo' mesh from the specified file and path.
Flow Chart Description:

The importBlendWeights function performs the following operations:

  1. Determines the skin mesh to import blend weights to, either from provided argument or selection.

  2. Prepares the file path and name for importing data.

  3. Reads blend weight data from the specified Python file.

  4. Applies the blend weight data to the specified skin mesh.

graph TB Start[("fa:fa-play Start")] --> DetermineMesh["/fas:fa-cube Determine Skin Mesh"] DetermineMesh --> ReadFile["/fas:fa-file-alt Read File"] ReadFile --> ParseData["/fas:fa-code Parse Data from File"] ParseData --> ApplyWeights["/fas:fa-balance-scale Apply Blend Weights"] ApplyWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineMesh fill:#99ccff,stroke:#000,stroke-width:2px style ReadFile fill:#99ccff,stroke:#000,stroke-width:2px style ParseData fill:#99ccff,stroke:#000,stroke-width:2px style ApplyWeights fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.importDSCs_FromFile(self)#

[shArgs : none]

Purpose:

:: Imports Hyper Discs from a specified file and attaches them to their respective joints in Autodesk Maya.

  • Facilitates the reintegration of Hyper Discs into a Maya scene, particularly useful for transferring rigs between scenes or projects.

  • Attaches each imported Hyper Disc to its corresponding joint based on naming conventions, ensuring proper alignment and functionality.

  • Offers flexibility in selecting the source file for Hyper Discs, either from a default path or a user-specified location.

Usage Example:

>>> importDSCs_FromFile()
# Imports Hyper Discs from a specified file and attaches them to the corresponding joints in the Maya scene.
Parameters:

  • None. This function operates based on user interface elements in Maya, such as file dialog and checkboxes.

Return:

  • None. The main operation of this function is to import Hyper Discs from a file and attach them to the corresponding joints.

Note:

  • The function checks for the existence of an ‘as_HyperSkin_Grp’ in the scene to avoid conflicts with existing setups.

  • It’s crucial to ensure that the naming conventions used for joints and Hyper Discs are consistent to allow proper attachment.

  • Use this function when transferring rigging setups between different Maya scenes or projects.

graph TB Start[("fa:fa-play Start")] --> CheckHyperSkinGrp{"/fas:fa-question-circle Check Existing as_HyperSkin_Grp"} CheckHyperSkinGrp -- "Group Exists" --> ConfirmDeletion{"/fas:fa-times-circle Confirm Deletion of Existing Group"} ConfirmDeletion -- "Confirmed" --> DeleteGroup["/fas:fa-trash-alt Delete as_HyperSkin_Grp"] CheckHyperSkinGrp -- "No Group" --> ImportFile["/fas:fa-file-import Import Hyper Discs File"] DeleteGroup --> ImportFile ImportFile --> AttachDiscs["/fas:fa-link Attach Hyper Discs to Joints"] AttachDiscs --> DisplaySuccess["/fas:fa-check Display Success Message"] DisplaySuccess --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckHyperSkinGrp fill:#ffcc00,stroke:#000,stroke-width:2px style ConfirmDeletion fill:#ff6666,stroke:#000,stroke-width:2px style DeleteGroup fill:#99ccff,stroke:#000,stroke-width:2px style ImportFile fill:#99ccff,stroke:#000,stroke-width:2px style AttachDiscs fill:#99ff99,stroke:#000,stroke-width:2px style DisplaySuccess fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the importDSCs_FromFile function demonstrates:

  1. The process starts by checking if an ‘as_HyperSkin_Grp’ already exists in the scene.

  2. If the group exists, it prompts the user to confirm its deletion.

  3. Upon confirmation, the existing group is deleted.

  4. The function then imports Hyper Discs from the specified file.

  5. After importing, it attaches each Hyper Disc to its corresponding joint based on naming conventions.

  6. Finally, it displays a success message, indicating the successful import and attachment of Hyper Discs.

HyperSkin.importSkinDeformer(self, fileName=None, filePath=None)#

[shArgs : none]

Purpose:

:: Imports skin deformers from a specified file to the selected mesh in Autodesk Maya.

  • Provides a seamless way to transfer skinning data between different scenes or projects.

  • Enhances the rigging process by allowing the reuse of complex skinning setups.

Usage Example:

>>> importSkinDeformer(fileName='mySkinWeights', filePath='C:/MyProjects/SkinWeights/')
# Imports skin weights from 'mySkinWeights' file located at 'C:/MyProjects/SkinWeights/'.
Parameters:

  • fileName: Name of the file containing the exported skin weights.

  • filePath: Path where the file is located.

Return:

  • None. The function updates the selected mesh with the imported skin weights.

Note:

  • Ensure the correct mesh is selected before running this function.

  • The fileName and filePath must point to a valid exported skin weights file.

graph TB Start[("fa:fa-play Start")] --> SelectMesh{"/fas:fa-mouse-pointer Select Mesh"} SelectMesh --> ImportWeights{"/fas:fa-download Import Skin Weights"} ImportWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMesh fill:#ffcc00,stroke:#000,stroke-width:2px style ImportWeights fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the importSkinDeformer function:

  1. The process starts by selecting the mesh in Maya.

  2. The function then imports the skin weights from the specified file to the selected mesh.

  3. The process completes with the mesh now containing the imported skin weights.

HyperSkin.importSkinWeights(self, advImport=False)#

[shArgs : none]

Purpose:

:: Imports skin weights for selected meshes or curves in Autodesk Maya, with options for advanced import settings.

  • Streamlines the process of skin weight transfer between similar geometry or from stored files.

  • Provides an option for advanced import, enabling more specific weight transfer scenarios.

  • Enhances the rigging workflow by simplifying the process of applying previously saved skin weights.

Usage Example:

>>> importSkinWeights(advImport=True)
# Imports skin weights using advanced import settings for selected meshes.
Parameters:

  • advImport: (<bool>, optional) If set to True, enables advanced import settings. Default is False.

Return:

  • None. The function operates directly on the selected meshes or curves in Maya.

Note:

  • Ensure the selected objects are either meshes or curves before executing this function.

  • Advanced import requires specific file naming and location conventions, as defined in the script.

graph TB Start[("fa:fa-play Start")] --> CheckAdvImport{"/fas:fa-question-circle Check Advanced Import"} CheckAdvImport -- "Advanced Import" --> PerformAdvImport["/fas:fa-file-import Perform Advanced Import"] CheckAdvImport -- "Standard Import" --> CheckSelection{"/fas:fa-object-group Check Selection"} PerformAdvImport --> End[("fas:fa-stop End")] CheckSelection -- "Meshes/Curves Selected" --> ImportWeights["/fas:fa-file-import Import Skin Weights"] CheckSelection -- "No Meshes/Curves" --> PromptUser["/fas:fa-exclamation-circle Prompt User"] ImportWeights --> End PromptUser --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAdvImport fill:#ffcc00,stroke:#000,stroke-width:2px style PerformAdvImport fill:#99ccff,stroke:#000,stroke-width:2px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ImportWeights fill:#99ff99,stroke:#000,stroke-width:2px style PromptUser fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the importSkinWeights function:

  1. The process begins by checking if advanced import is enabled.

  2. If advanced import is selected, the function performs an advanced import of skin weights based on predefined settings.

  3. If standard import is selected, the function checks if meshes or curves are selected.

  4. If meshes or curves are selected, the function imports skin weights for each selected object.

  5. If no meshes or curves are selected, the user is prompted, and the function ends.

  6. The process completes after importing skin weights or if no suitable objects are selected.

HyperSkin.importSkinWeights_Deformer(self, filePath=None, fileName=None, showMessage=True)#

[shArgs : none]

Purpose:

:: Imports skin weights for deformers applied to selected meshes in Autodesk Maya, using custom file formats.

  • Facilitates the transfer of skin weights from external files to selected meshes, enhancing the skinning process.

  • Supports different file formats based on the Maya version used.

  • Ideal for restoring or transferring complex skinning setups across different meshes or Maya sessions.

Usage Example:

>>> importSkinWeights_Deformer(filePath="path/to/file", fileName="mesh_weights.hyperSkin")
# Imports skin weights from the specified file to the selected mesh.
Parameters:

  • filePath: (<str>, optional) Path to the directory containing the skin weight files. Default is None.

  • fileName: (<str>, optional) Name of the file containing skin weights. Default is None.

  • showMessage: (<bool>, optional) Determines whether to show a completion message. Default is True.

Return:

  • None. The function operates directly on the selected meshes in Maya.

Note:

  • The selected object(s) must be mesh(es) for the import to work.

  • Ensure the file path and name correspond to the correct files containing the skin weights.

  • The file format changes based on the version of Maya: .hyperSkin for versions before 2020 and .xml for 2020 and later.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-check-circle Check Mesh Selection"} CheckSelection -- "Meshes Selected" --> DetermineFileVersion{"/fas:fa-code-branch Determine File Version"} CheckSelection -- "No Meshes" --> ErrorPrompt["/fas:fa-times-circle Error Prompt"] DetermineFileVersion --> ImportWeights["/fas:fa-file-import Import Skin Weights"] ImportWeights --> End[("fas:fa-stop End")] ErrorPrompt --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineFileVersion fill:#99ccff,stroke:#000,stroke-width:2px style ImportWeights fill:#99ff99,stroke:#000,stroke-width:2px style ErrorPrompt fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the importSkinWeights_Deformer function:

  1. The process starts with checking if any meshes are selected.

  2. If no meshes are selected, an error prompt is displayed and the process ends.

  3. If meshes are selected, the function determines the appropriate file version based on the Maya version.

  4. The skin weights are then imported from the specified file to the selected mesh(es).

  5. The process completes after importing the skin weights, or if no meshes are selected.

HyperSkin.importSkinWeights_Sides(self, filePath=None, fileName=None, showMessage=True)#

[shArgs : none]

Purpose:

:: Imports skin weights for specific sides (left, right, both, or selected vertices) of a mesh in Autodesk Maya.

  • Customizable to import skin weights based on the side of the mesh, catering to asymmetric rigging needs.

  • Facilitates precise and targeted skin weight adjustments, especially useful in character rigging.

  • Streamlines the process of importing skin weight data from external sources.

Usage Example:

>>> importSkinWeights_Sides(filePath="path/to/file", fileName="left_side_weights.py", showMessage=True)
# Imports skin weights from the specified file to the left side of the selected mesh.
Parameters:

  • filePath: (<str>, optional) Path to the directory containing the skin weight files. Default is None.

  • fileName: (<str>, optional) Name of the file containing skin weights for specific sides. Default is None.

  • showMessage: (<bool>, optional) Determines whether to show a completion message. Default is True.

Return:

  • None. The function operates directly on the selected mesh in Maya.

Note:

  • The function relies on specific naming conventions for the files containing skin weights (e.g., _SkinWeightsR.py for right side).

  • Ensure the selected mesh is the intended target for weight import.

  • The function caters to various options like importing weights for both sides, left, right, or selected vertices.

graph TB Start[("fa:fa-play Start")] --> CheckMeshSelection{"/fas:fa-check-circle Check Mesh Selection"} CheckMeshSelection -- "Mesh Selected" --> DetermineSides{"/fas:fa-code-branch Determine Sides"} CheckMeshSelection -- "No Mesh" --> ErrorPrompt["/fas:fa-times-circle Error Prompt"] DetermineSides --> ImportWeights{"/fas:fa-file-import Import Skin Weights"} ImportWeights --> End[("fas:fa-stop End")] ErrorPrompt --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshSelection fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineSides fill:#99ccff,stroke:#000,stroke-width:2px style ImportWeights fill:#99ff99,stroke:#000,stroke-width:2px style ErrorPrompt fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the importSkinWeights_Sides function:

  1. The process starts by checking if a mesh is selected.

  2. If no mesh is selected, an error prompt is displayed, and the process ends.

  3. If a mesh is selected, the function determines which sides (left, right, both, or selected vertices) to import weights for.

  4. Skin weights are then imported from the specified file to the designated sides of the mesh.

  5. The process completes after importing the skin weights, or if no mesh is selected.

HyperSkin.import_DSCsOrAttrs(self)#

[shArgs : none]

Purpose:

:: Facilitates the import of either Discs or Attributes in Autodesk Maya based on user selection.

  • Offers a choice to import Discs or Attributes, enhancing workflow flexibility.

  • Useful for scenarios where specific elements of a Maya scene need to be imported from external sources.

Usage Example:

>>> import_DSCsOrAttrs()
# Prompts the user to choose between importing Discs or Attributes and then performs the selected action.
Parameters:

  • None. The function prompts the user to make a selection between Discs and Attributes.

Return:

  • None. The function either imports Discs or Attributes based on the user’s choice.

Note:

  • A user interface prompt is presented to choose between importing Discs or Attributes.

  • If ‘Discs’ is selected, the function calls importDSCs_FromFile() to import Discs.

  • If ‘Attributes’ is selected, the function calls importAttrs_DSCs() to import Attributes.

  • This method is particularly useful in scenarios where the user needs flexibility in deciding what to import into the Maya scene.

graph TB Start[("fa:fa-play Start")] --> UserChoice{"/fas:fa-question-circle User Chooses Import Type"} UserChoice -- "Choose Discs" --> ImportDiscs["/fas:fa-circle Import Discs"] UserChoice -- "Choose Attributes" --> ImportAttributes["/fas:fa-list Import Attributes"] ImportDiscs --> PerformImportDiscs["/fas:fa-download Perform Import Discs"] ImportAttributes --> PerformImportAttributes["/fas:fa-download Perform Import Attributes"] PerformImportDiscs --> End[("fas:fa-stop End")] PerformImportAttributes --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style UserChoice fill:#ffcc00,stroke:#000,stroke-width:2px style ImportDiscs fill:#99ccff,stroke:#000,stroke-width:2px style ImportAttributes fill:#99ccff,stroke:#000,stroke-width:2px style PerformImportDiscs fill:#99ff99,stroke:#000,stroke-width:2px style PerformImportAttributes fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the import_DSCsOrAttrs function illustrates:

  1. The start of the process, leading to a user prompt to choose between importing Discs or Attributes.

  2. Depending on the user’s choice, the flow diverges into two paths:
    • If ‘Discs’ are chosen, the function proceeds to import Discs.

    • If ‘Attributes’ are chosen, the function proceeds to import Attributes.

  3. The respective import functions are called based on the selection.

  4. The process ends after completing the import of the selected type.

HyperSkin.import_skin(self, json_file_path)#

[shArgs : jfp=json_file_path]

Purpose:

:: To import skin weights for multiple meshes from a specified JSON file, often used in 3D animation and rigging to restore or transfer skinning data.

Parameters:
  • json_file_path – (<str>) #The file path of the JSON file containing skin weight data.

  • mesh_name – (<str>) #The name of the mesh being processed for skin weight import.

  • vertex_num – (<int>) #The index number of the vertex being processed.

  • vertex_weights – (<dict>) #A dictionary containing joint names and their corresponding weight values for a specific vertex.

  • skin_cluster – (<list of pm.objects>) #A list containing the skin cluster node attached to the current mesh.

Returns:

None #This function does not return a value but prints a confirmation message upon successful completion.

Usage Example:

>>> import_skin('/path/to/skin_weights.json')
# This will import skin weights for meshes specified in the JSON file located at '/path/to/skin_weights.json'.
Flow Chart Description:

The import_skin function performs the following operations:

  1. Loads the JSON file containing skin weight data.

  2. Iterates over each mesh entry in the JSON data.

  3. Checks if the current mesh has an attached skin cluster.

  4. Sets skin weights for each vertex in the mesh based on the JSON data.

  5. Displays a progress window during the import process.

  6. Prints a success message upon completion.

graph TB Start[("fa:fa-play Start")] --> LoadJSON["/fas:fa-file-code Load JSON File"] LoadJSON --> IterateMeshes["/fas:fa-sync-alt Iterate Meshes"] IterateMeshes --"For each mesh in JSON data" --> CheckSkinCluster["/fas:fa-search-plus Check Skin Cluster"] CheckSkinCluster --"If skin cluster exists" --> SetWeights["/fas:fa-balance-scale Set Weights"] CheckSkinCluster --"If no skin cluster" --> Continue[("/fas:fa-arrow-right Continue")] SetWeights --> UpdateProgress["/fas:fa-tasks Update Progress"] UpdateProgress --> EndLoop[("/fas:fa-redo-alt End Loop")] EndLoop --> IterateMeshes Continue --> IterateMeshes IterateMeshes --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style LoadJSON fill:#99ccff,stroke:#000,stroke-width:2px style IterateMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style SetWeights fill:#99ccff,stroke:#000,stroke-width:2px style UpdateProgress fill:#99ccff,stroke:#000,stroke-width:2px style EndLoop fill:#ffcc00,stroke:#000,stroke-width:2px style Continue fill:#ffcc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.import_vtx_skin(self, json_file_path)#

[shArgs : none]

Purpose:

:: Imports vertex skinning weights from a JSON file and applies them to a specified mesh in Autodesk Maya.

  • Useful for transferring skin weights between different versions of a model or between different projects.

  • Allows for precise control and restoration of skinning data, enhancing the rigging and skinning workflow.

Usage Example:

>>> import_vtx_skin('path/to/json_file.json')
# Imports skin weights from the specified JSON file and applies them to the mesh.

Note: - The JSON file should contain the mesh transform name and vertex skin weights data. - This function simplifies the process of transferring skin weights and is crucial in advanced rigging setups.

Parameters:

  • json_file_path: (<str>) The file path of the JSON file containing the vertex skin weights data.

Return:

  • None. However, it prints a success message upon successful import of skin weights.

graph TB Start[("fa:fa-play Start")] --> LoadJSON["/fas:fa-file-code Load JSON File"] LoadJSON --> ExtractMeshData["/fas:fa-database Extract Mesh Data"] ExtractMeshData --> CheckSkinCluster{"/fas:fa-question-circle Check SkinCluster"} CheckSkinCluster -- "No SkinCluster Found" --> CreateSkinCluster["/fas:fa-plus-circle Create SkinCluster"] CheckSkinCluster -- "SkinCluster Exists" --> SetSkinWeights["/fas:fa-weight-hanging Set Skin Weights"] CreateSkinCluster --> SetSkinWeights SetSkinWeights --> ImportComplete["/fas:fa-flag-checkered Import Complete"] ImportComplete --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style LoadJSON fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractMeshData fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#ffcc00,stroke:#000,stroke-width:2px style CreateSkinCluster fill:#cc99ff,stroke:#000,stroke-width:2px style SetSkinWeights fill:#99ff99,stroke:#000,stroke-width:2px style ImportComplete fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart explains the import_vtx_skin function:

  1. The process starts, loading the JSON file containing the vertex skin weights data.

  2. Extracts mesh data including transform name and vertices from the JSON file.

  3. Checks if the mesh has an existing skinCluster.

  4. If no skinCluster is found, a new one is created.

  5. Sets the skin weights for each vertex based on the data from the JSON file.

  6. The import process is completed, and a success message is printed.

  7. The process ends.

HyperSkin.isIt_LastSkinJnt(self, jnt, skinJntList, numFromEnd=0, useSeries=False, hsNodes_given=False)#

[shArgs : none]

Purpose:

:: The ‘isIt_LastSkinJnt’ function in Autodesk Maya evaluates whether a given joint is the last joint in a skinning setup, considering the hierarchy and connection with skin clusters.

  • This function plays a critical role in rigging and skinning workflows, allowing for precise control and manipulation of joint hierarchies in relation to skin meshes.

  • It provides flexibility in determining the position of a joint within the skinning hierarchy, supporting complex rigging scenarios.

Parameters:
  • jnt – <str> #The joint to evaluate whether it is the last joint in the skinning setup.

  • skinJntList – <list> #A list of joints associated with the skin mesh, used for comparison.

  • numFromEnd – <int> #Optional parameter to specify the number of joints from the end of the hierarchy. Default is 0.

  • useSeries – <bool> #Flag to determine whether to use a series-based evaluation for joint hierarchy. Default is False.

  • hsNodes_given – <bool> #Flag indicating if the given skinJntList consists of HyperSkin nodes. Default is False.

Returns:

<bool> #Returns True if the joint is the last joint in the skinning setup, otherwise False.

Usage Example:

>>> isIt_LastSkinJnt('joint1', ['joint1', 'joint2', 'joint3'])
# This command evaluates whether 'joint1' is the last joint in the hierarchy defined by the provided list of joints.
Note:

  • This function is essential for advanced rigging setups where the determination of the last joint in a hierarchy can influence the rigging and animation behavior.

  • It enhances the accuracy and efficiency of skinning processes by allowing for targeted manipulation of specific joints within a rig.

  • The function’s flexibility in handling different hierarchical structures makes it a valuable tool in the rigging toolkit.

graph TD Start[("fa:fa-play Start")] --> CheckNodeType{Is Joint?} CheckNodeType --"Yes"--> InSkinSet{In Skin Joints Set?} CheckNodeType --"No"--> End[("fas:fa-stop End")] InSkinSet --"Yes"--> EvaluateHierarchy{Evaluate Hierarchy} InSkinSet --"No"--> End EvaluateHierarchy --> IsLastJnt{Is Last Joint?} IsLastJnt --"Yes"--> End IsLastJnt --"No"--> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNodeType fill:#ffcc00,stroke:#000,stroke-width:2px style InSkinSet fill:#ffcc00,stroke:#000,stroke-width:2px style EvaluateHierarchy fill:#99ccff,stroke:#000,stroke-width:2px style IsLastJnt fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The isIt_LastSkinJnt function follows this sequence:

  1. The process starts and immediately checks if the given object is a joint.

  2. If it’s a joint, the function checks if it’s part of the skin joints set.

  3. If the joint is in the set, the function evaluates the joint’s position in the hierarchy.

  4. Based on the evaluation, the function determines if it’s the last joint in the hierarchy.

  5. The process concludes by returning True if it’s the last joint, or False otherwise.

HyperSkin.isJnt(self, obj)#

[**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.

HyperSkin.isLastJnt(self, jnt, numFromEnd=0, childImplied=True)#

[shArgs : none]

Purpose:

:: Determines if a given joint is the last joint in a hierarchy in Autodesk Maya.

  • Checks if the joint has any children joints or if it’s a specific number of joints away from the end of a joint chain.

  • Useful in rigging scenarios where specific joint hierarchy structures are required.

Parameters:
  • jnt – <str> # Name of the joint to be evaluated.

  • numFromEnd – <int> # Specifies the number of joints from the end of the joint chain. Defaults to 0 (last joint).

  • childImplied – <bool> # Determines whether implied child joints should be considered in the evaluation.

Usage Example:

>>> isLastJnt('joint1', numFromEnd=0, childImplied=True)
# Checks if 'joint1' is the last joint in its hierarchy considering implied children.
Flow Chart Description:

The isLastJnt function follows these steps:

  1. Verify if the input object is a joint.

  2. If childImplied is True, check for implied child joints and return False if any are found.

  3. Determine if the joint is the last one in the hierarchy or a specific number of joints from the end (numFromEnd).

  4. Return True if the joint meets the criteria, otherwise return False.

graph TB Start[("fa:fa-play Start")] --> VerifyJointType["/fas:fa-check-circle Verify Joint Type"] VerifyJointType --> CheckChildImplied{"/fas:fa-question-circle Check Child Implied"} CheckChildImplied --"If True"--> CheckForImpliedChildren["/fas:fa-child Check For Implied Children"] CheckChildImplied --"If False"--> DetermineJointPosition["/fas:fa-arrows-alt Determine Joint Position"] CheckForImpliedChildren --> DetermineJointPosition DetermineJointPosition --> ReturnResult{"/fas:fa-flag-checkered Return Result"} ReturnResult --> True["/fas:fa-thumbs-up True"] ReturnResult --> False["/fas:fa-thumbs-down False"] True --> End[("fas:fa-stop End")] False --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style VerifyJointType fill:#99ccff,stroke:#000,stroke-width:2px style CheckChildImplied fill:#ffcc00,stroke:#000,stroke-width:2px style CheckForImpliedChildren fill:#cc99ff,stroke:#000,stroke-width:2px style DetermineJointPosition fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnResult fill:#ffcc00,stroke:#000,stroke-width:2px style True fill:#99ff99,stroke:#000,stroke-width:2px style False fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

A boolean value indicating whether the joint is the last one in its hierarchy or at a specific position from the end.

HyperSkin.isMesh(self, obj)#

[**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.

HyperSkin.isSkinJnt(self, jnt, skinMesh)#

[shArgs : none]

Purpose:

:: Determines whether a given joint is a skinning joint for a specified mesh in Autodesk Maya.

  • Useful for verifying if a joint contributes to the deformation of a skin mesh.

  • Aids in rigging and skinning processes by identifying relevant joints.

Usage Example:

>>> isSkinJnt('joint1', 'mesh1')
# Returns True if 'joint1' is a skinning joint for 'mesh1', otherwise False.
Parameters:

  • param jnt:

    <str> #The name of the joint to check.

  • param skinMesh:

    <str> #The name of the skin mesh to check against.

Return:

  • <bool> #True if the joint is a skinning joint for the specified mesh, False otherwise.

Note:

  • The function requires both the joint and the skin mesh to be specified.

  • It is essential for the skin mesh to have a skinCluster deformer for the function to work correctly.

graph TB Start[("fa:fa-play Start")] --> CheckJointType{"/fas:fa-question-circle Check if Joint"} CheckJointType --"If Not Joint"--> ReturnFalse["/fas:fa-times Return False"] CheckJointType --"If Joint"--> CheckSkinCluster{"/fas:fa-search Check for SkinCluster"} CheckSkinCluster --"No SkinCluster"--> ReturnTrue["/fas:fa-check Return True"] CheckSkinCluster --"Has SkinCluster"--> CheckInfluence{"/fas:fa-balance-scale Check if Joint is Influence"} CheckInfluence --"Not Influence"--> ReturnFalse CheckInfluence --"Is Influence"--> ReturnTrue ReturnFalse --> End[("fas:fa-stop End")] ReturnTrue --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckJointType fill:#ffcc00,stroke:#000,stroke-width:2px style ReturnFalse fill:#ff6666,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style CheckInfluence fill:#99ccff,stroke:#000,stroke-width:2px style ReturnTrue fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the isSkinJnt function:

  1. The process starts and checks if the provided joint is actually a joint.

  2. If not a joint, it returns False.

  3. If it’s a joint, it then checks if the skin mesh has a skinCluster.

  4. If no skinCluster is found, it returns True (assuming the joint can be a skinning joint).

  5. If there is a skinCluster, it checks if the joint is an influence of the skinCluster.

  6. If the joint is not an influence, it returns False.

  7. If the joint is an influence, it returns True.

  8. The process ends after returning the result.

HyperSkin.isSkinned(self, obj)#

[**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.

HyperSkin.isolateHyperDiscGrps(self)#

[shArgs : none]

Purpose:

:: Isolates Hyper Disc Groups in Autodesk Maya by hiding or showing specific groups based on the selection.

  • If objects are selected, only their corresponding Hyper Disc Groups are displayed, while others are hidden.

  • If no objects are selected, all Hyper Disc Groups are shown, undoing any previous isolation.

  • Enhances scene management by allowing selective focus on specific Hyper Disc Groups.

Usage Example:

>>> isolateHyperDiscGrps()
# Toggles the visibility of Hyper Disc Groups based on the current selection in Maya.
Parameters:

  • None. The function operates based on the current selection in the Maya scene.

Return:

  • None. This function’s primary operation is to modify the visibility of Hyper Disc Groups in the Maya scene.

Note:

  • When objects are selected, their corresponding Hyper Disc Groups are isolated by being made visible, and others are hidden.

  • When no objects are selected, all Hyper Disc Groups become visible, effectively resetting the isolation.

  • This function is useful in scenarios where focusing on specific parts of a rig or model is necessary, and other parts need to be temporarily hidden for clarity.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Selection"} CheckSelection -- "Objects Selected" --> IsolateSelectedGroups["/fas:fa-eye-slash Isolate Selected Groups"] CheckSelection -- "No Objects Selected" --> ShowAllGroups["/fas:fa-eye Show All Groups"] IsolateSelectedGroups --> End[("fas:fa-stop End")] ShowAllGroups --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style IsolateSelectedGroups fill:#99ff99,stroke:#000,stroke-width:2px style ShowAllGroups fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for the isolateHyperDiscGrps function illustrates:

  1. The start of the process, leading to a check on whether any objects are selected in the Maya scene.

  2. If objects are selected, the function isolates their corresponding Hyper Disc Groups, making them visible and hiding others.

  3. If no objects are selected, the function resets the isolation by showing all Hyper Disc Groups.

  4. The process ends after either isolating specific groups or showing all groups.

HyperSkin.mConstrain(self, objList, conList, offSet=True, wVal=1, **kwargs)#

[shArgs : ol=objList, cl=conList, os=offSet, wv=wVal, upl=usePosLoc]

Purpose:

:: Applies various types of constraints to a list of objects with additional control over offset, weight, and position.

  • Facilitates complex rigging setups by allowing multiple constraint types to be applied to objects.

  • Enhances control over animation and rigging by providing additional parameters like offset and weight.

Parameters:
  • objList – <list> List of objects to apply constraints to.

  • conList

    <list, default=[‘parent’]> Types of constraints to apply <e.g., ‘parent’, ‘point’>.

    conList = ‘point’ | ‘orient’ | ‘parent’ | ‘scale’ | ‘geometry’ | ‘normal | ‘tangent’ | ‘aim’ | ‘poleVector’ |

  • offSet – <bool, default=True> Whether to apply an offset to the constraint.

  • wVal – <float, default=1> Weight value for the constraint.

  • usePosLoc – <int, default=1> Determines whether to use position locator.

**kwargskwargs:

<dict> Additional keyword arguments for more control.

Returns:

<list> Returns a list containing the constraint node(s) and, optionally, the weight alias list.

aimConstrain Example:

aimConstraint(worldUpType="none", aimVector=(0, 0, 1), upVector=(0, 1, 0), weight=1, offset=(0, 0, 0))

Returns:

if len(conList) == 1 and len(objList) > 2:
        return [conNode, conNode.getWeightAliasList()]
else:
        return [conNode]

Code Examples:

>>> object_list = ["obj1", "obj2", "obj3"]
>>> constraint_types = ['parent', 'point']
>>> offset = True
>>> weight_value = 1
>>> use_position_locator = 1
>>> mConstrain(object_list, constraint_types, offset, weight_value, use_position_locator)
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style PrepareConstraints fill:#ff9999,stroke:#000,stroke-width:2px style ApplyConstraints fill:#99ccff,stroke:#000,stroke-width:2px style SetConstraintTypes fill:#99ff99,stroke:#000,stroke-width:2px style ReturnConstraintNodes fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> PrepareConstraints["/fas:fa-cogs Prepare Constraints"] CheckShArgs --"If shArgs not provided"--> PrepareConstraints PrepareConstraints --> ApplyConstraints["/fas:fa-link Apply Constraints"] ApplyConstraints --> SetConstraintTypes["/fas:fa-sliders-h Set Constraint Types"] SetConstraintTypes --> ReturnConstraintNodes["/fas:fa-code Return Constraint Nodes"] ReturnConstraintNodes --> End[("fas:fa-stop End")]
Flow Chart Description:

This flowchart illustrates the mConstrain function:

  1. The process starts by checking if kwargs are provided, updating parameters like objList, conList, offSet, wVal, and usePosLoc.

  2. It prepares the objects and constraint types based on the provided parameters.

  3. Constraints are applied to the objects with the specified types and settings.

  4. The types of constraints are set, including any special handling for specific constraint types like ‘parent’ or ‘orient’.

  5. The function concludes by returning a list containing the constraint node(s) and, if applicable, the weight alias list.

HyperSkin.mDistance(self, srcObj, destObj, srcType='obj', destType='obj', giveNode=False)#

[shArgs : none]

Objective:

:: Calculates the distance between two objects or positions in Autodesk Maya, with an option to return the distance node.

  • Measures the distance either between two objects, two positions, or one object and one position.

  • Useful in rigging, animation, and scripting where precise distance measurements are required.

Return:

return [mDist, locList, distNode, distShape, distAttr]  #_ If giveNode is True
return [mDist]                                                                                  #_ If giveNode is False

Usage Example:

>>> mDistance('pSphere1', 'pCube1', srcType='obj', destType='obj', giveNode=True)
# Returns the distance between 'pSphere1' and 'pCube1' and creates a distance node.
Flow Chart Description:

The mDistance function performs the following steps:

  1. Retrieves the source and destination positions.

  2. Calculates the Euclidean distance between these two points.

  3. If giveNode is True, creates a distance dimension node to visualize the distance in the Maya scene.

  4. Returns the distance value and, optionally, the distance node and related information.

graph TB Start[("fa:fa-play Start")] --> RetrieveSourcePosition["/fas:fa-crosshairs Retrieve Source Position"] RetrieveSourcePosition --> RetrieveDestinationPosition["/fas:fa-crosshairs Retrieve Destination Position"] RetrieveDestinationPosition --> CalculateDistance["/fas:fa-ruler-combined Calculate Distance"] CalculateDistance --> CheckGiveNode{"/fas:fa-question-circle Check Give Node"} CheckGiveNode --"If True"--> CreateDistanceNode["/fas:fa-project-diagram Create Distance Node"] CheckGiveNode --"If False"--> ReturnDistance["/fas:fa-ruler Return Distance"] CreateDistanceNode --> ReturnDistanceAndNodeInfo["/fas:fa-ruler-horizontal Return Distance and Node Info"] ReturnDistance --> End[("fas:fa-stop End")] ReturnDistanceAndNodeInfo --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveSourcePosition fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveDestinationPosition fill:#99ccff,stroke:#000,stroke-width:2px style CalculateDistance fill:#99ccff,stroke:#000,stroke-width:2px style CheckGiveNode fill:#ffcc00,stroke:#000,stroke-width:2px style CreateDistanceNode fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnDistance fill:#99ff99,stroke:#000,stroke-width:2px style ReturnDistanceAndNodeInfo fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.mFreeze(self, objName, t=1, r=1, s=1)#

[shArgs : on=objName, t=translate, r=rotate, s=scale]

Purpose:

:: Freezes transformations on an object, including translation, rotation, and scale.

  • Essential for cleaning up and standardizing object transformations in 3D modeling and animation.

  • Helps in resetting the transformation values to zero without changing the object’s position, rotation, or scale in the scene.

Parameters:
  • objName – <str> # The name of the object to freeze transformations on.

  • t – <int, optional> # Flag to freeze translation, 1 for true, 0 for false.

  • r – <int, optional> # Flag to freeze rotation, 1 for true, 0 for false.

  • s – <int, optional> # Flag to freeze scale, 1 for true, 0 for false.

Returns:

None # This function does not return any value.

Code Examples:

>>> object_name = "model_part"
>>> freeze_translation = 1
>>> freeze_rotation = 1
>>> freeze_scale = 1
>>> mFreeze(object_name, freeze_translation, freeze_rotation, freeze_scale)
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SelectObject fill:#ff9999,stroke:#000,stroke-width:2px style ApplyFreezeTransforms fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> SelectObject["/fas:fa-mouse-pointer Select Object"] CheckShArgs --"If shArgs not provided"--> SelectObject SelectObject --> ApplyFreezeTransforms["/fas:fa-snowflake Apply Freeze Transforms"] ApplyFreezeTransforms --> End[("fas:fa-stop End")]
Flow Chart Description:

This flowchart illustrates the mFreeze function:

  1. The process begins by checking if shArgs are provided, updating parameters like objName, t, r, and s.

  2. The specified object is selected.

  3. Transformations are frozen on the object based on the provided flags for translation, rotation, and scale.

  4. The function concludes after applying the freeze transformations.

HyperSkin.mapRange(self, inputVal, minIN, maxIN, minOUT, maxOUT)#

[shArgs : none]

Purpose:

:: Remaps an input value from one range to another range in Autodesk Maya. This function can handle normal and inverse ranges.

  • Useful for adapting values to different scales, particularly in rigging and animation.

  • Can handle both regular and inverted ranges for both input and output.

Parameters:
  • inputVal – <float> #Input value to be remapped.

  • minIN – <float> #Minimum value of the input range.

  • maxIN – <float> #Maximum value of the input range.

  • minOUT – <float> #Minimum value of the output range.

  • maxOUT – <float> #Maximum value of the output range.

Usage Example:

>>> mapRange(1.2, 1.0, 2.0, 10.0, 20.0)
# Remaps 1.2 from the range 1.0 to 2.0 to the corresponding value in the range 10.0 to 20.0.

Note: - The function is versatile, handling various mapping scenarios including reverse mapping where output range is inverted. - It’s essential for creating versatile tools in Maya that require value remapping.

Flow Chart Description:

The flowchart for the mapRange function:

  1. Starts by determining the range of the input and output values.

  2. Scales the input value according to the input range.

  3. Calculates the corresponding value in the output range.

  4. Clamps the output value within the specified output range.

  5. Returns the remapped value.

graph TB Start[("fa:fa-play Start")] --> DetermineRanges["/fas:fa-ruler-combined Determine Ranges"] DetermineRanges --> ScaleInputValue["/fas:fa-arrows-alt-h Scale Input Value"] ScaleInputValue --> CalculateOutputValue["/fas:fa-calculator Calculate Output Value"] CalculateOutputValue --> ClampOutputValue["/fas:fa-compress-arrows-alt Clamp Output Value"] ClampOutputValue --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineRanges fill:#99ccff,stroke:#000,stroke-width:2px style ScaleInputValue fill:#99ccff,stroke:#000,stroke-width:2px style CalculateOutputValue fill:#99ff99,stroke:#000,stroke-width:2px style ClampOutputValue fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px

Now Supports inverted / reverse out put range where maxOUT is less than minOUT

Examples: Normal Range: ============= HyperSkin.mapRange(0.95, 0.90, 1.65, 0.50, 0.99) #_ [0.95, [0.90 -> 1.65], [0.50 -> 0.99]] HyperSkin.mapRange(0.95, 0.90, 1.65, 0.50, 0.99) # 0.5326 HyperSkin.mapRange(1.60, 0.90, 1.65, 0.50, 0.99) # 0.9573 HyperSkin.mapRange(inputVal=1.60, minIN=0.9, maxIN=1.65, minOUT=0.5, maxOUT=0.99)

Inverse In Range:#

HyperSkin.mapRange(0.95, 1.65, 0.90, 0.50, 0.99) # 0.9573 HyperSkin.mapRange(1.60, 1.65, 0.90, 0.50, 0.99) # 0.5326 HyperSkin.mapRange(inputVal=1.60, minIN=1.65, maxIN=0.90, minOUT=0.50, maxOUT=0.99)

Inverse Out Range:#

HyperSkin.mapRange(0.95, 0.90, 1.65, 0.99, 0.50) # 0.9573 HyperSkin.mapRange(1.60, 0.90, 1.65, 0.99, 0.50) # 0.5326 HyperSkin.mapRange(inputVal=0.95, minIN=0.90, maxIN=1.65, minOUT=0.99, maxOUT=0.5) HyperSkin.mapRange(inputVal=1.60, minIN=0.90, maxIN=1.65, minOUT=0.99, maxOUT=0.5)

Inverse In & Out Ranges:#

HyperSkin.mapRange(0.95, 1.65, 0.90, 0.99, 0.50) #_ 0.5326 HyperSkin.mapRange(1.60, 1.65, 0.90, 0.99, 0.50) #_ 0.9573

HyperSkin.message(self, messageTxt)#

Sends a given message through confirmDialog window

HyperSkin.mirrorSkin(self, LPrfx='L_', RPrfx='R_', left2right=True, dirAxis='x')#

[shArgs : none]

Purpose:

:: Mirrors skin weights from one side of a character to the other in Autodesk Maya.

  • Essential for symmetrical characters, ensuring consistent deformation on both sides.

  • Provides options for different axes and directions, accommodating various character orientations.

  • Automatically handles joint renaming and skinCluster adjustments for mirrored joints.

Parameters:
  • LPrfx – (<str>) #Prefix for left-side joints (e.g., ‘L_’).

  • RPrfx – (<str>) #Prefix for right-side joints (e.g., ‘R_’).

  • left2right – (<bool>) #Direction of mirroring: True for left-to-right, False for right-to-left.

  • dirAxis – (<str>) #Axis along which mirroring occurs (e.g., ‘x’).

Return:

  • None. The function performs the mirroring operation in the Maya scene.

Note:

  • Ensure correct joint naming conventions for accurate mirroring.

  • It’s recommended to backup the scene before performing skin weight mirroring.

Usage Example::
>>> mirrorSkin('L_', 'R_', True, 'x')
# Mirrors skin weights from left to right along the x-axis.
graph TB Start[("fa:fa-play Start")] --> ValidateSelection{"/fas:fa-check-circle Validate Selection"} ValidateSelection --"If Valid"--> MirrorWeights["/fas:fa-exchange-alt Mirror Weights"] ValidateSelection --"If Invalid"--> Error{"/fas:fa-times-circle Error"} MirrorWeights --> AdjustSkinCluster["/fas:fa-sliders-h Adjust SkinCluster"] AdjustSkinCluster --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ValidateSelection fill:#ffcc00,stroke:#000,stroke-width:2px style MirrorWeights fill:#99ccff,stroke:#000,stroke-width:2px style AdjustSkinCluster fill:#99ff99,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the mirrorSkin function:

  1. The process starts and validates the selection to ensure it’s appropriate for mirroring.

  2. If the selection is valid, the function mirrors the skin weights according to the specified parameters.

  3. After mirroring, it adjusts the skinCluster to reflect the new weights.

  4. If the selection is invalid, it displays an error message.

  5. The process ends after mirroring and adjustments or if an error occurs.

HyperSkin.move2ClosestPoint(self, loc, mesh)#

Note: Mesh should be freezed for correct snapping

[shArgs : l=loc, m=mesh]

Purpose:

:: Moves a locator to the closest point on a given mesh. The mesh must be freezed for accurate positioning.

  • This function snaps a locator to the nearest point on a specified mesh.

  • It is important to ensure that the mesh is frozen for correct snapping results.

Parameters:
  • loc – <str> #The name of the locator object to be moved.

  • mesh – <str> #The name of the mesh object to which the locator will snap.

Returns:

None #This function does not return a value but moves the locator to the closest point on the mesh.

Code Examples:

>>> locator = "locator1"
>>> mesh_obj = "mesh1"
>>> move2ClosestPoint(locator, mesh_obj)

Note: - Mesh should be freezed for correct snapping.

graph TB Start[("fa:fa-play Start")] --> DisableSoftSelect[/fas:fa-toggle-off Disable Soft Select/] DisableSoftSelect --> CreateCPOMNode[/fas:fa-plus-circle Create 'closestPointOnMesh' Node/] CreateCPOMNode --> GetLocPosition[/fas:fa-map-marker-alt Get Locator Position/] GetLocPosition --> SetInitialCPOMPos[/fas:fa-location-arrow Set Initial Position of CPOM/] SetInitialCPOMPos --> SetCPOMInteresting[/fas:fa-star Set CPOM as Historically Interesting/] SetCPOMInteresting --> ConnectCPOMToMesh[/fas:fa-link Connect CPOM to Mesh/] ConnectCPOMToMesh --> GetTargetPosition[/fas:fa-crosshairs Get Target Position on Mesh/] GetTargetPosition --> MoveLocToTargetPos[/fas:fa-arrows-alt Move Locator to Target Position/] MoveLocToTargetPos --> DeleteCPOMNode[/fas:fa-trash-alt Delete CPOM Node/] DeleteCPOMNode --> End[("fas:fa-stop End")]
Flow Chart Description:

This flowchart illustrates the move2ClosestPoint function:

  1. The function begins by disabling the soft select feature.

  2. It creates a ‘closestPointOnMesh’ (CPOM) node.

  3. The locator’s position is retrieved.

  4. The CPOM node’s initial position is set to the locator’s position.

  5. The CPOM node is set as historically interesting.

  6. The function connects the CPOM node to the specified mesh to get the nearest position on the mesh.

  7. It retrieves the target position (X, Y, Z) from the CPOM node.

  8. The locator is then moved to this target position on the mesh.

  9. Finally, the CPOM node is deleted as it is no longer needed.

HyperSkin.name(self, mNode)#

[shArgs : mn=mNode]

Purpose:

:: Retrieves the short name of an object, excluding its full path.

Argument | Description:

:param mNode: (<type str>) # The object from which to retrieve the name.

:return: (<type str>) # The short name of the object, excluding the full path.

Code Examples:

>>> object_name = "|group1|mesh1"  # Example full path
>>> short_name = name(object_name)
# Returns 'mesh1'
h 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 --> RetrieveShortName{"/fas:fa-file Retrieve Short Name"} RetrieveShortName --"Retrieve Short Name"--> 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 RetrieveShortName fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the name function:

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

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

  • Retrieves the short name of the object, excluding its full path.

HyperSkin.nearestVtxOnMesh_vtxList(self, srcObjOrPos='srcObjOrPos', trgtMesh='trgtMesh', excludeList=None, skipDir=None, precision=1, vtxList=None)#

[shArgs : so=srcObjOrPos, tm=trgtMesh, el=excludeList, sd=skipDir, p=precision, vl=vtxList]

Purpose:

:: This function calculates the closest vertex on a target mesh from a source object or position,

taking into consideration an optional list of vertices to exclude and a direction to skip. It also allows for varying levels of precision and optionally works with a predefined list of vertices.

  • Given a source object or position, this function identifies the nearest vertex on a specified target mesh.

  • The function allows excluding certain vertices and skipping specific directions in the search process.

  • It supports adjusting the precision level of the search and can operate on a pre-defined list of vertices.

Parameters:
  • srcObjOrPos – <str/list> #Source object or position in 3D space. If a string is provided, it is assumed to be a node from which the position will be extracted.

  • trgtMesh – <str> #Target mesh to find the nearest vertex on.

  • excludeList – <list, optional> #List of vertices to exclude from the search.

  • skipDir – <str/list, optional> #Direction or list of directions to skip in the search.

  • precision – <int> #The precision level of the search, determining how extensively the mesh is examined.

  • vtxList – <list, optional> #An optional list of vertices to consider in the search, allowing for a more focused approach.

Returns:

<list> #A list containing the nearest vertex node and its numerical index on the target mesh. | return [hsNode(nVtx), int(nNum)]

Code Examples:

>>> source_obj_or_pos = [1, 2, 3]
>>> target_mesh = "mesh1"
>>> exclude_list = [1, 3, 5]
>>> nearest_vertex_info = nearestVtxOnMesh_vtxList(source_obj_or_pos, target_mesh, exclude_list)
>>> print(nearest_vertex_info)
graph TB Start[("fa:fa-play Start")] --> ConvertTrgtMesh[/fas:fa-sitemap Convert trgtMesh to hsNode/] ConvertTrgtMesh --> ConvertSrcPos[/fas:fa-arrows-alt Convert srcObjOrPos to hsNode or use as list/] ConvertSrcPos --> InitFnMesh[/fas:fa-project-diagram Initialize MFnMesh with trgtMesh MDagPath/] InitFnMesh --> SetRefPnt[/fas:fa-map-marker-alt Set Reference Point from srcPos/] SetRefPnt --> InitScriptUtil[/fas:fa-scroll Initialize MScriptUtil/] InitScriptUtil --> TryGetClosestPoint{"/fas:fa-code Try to Get Closest Point on Mesh"} TryGetClosestPoint --"If successful"--> SelectFaceOnMesh[/fas:fa-mouse-pointer Select Face on trgtMesh/] TryGetClosestPoint --"If exception occurs"--> CheckVtxList{"/fas:fa-list-ol Check if vtxList is provided"} SelectFaceOnMesh --> ConvertSelectionToVertices[/fas:fa-expand-arrows-alt Convert Selection to Vertices/] CheckVtxList --"If vtxList is provided"--> ReturnNearestVtxFromList[/fas:fa-crosshairs Return Nearest Vertex from vtxList/] CheckVtxList --"If vtxList is not provided"--> ShowErrorDialog[/fas:fa-exclamation-triangle Show Error Dialog/] ConvertSelectionToVertices --> CheckPrecisionRange[/fas:fa-ruler-combined Check Precision Range/] CheckPrecisionRange --> GrowSelection[/fas:fa-expand-alt Grow Polygon Selection Region based on Precision/] GrowSelection --> CreateVtxList[/fas:fa-list-ol Create Vertex List from Selection/] CreateVtxList --> CheckExcludeList{"/fas:fa-times-circle Check if Exclude List is provided"} CheckExcludeList --"If excludeList is provided"--> ProcessExcludeList[/fas:fa-filter Process Exclude List/] CheckExcludeList --"If no excludeList"--> FindNearestVtxOnMesh[/fas:fa-search-plus Find Nearest Vertex on Mesh/] ProcessExcludeList --> FilterVtxList[/fas:fa-ban Filter Out Excluded Vertices from vtxList/] FilterVtxList --> FindNearestVtxOnMesh ReturnNearestVtxFromList --> End[("fas:fa-stop End")] ShowErrorDialog --> End FindNearestVtxOnMesh --> ReturnResult[/fas:fa-share-square Return [Nearest Vertex, Vertex Number]/] ReturnResult --> End
Flow Chart Description:

This flowchart illustrates the nearestVtxOnMesh_vtxList function:

  1. The process starts by converting trgtMesh and srcObjOrPos into hsNode objects or using them as lists.

  2. It initializes an MFnMesh object with the MDagPath of trgtMesh and sets a reference point from srcPos.

  3. The function attempts to find the closest point on the mesh to the reference point. If successful, it selects the corresponding face on the trgtMesh.

  4. If an exception occurs, it checks if a vtxList is provided. If provided, it returns the nearest vertex from this list; otherwise, it shows an error dialog.

  5. The function converts the selected face to vertices and adjusts the precision of the selection based on the precision parameter.

  6. If an excludeList is provided, it processes this list to filter out the excluded vertices from the vtxList.

  7. Finally, it finds the nearest vertex on the mesh and returns the vertex along with its numerical index.

HyperSkin.nearestVtx_OnMesh(self, srcObjOrPos='srcObjOrPos', trgtMesh='trgtMesh', excludeList=None, skipDir=None, precision=1)#

[shArgs : aop=aimObjOrPos, tm=trgtMesh, el=excludeList, sd=skipDir, pr=precision, vl=vtxList]

Purpose:

:: Finds the nearest vertex on a target mesh relative to a given source point or object, with options for precision and exclusions.

  • The function calculates the closest vertex to the specified point or object on a given mesh.

  • Options for specifying a list of vertices to consider and skipping certain directions are provided.

Parameters:
  • aimObjOrPos – <str/object/list> #The source point or object for finding the nearest vertex.

  • trgtMesh – <str/object> #The target mesh on which the nearest vertex is to be found.

  • excludeList – <list, optional> #List of vertex indices to exclude from the search.

  • skipDir – <str, optional> #Direction to skip in the search (e.g., ‘+x’, ‘-y’).

  • precision – <int, optional> #Precision level for the search.

  • vtxList – <list, optional> #List of specific vertices on the target mesh to consider.

Returns:

<list> #A list containing the nearest vertex as an asNode and its index. [hsNode(nVtx), int(nNum)]

Code Examples:

>>> nearestVtx_OnMesh('locator1', 'mesh1', excludeList=[10, 20], skipDir='+x', precision=1, vtxList=[1, 2, 3])
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> UpdateParameters["/fas:fa-sync-alt Update Parameters"] CheckShArgs --"If shArgs not provided"--> AsNodeTrgtMesh["/fas:fa-project-diagram Convert trgtMesh to asNode"] UpdateParameters --> AsNodeTrgtMesh AsNodeTrgtMesh --> DetermineSrcPos["/fas:fa-crosshairs Determine Source Position"] DetermineSrcPos --> InitializeFnMesh["/fas:fa-sitemap Initialize MFnMesh"] InitializeFnMesh --> CheckVtxList["/fas:fa-list Check vtxList"] CheckVtxList --"If vtxList provided"--> GetNearestVtx["/fas:fa-location-arrow Get Nearest Vertex"] CheckVtxList --"If vtxList not provided"--> TryGetClosestPoint["/fas:fa-map-pin Try Get Closest Point"] GetNearestVtx --> ReturnResult["/fas:fa-check Return Result"] TryGetClosestPoint --"If successful"--> SelectFaceNum["/fas:fa-th Select Face Number"] TryGetClosestPoint --"If error"--> HandleError["/fas:fa-exclamation-triangle Handle Error"] SelectFaceNum --> ConvertSelectionToVertices["/fas:fa-code-branch Convert Selection to Vertices"] HandleError --> End[("fas:fa-stop End")] ConvertSelectionToVertices --> CheckPrecision["/fas:fa-sliders-h Check Precision"] CheckPrecision --> GrowSelection["/fas:fa-expand-arrows-alt Grow Selection"] GrowSelection --> FilterVtxList["/fas:fa-filter Filter Vertex List"] FilterVtxList --> CheckExcludeList["/fas:fa-minus-circle Check Exclude List"] CheckExcludeList --"If excludeList provided"--> RemoveExcluded["/fas:fa-trash-alt Remove Excluded"] CheckExcludeList --"If excludeList not provided"--> GetFinalNearestVtx["/fas:fa-search-plus Get Final Nearest Vertex"] RemoveExcluded --> GetFinalNearestVtx GetFinalNearestVtx --> ReturnResult ReturnResult --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#ff9999,stroke:#000,stroke-width:2px style AsNodeTrgtMesh fill:#99ccff,stroke:#000,stroke-width:2px style DetermineSrcPos fill:#cc99ff,stroke:#000,stroke-width:2px style InitializeFnMesh fill:#99ff99,stroke:#000,stroke-width:2px style CheckVtxList fill:#ffcc99,stroke:#000,stroke-width:2px style GetNearestVtx fill:#ccffcc,stroke:#000,stroke-width:2px style TryGetClosestPoint fill:#ff9999,stroke:#000,stroke-width:2px style SelectFaceNum fill:#99ccff,stroke:#000,stroke-width:2px style HandleError fill:#cc99ff,stroke:#000,stroke-width:2px style ConvertSelectionToVertices fill:#99ff99,stroke:#000,stroke-width:2px style CheckPrecision fill:#ffcc99,stroke:#000,stroke-width:2px style GrowSelection fill:#ccffcc,stroke:#000,stroke-width:2px style FilterVtxList fill:#ff9999,stroke:#000,stroke-width:2px style CheckExcludeList fill:#99ccff,stroke:#000,stroke-width:2px style RemoveExcluded fill:#cc99ff,stroke:#000,stroke-width:2px style GetFinalNearestVtx fill:#99ff99,stroke:#000,stroke-width:2px style ReturnResult fill:#ffcc99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the nearestVtx_OnMesh function:

  1. The function begins by checking if shArgs are provided, updating parameters accordingly.

  2. It converts the target mesh and source position into asNode format for processing.

  3. Initializes an MFnMesh object for the target mesh.

  4. Checks if a vertex list (vtxList) is provided to directly find the nearest vertex.

  5. If vtxList is not provided, attempts to find the closest point on the mesh.

  6. In case of an error during point finding, an error handling procedure is followed.

  7. It converts the mesh selection to vertices, adjusts the precision of the search, and filters the vertex list.

  8. If an exclude list is provided, it removes those vertices from consideration.

  9. Finally, the function finds the nearest vertex and returns the result.

HyperSkin.old_extractNum(self, objName)#

Returns:#

the extracted number from end of the object name

Usage:#

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

HyperSkin.old_getMDagPath(self, obj)#
HyperSkin.old_getMPoint(self, obj)#
HyperSkin.old_progressWin(self, currentItem=None, endProgress=0, showProgressTime=1, useProgress=1, **shArgs)#
HyperSkin.old_startProgressWin(self, numObjs, winTitle='Please Wait ..!', progressNote='Progress : 0%', doInterrupt=True, useProgress=1, **shArgs)#
HyperSkin.openPythonScripting(self)#

[shArgs : none]

Purpose:

:: Opens the HyperSkin about page and redirects to the HyperSkin website in Autodesk Maya.

  • Provides information about the HyperSkin tool and its features.

  • Useful for users seeking additional details or support for the HyperSkin tool.

Usage Example:

>>> openPythonScripting()
# Displays the about page for HyperSkin and navigates to the HyperSkin website.
Flow Chart Description:

The openPythonScripting function follows these steps:

  1. Trigger the about page of HyperSkin within Maya.

  2. Open the default web browser and navigate to the HyperSkin website.

graph TB Start[("fa:fa-play Start")] --> ShowAboutPage["/fas:fa-info-circle Show HyperSkin About Page"] ShowAboutPage --> OpenWebsite["/fas:fa-globe Open HyperSkin Website"] OpenWebsite --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ShowAboutPage fill:#99ccff,stroke:#000,stroke-width:2px style OpenWebsite fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

None. This function opens the HyperSkin about page and the website but does not return any value.

HyperSkin.parentChild_ByImplied(self, chd=None, prnt=None, removeAttrs=False, dscChd=False, **shArgs)#

[shArgs : c=chd, p=prnt, ra=removeAttrs, dc=dscChd]

Purpose:

:: Establishes a parent-child relationship between two Autodesk Maya objects (typically joints) using implied attributes.

  • This function is particularly useful for rigging in Maya, allowing users to define relationships between joints without physically parenting them.

  • It supports adding custom attributes to denote the parent-child relationship and offers the flexibility to remove these attributes.

Parameters:
  • chd – <str> #Child object in the implied parent-child relationship. If None, selected objects are used.

  • prnt – <str> #Parent object in the implied parent-child relationship. If None, selected objects are used.

  • removeAttrs – <bool> (default False) #If True, removes the ‘mChd’ and ‘mPrnt’ attributes from selected objects.

  • dscChd – <bool> (default False) #Determines if the child is a descendant (True) or immediate child (False) of the parent.

Returns:

None #The function does not return a value but modifies the selected or specified objects.

Usage Example:

>>> parentChild_ByImplied('joint1', 'joint2')
# Establishes an implied parent-child relationship between 'joint1' (child) and 'joint2' (parent).
    #_ Select child joint(implied) first and then parent joint (implied)
    HyperSkin.parentChild_ByImplied(hsN._selected()[0], hsN._selected()[1])

Note: - This function is essential for advanced rigging setups where physical parenting may not be desired or feasible. - It provides a non-destructive way to define hierarchical relationships, offering greater control over rigging structures.

Flow Chart Description:

The flowchart for the parentChild_ByImplied function:

  1. Receive child and parent objects or use selected objects.

  2. Check for existing attributes and delete if required.

  3. Create custom attributes to denote parent-child relationship.

  4. Connect attributes to establish the implied relationship.

  5. Display completion message.

graph TB Start[("fa:fa-play Start")] --> ReceiveData{Receive Data} ReceiveData --"Data Received"--> CheckAttrs{Check Existing Attributes} CheckAttrs --"Remove Attributes"--> RemoveAttrs[Remove Custom Attributes] CheckAttrs --"Attributes OK"--> CreateAttrs[Create Custom Attributes] RemoveAttrs --> CreateAttrs CreateAttrs --> ConnectAttrs[Connect Attributes] ConnectAttrs --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ReceiveData fill:#99ccff,stroke:#000,stroke-width:2px style CheckAttrs fill:#ff9999,stroke:#000,stroke-width:2px style RemoveAttrs fill:#ffcc99,stroke:#000,stroke-width:2px style CreateAttrs fill:#99ff99,stroke:#000,stroke-width:2px style ConnectAttrs fill:#ffccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.progressReset(self)#

[shArgs : none]

Purpose:

:: Resets the global progress value to zero in Autodesk Maya, typically used in processes like rigging or animation.

  • Essential for resetting progress tracking in scripts where repeated operations or loops are involved.

  • Ensures accurate progress reporting in tools or scripts that provide feedback on completion of tasks.

Usage Example:

>>> progressReset()
# Resets the global progress value to zero.
Flow Chart Description:

This flowchart describes the progressReset function:

  1. The function begins and immediately resets the global variable ‘topProgressValue’ to zero.

  2. This action effectively resets any progress tracking mechanism that relies on this global variable.

  3. The process completes immediately after the reset.

graph TB Start[("fa:fa-play Start")] --> ResetProgress["/fas:fa-sync-alt Reset Progress Value"] ResetProgress --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ResetProgress fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.progressWin(self, currentItem=None, endProgress=0, showProgressTime=0, innerObjs=False, innerList=None, refreshView=0, useProgress=1, outerList=None, **shArgs)#

[shArgs : ci=currentItem, ep=endProgress, spt=showProgressTime, io=innerObjs, il=innerList, rv=refreshView, up=useProgress, ol=outerList]

Purpose:

:: Manages and updates a custom progress window in Autodesk Maya, often used in complex scripts involving long processes.

  • Keeps track of the progress of tasks in a visual and informative way.

  • Provides options to show elapsed time, handle nested progress (inner and outer lists), and refresh Maya’s viewport.

  • Enhances user experience by providing real-time feedback during lengthy operations like rigging, animation, or script execution.

Usage Example:

>>> progressWin(currentItem="Task 1", endProgress=0, showProgressTime=True, innerObjs=False, innerList=None, refreshView=0, useProgress=1, outerList=None)
# Updates the progress window with the specified parameters.
Flow Chart Description:

This flowchart explains the progressWin function:

  1. The function starts and checks if progress tracking is enabled.

  2. If enabled, it calculates and updates the progress value based on the current item and list sizes.

  3. It then updates the progress bar and, optionally, the elapsed time.

  4. If refreshView is set, it refreshes Maya’s viewport for visual updates.

  5. The process repeats for each item in the list or ends when the task is completed.

graph TB Start[("fa:fa-play Start")] --> CheckProgressEnabled{"/fas:fa-question-circle Check Progress Enabled"} CheckProgressEnabled --"If Enabled"--> CalculateProgress["/fas:fa-calculator Calculate Progress"] CheckProgressEnabled --"If Not Enabled"--> End[("fas:fa-stop End")] CalculateProgress --> UpdateProgressBar["/fas:fa-tasks Update Progress Bar"] UpdateProgressBar --> OptionalElapsedTimeCheck{"/fas:fa-clock Optional Elapsed Time"} OptionalElapsedTimeCheck --"If Show Time"--> ShowElapsedTime["/fas:fa-hourglass-half Show Elapsed Time"] OptionalElapsedTimeCheck --"If Not"--> CheckRefreshView{"/fas:fa-sync-alt Check Refresh View"} ShowElapsedTime --> CheckRefreshView CheckRefreshView --"If Refresh"--> RefreshViewport["/fas:fa-desktop Refresh Maya Viewport"] CheckRefreshView --"If Not"--> End RefreshViewport --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckProgressEnabled fill:#ffcc00,stroke:#000,stroke-width:2px style CalculateProgress fill:#99ccff,stroke:#000,stroke-width:2px style UpdateProgressBar fill:#99ccff,stroke:#000,stroke-width:2px style OptionalElapsedTimeCheck fill:#ffcc00,stroke:#000,stroke-width:2px style ShowElapsedTime fill:#cc99ff,stroke:#000,stroke-width:2px style CheckRefreshView fill:#ffcc00,stroke:#000,stroke-width:2px style RefreshViewport fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.refreshView(self, num)#

[**shArgs : n=num]

Purpose:

:: Refreshes the view a specified number of times in Maya.

  • Helps in ensuring that the Maya viewport updates correctly, particularly useful in scripting and automation tasks.

  • Can be used to refresh the view after changes are made via scripts to reflect the updates in the viewport.

Parameters:

num – <int, optional> # Number of times to refresh the view. Defaults to 1.

Returns:

None

Usage:

>>> refreshView(3)
# Refreshes the Maya viewport three times.
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckNum fill:#ff9999,stroke:#000,stroke-width:2px style RefreshView fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> CheckNum{"/fas:fa-sort-numeric-up Check num"} CheckShArgs --"If shArgs not provided"--> CheckNum CheckNum --"If num > 0"--> RefreshView["/fas:fa-sync Refresh View"] CheckNum --"If num <= 0"--> End[("fas:fa-stop End")] RefreshView --> End
Flow Chart Description:

This flowchart illustrates the refreshView function:

  1. The process starts by checking if shArgs are provided and updates num as necessary.

  2. It checks if num is greater than zero.

  3. If yes, it refreshes the Maya view the specified number of times.

  4. If no, the function does nothing and ends.

HyperSkin.removeImpliedChild(self, jnt)#

[shArgs : none]

Purpose:

:: Removes the ‘mChd’ attribute, representing an implied child, from a specified joint in Autodesk Maya.

  • Useful for cleaning up joint attributes and ensuring proper joint hierarchy.

  • Aids in maintaining a clear and manageable rigging structure.

  • Essential for custom rig setups where implied child attributes need to be managed or removed.

Parameters:

jnt – The joint from which the implied child attribute (‘mChd’) will be removed.

Usage Example:

>>> removeImpliedChild('joint1')
# Removes the 'mChd' attribute from 'joint1' if it exists.
Flow Chart Description:

This flowchart describes the removeImpliedChild function:

  1. The function starts by checking if the ‘mChd’ attribute exists on the given joint.

  2. If the attribute exists, it proceeds to delete the ‘mChd’ attribute from the joint.

  3. A message is displayed to indicate the successful removal of the attribute.

  4. The process completes after the attribute removal.

graph TB Start[("fa:fa-play Start")] --> CheckAttribute{"/fas:fa-question-circle Check 'mChd' Attribute"} CheckAttribute --"Attribute Exists"--> RemoveAttribute["/fas:fa-trash-alt Remove 'mChd' Attribute"] RemoveAttribute --> DisplayInfo["/fas:fa-info-circle Display Removal Info"] CheckAttribute --"No Attribute"--> DisplayInfo DisplayInfo --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAttribute fill:#ffcc00,stroke:#000,stroke-width:2px style RemoveAttribute fill:#99ccff,stroke:#000,stroke-width:2px style DisplayInfo fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.removeImpliedParent(self, jnt)#

[shArgs : none]

Purpose:

:: Removes the ‘mPrnt’ attribute from a specified joint in Autodesk Maya, eliminating any implied parent information.

  • Useful for cleaning up joint attributes and ensuring a joint hierarchy is defined explicitly.

  • Helps in maintaining the clarity of joint relationships, especially in complex rigging setups.

  • Streamlines the rig by removing unnecessary or redundant attributes.

Parameters:

jnt – The joint from which the ‘mPrnt’ attribute is to be removed.

Usage Example:

>>> removeImpliedParent('joint1')
# Removes the 'mPrnt' attribute from 'joint1' if it exists.
Flow Chart Description:

This flowchart outlines the removeImpliedParent function:

  1. The process begins with checking if the ‘mPrnt’ attribute exists on the specified joint.

  2. If the attribute exists, it is deleted from the joint.

  3. A message is displayed in Maya’s script editor confirming the successful removal of the attribute.

  4. The process completes with the joint now free of the ‘mPrnt’ attribute.

graph TB Start[("fa:fa-play Start")] --> CheckAttribute{"/fas:fa-question-circle Check 'mPrnt' Attribute"} CheckAttribute --"Attribute Exists"--> DeleteAttribute["/fas:fa-trash-alt Delete 'mPrnt' Attribute"] CheckAttribute --"No Attribute"--> End[("fas:fa-stop End")] DeleteAttribute --> DisplayInfo["/fas:fa-info-circle Display Confirmation"] DisplayInfo --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAttribute fill:#ffcc00,stroke:#000,stroke-width:2px style DeleteAttribute fill:#99ccff,stroke:#000,stroke-width:2px style DisplayInfo fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.removeInfluences_skinClust(self, infList=None, skinMesh=None)#

[shArgs : none]

Purpose:

:: Removes given influences (joints or other deformers) from a specified skinCluster in Autodesk Maya.

  • This function is useful for cleaning up or modifying skinClusters by removing unnecessary influences.

  • It provides flexibility by allowing the selection of influences and the target skinMesh either through arguments or directly from the Maya scene.

Usage Example:

>>> removeInfluences_skinClust(['joint1', 'joint2'], 'pCube1')
# Removes 'joint1' and 'joint2' from the skinCluster associated with 'pCube1'.
Parameters:

  • infList : A list of influence objects (joints or deformers) that need to be removed from the skinCluster.

  • skinMesh : The mesh object that is associated with the skinCluster from which influences are to be removed.

Return:

  • None. The function performs an operation on the skinCluster and does not return a value.

Note:

  • If the infList and skinMesh arguments are not provided, the function will use the current selection in Maya.

  • The last selected object is considered as skinMesh, and the rest are considered as influences to remove.

graph TB Start[("fa:fa-play Start")] --> CheckArgs{"/fas:fa-question-circle Check Arguments"} CheckArgs --"Args Provided"--> RemoveInfluences["/fas:fa-user-minus Remove Influences"] CheckArgs --"Args Not Provided"--> UseSelection{"/fas:fa-mouse-pointer Use Selection"} UseSelection --> RemoveInfluences RemoveInfluences --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style RemoveInfluences fill:#99ccff,stroke:#000,stroke-width:2px style UseSelection fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the removeInfluences_skinClust function:

  1. The process begins, checking if arguments are provided.

  2. If arguments are provided, it proceeds to remove the specified influences from the skinCluster.

  3. If arguments are not provided, it uses the current selection in Maya for influences and the target mesh.

  4. After removing the influences, the process completes.

Purpose:

Adds given infList to given skinMesh

Args:

infList =infList to be added to skinMesh skinMesh = infList[-1], if skinMesh not given useGeoInf = True | False (for ‘useGeometry’ arg)

Args (from selection):

If both Args are not given:

infList =hsN._selected()[0:-1] skinMesh =hsN._selected()[-1]

HyperSkin.removeParentChild_ImpliedInfo(self, jntList=None)#

[shArgs : None]

Purpose:

:: Removes implied parent-child relationship information from Autodesk Maya joints.

  • This function is used in rigging workflows to clear custom attributes that define implied parent-child relationships.

  • It offers a way to revert or clean up the rigging setup by removing these custom attributes.

Parameters:

jntList – <list/str> (optional) #List of joint names or a single joint name. If None, selected joints are used.

Usage Example::
>>> removeParentChild_ImpliedInfo(['joint1', 'joint2'])
# Removes implied relationship attributes from 'joint1' and 'joint2'.

Note: - Ideal for cleaning up rigs and removing unnecessary attributes from joints. - Useful in scenarios where rig structures need to be simplified or modified.

Implementation Details:

The function iterates over the provided or selected joints and performs the following steps for each joint: 1. Checks for and removes the attribute indicating the implied child. 2. Checks for and removes the attribute indicating the implied parent.

graph TB Start[("fa:fa-play Start")] --> ReceiveJoints{Receive Joints} ReceiveJoints --"Joints Provided"--> ProcessJoints[Process Each Joint] ReceiveJoints --"Use Selected Joints"--> SelectJoints[Select Joints] SelectJoints --> ProcessJoints ProcessJoints --> RemoveChildAttr[Remove Implied Child Attribute] ProcessJoints --> RemoveParentAttr[Remove Implied Parent Attribute] RemoveChildAttr --> End[("fas:fa-stop End")] RemoveParentAttr --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ReceiveJoints fill:#99ccff,stroke:#000,stroke-width:2px style ProcessJoints fill:#ff9999,stroke:#000,stroke-width:2px style SelectJoints fill:#ffcc99,stroke:#000,stroke-width:2px style RemoveChildAttr fill:#99ff99,stroke:#000,stroke-width:2px style RemoveParentAttr fill:#ffccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.reorderDeformers(self, meshList=None, deformTypes=None)#

deformTypes =[‘sculpt’, ‘skinCluster’, ‘cMuscleRelative’, ‘nonLinear’, ‘cluster’, ‘blendShape’, ‘ffd’, ‘wrap’, ‘tweak’] nonLinearOrder =[‘wave’, ‘twist’, ‘squash’, ‘sine’, ‘flare’, ‘bend’] deformerOrder =[‘blendShape’, ‘cluster’, ‘skinCluster’, ‘cMuscleRelative’, ‘ffd’, ‘nonLinear’, ‘sculpt’, ‘wrap’, ‘tweak’]

Purpose:

:: Reorders deformers on a given mesh in Autodesk Maya according to a specified sequence of deformation types.

  • Enhances the control and predictability of deformation effects on a mesh.

  • Allows for a more organized and efficient deformation pipeline.

  • Facilitates better management of multiple deformers affecting a single mesh.

Parameters:
  • meshList – List of mesh objects to have their deformers reordered.

  • deformTypes – List of deformer types in the desired order of application.

Usage Example:

>>> reorderDeformers(['mesh1', 'mesh2'], ['blendShape', 'skinCluster', 'nonLinear'])
# Reorders deformers on 'mesh1' and 'mesh2' to follow the sequence blendShape -> skinCluster -> nonLinear.
Flow Chart Description:

This flowchart depicts the reorderDeformers function:

  1. The function begins by initializing the deformer types and mesh list, if not provided.

  2. It iterates through each mesh in the mesh list.

  3. For each mesh, the function collects all deformers based on the provided deformer types.

  4. The deformers are then reordered based on the specified sequence.

  5. This process is repeated for each mesh in the list, ensuring all meshes have their deformers reordered accordingly.

graph TB Start[("fa:fa-play Start")] --> InitializeInputs{"/fas:fa-cogs Initialize Inputs"} InitializeInputs --> ForEachMesh{"/fas:fa-repeat For Each Mesh in Mesh List"} ForEachMesh --> CollectDeformers{"/fas:fa-tools Collect Deformers"} CollectDeformers --> ReorderDeformers{"/fas:fa-sort-amount-down Reorder Deformers"} ReorderDeformers --> ForEachMesh ForEachMesh --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style InitializeInputs fill:#99ccff,stroke:#000,stroke-width:2px style ForEachMesh fill:#ffcc00,stroke:#000,stroke-width:2px style CollectDeformers fill:#99ccff,stroke:#000,stroke-width:2px style ReorderDeformers fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.resetSkinnedJoints(self, skinJnts=None)#

[shArgs : none]

Purpose:

:: Resets the skin deformation for selected joints in Autodesk Maya, effectively recalibrating the bind pose of the skinning system.

  • Essential for tweaking joint positions after initial skinning, ensuring the skinned geometry deforms correctly.

  • Automates the process of updating the bind pose, saving time and ensuring accuracy.

Parameters:

skinJnts – (<list/PyNode>, optional) #List of joints to reset skinning on. If not provided, the function uses the selected joints in Maya.

Usage Example:

>>> resetSkinnedJoints(['L_Arm_Jnt', 'R_Arm_Jnt'])
# Resets the skinning on the specified joints 'L_Arm_Jnt' and 'R_Arm_Jnt'.
Flow Chart Description:

The resetSkinnedJoints function involves these steps:

  1. Check if joints are provided or selected in Maya.

  2. Determine the skin clusters connected to the provided/selected joints.

  3. For each joint, update the bindPreMatrix attribute of the skin cluster to reflect the current joint transformation.

  4. If a joint has no skin cluster, it’s skipped.

  5. Repeat the process for all provided/selected joints.

graph LR Start[("fa:fa-play Start")] --> CheckJoints{"/fas:fa-question-circle Check Joints"} CheckJoints --"Joints Provided"--> UpdateSkinCluster["/fas:fa-sync-alt Update SkinCluster"] CheckJoints --"Joints Selected in Maya"--> RetrieveJoints["/fas:fa-search Retrieve Joints"] RetrieveJoints --> UpdateSkinCluster UpdateSkinCluster --> CheckNextJoint{"/fas:fa-arrow-right Check Next Joint"} CheckNextJoint --"More Joints to Process"--> UpdateSkinCluster CheckNextJoint --"No More Joints"--> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckJoints fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveJoints fill:#99ccff,stroke:#000,stroke-width:2px style CheckNextJoint fill:#ffcc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

None. The function does not return a value but updates the skinning system of the provided/selected joints.

HyperSkin.restrictedZone_FreeTool(self)#

[shArgs : none]

Purpose:

:: Displays a message about the restricted access in the free version of a tool or software, directing users to the official website for updates or purchase options.

  • Informs users about limitations in the free version of the tool.

  • Guides users to the official website for further information or to acquire the full version.

Usage Example:

>>> restrictedZone_FreeTool()
# Displays a message about the restrictions and provides a link to the official website.

Note: - This function is typically used in software where certain features are locked or restricted in the free version. - It’s a prompt to encourage users to visit the official website for more information, updates, or purchasing options.

Flow Chart Description:

The restrictedZone_FreeTool function follows these steps:

  1. Start the function and immediately open the official website in a web browser.

  2. Display a message informing the user about the restricted access in the free version.

  3. Provide a link and encourage the user to visit the official website for more information or to upgrade.

  4. End the function after displaying the message.

graph TB Start[("fa:fa-play Start")] --> OpenWebsite["/fas:fa-globe Open Official Website"] OpenWebsite --> DisplayMessage["/fas:fa-exclamation-triangle Display Restriction Message"] DisplayMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style OpenWebsite fill:#99ccff,stroke:#000,stroke-width:2px style DisplayMessage fill:#ffcc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

None. The function does not return a value but provides information and a web link to the user.

HyperSkin.scaleDisc_AfterImportAttrs(self, trgtMesh='body')#

[shArgs : none]

Purpose:

:: Adjusts the scaling of discs after importing attributes in Autodesk Maya.

  • This function helps in readjusting the scale of rig discs to fit properly after importing attributes.

  • Includes internal functions to hide or unhide nodes for visibility during the process.

Parameters:

trgtMesh – <str> (default ‘body’) #Target mesh against which the discs are scaled and adjusted.

Internal Functions: - unhideNodes(nodeList): Unhides the given nodes for visibility during scaling. - hideNodes(nodeList): Hides the nodes after scaling to maintain the original visibility state.

Usage Example:

>>> scaleDisc_AfterImportAttrs('characterMesh')
# Adjusts the scaling of discs based on the 'characterMesh' mesh.

Note: - The function targets specific rig components (discs) and adjusts their scale to ensure proper fitting with the character mesh. - It is particularly useful in rigging workflows where rig components need to be dynamically adjusted according to the character’s body mesh.

Flow Chart Description:

The flowchart for the scaleDisc_AfterImportAttrs function:

  1. Receive target mesh for scaling adjustment.

  2. Unhide discs for visibility.

  3. Iterate through each disc and apply scaling adjustments.

  4. Hide discs after adjustments to restore original visibility.

  5. Complete the process and return adjusted discs.

graph TB Start[("fa:fa-play Start")] --> UnhideDiscs{Unhide Discs for Visibility} UnhideDiscs --"Discs Unhidden"--> IterateDiscs{Iterate and Adjust Discs} IterateDiscs --> HideDiscs{Hide Discs} HideDiscs --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style UnhideDiscs fill:#99ccff,stroke:#000,stroke-width:2px style IterateDiscs fill:#ffcc00,stroke:#000,stroke-width:2px style HideDiscs fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.scaleTillInsideMesh(self, srcObj, cvList, trgtMesh, stepVal=0.01, scaleDir='y')#

[shArgs : none]

Purpose:

:: Scales a source object until all specified control vertices are inside a target mesh in Autodesk Maya.

  • Useful for adjusting the scale of rig controls to fit inside a character’s mesh.

  • Allows specification of the scale direction and incremental steps for scaling.

Parameters:
  • srcObj – <str> #The object to be scaled.

  • cvList – <list> #List of control vertices to check against the target mesh.

  • trgtMesh – <str> #Target mesh that the control vertices must be inside of.

  • stepVal – <float> (default 0.01) #Incremental step value for scaling.

  • scaleDir – <str> (default ‘y’) #Direction to scale the object (‘x’, ‘y’, ‘z’, or ‘all’).

Usage Example:

>>> scaleTillInsideMesh('L_Palm_HndCtrl', ['cv1', 'cv2', 'cv3'], 'bodyMesh', stepVal=0.01, scaleDir='y')
# Scales 'L_Palm_HndCtrl' in the 'y' direction until all control vertices ('cv1', 'cv2', 'cv3') are inside 'bodyMesh'.

Note: - This function iteratively scales the source object and checks if all control vertices are inside the target mesh. - The scale direction and step value can be customized to fit different rigging needs. - Ideal for ensuring rig controls do not protrude outside the character’s body mesh.

Flow Chart Description:

The flowchart for the scaleTillInsideMesh function:

  1. Receive source object, control vertices, target mesh, scaling direction, and step value.

  2. Initial scaling of the source object in the specified direction.

  3. Check if all control vertices are inside the target mesh.

  4. Continue scaling until the condition is met or stop if already inside.

  5. The function completes when all control vertices are inside the mesh.

graph TB Start[("fa:fa-play Start")] --> InitialScale{Initial Scaling of Source Object} InitialScale --"Scale and Test"--> CheckCVs{Check if CVs Inside Mesh} CheckCVs --"Not All Inside"--> AdjustScale["Adjust Scale Further"] CheckCVs --"All Inside"--> EndScale[("fas:fa-check-circle Scaling Complete")] AdjustScale --> CheckCVs EndScale --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style InitialScale fill:#ffcc00,stroke:#000,stroke-width:2px style CheckCVs fill:#99ccff,stroke:#000,stroke-width:2px style AdjustScale fill:#99ff99,stroke:#000,stroke-width:2px style EndScale fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.searchReplaceAll(self, objList, searchWord, replaceWord, topSelect=True, selectHI=True)#

[shArgs : none]

Purpose:

:: Searches and replaces specified words in the names of objects within a given list in Autodesk Maya.

  • The function is designed to rename objects by replacing a specific search word with a replacement word.

  • It can operate on a single object or a list of objects, and has options to include all child objects (hierarchy) and exclude the top object.

Parameters:
  • objList – <list/str> #List of objects or a single object whose names are to be modified.

  • searchWord – <str> #The word to be searched for replacement in the object names.

  • replaceWord – <str> #The word to replace the searched word in the object names.

  • topSelect – <bool> (default True) #Determines whether to include the top-level object in the renaming process.

  • selectHI – <bool> (default True) #If True, includes all child objects in the hierarchy for renaming.

Returns:

<list> #List of all nodes with replaced or renamed words under the given objects.

Usage Example:

>>> searchReplaceAll(['Cube1', 'Sphere1'], '1', '2')
# Renames 'Cube1' to 'Cube2' and 'Sphere1' to 'Sphere2'.

Note: - This function is useful in rigging and scene organization where consistent naming conventions are crucial. - It automates the process of renaming multiple objects, saving time and reducing manual errors.

Flow Chart Description:

The flowchart for the searchReplaceAll function:

  1. Receive list of objects and words to search and replace.

  2. Iterate through each object.

  3. If selected, include child objects in the hierarchy.

  4. Perform search and replace operation on object names.

  5. Return the list of renamed objects.

graph TB Start[("fa:fa-play Start")] --> ReceiveData{Receive Data} ReceiveData --"Data Received"--> IterateObjects{Iterate Through Objects} IterateObjects --> CheckHierarchy{Check for Child Objects} CheckHierarchy --"Include Children"--> SearchReplaceOp[Search and Replace Operation] CheckHierarchy --"Exclude Children"--> SearchReplaceOp SearchReplaceOp --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ReceiveData fill:#99ccff,stroke:#000,stroke-width:2px style IterateObjects fill:#ffcc00,stroke:#000,stroke-width:2px style CheckHierarchy fill:#ff9999,stroke:#000,stroke-width:2px style SearchReplaceOp fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.selectFromTF(self, textFld)#

[shArgs : tf=textFld, as=addSelection, us=useSuffix]

Purpose:

:: Adds selected object’s name as input in a window for <== button. :param textFld (str): The name of the text field to use. :param addSelection (int, optional): If 1, adds the selection. Default is 1. :param useSuffix (str, optional): Suffix to use for the object name. Default is ‘’. :return: None

Usage:

obj10 # Adds ‘obj10’ While pressing Enter.. <== button box25 # Adds ‘box25’ While pressing Enter.. <== button

Code Examples:

>>> text_field_name = "textField_name"  # Example text field name
>>> add_selection = 1  # Example addSelection value
>>> suffix = "_suffix"  # Example useSuffix value
>>> selectFromTF(textFld=text_field_name, addSelection=add_selection, useSuffix=suffix)
# Adds selected object's name as input in the specified text field.

This function allows you to add the selected object’s name as input in a window, with the option to add the selection and use a suffix.

graph TD Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs Exist"--> ParseShArgs["/fas:fa-cogs Parse shArgs"] CheckShArgs --"If shArgs Does Not Exist"--> InitializeParameters["/fas:fa-wrench Initialize Parameters"] InitializeParameters --> GetTextFromTextField{"/fas:fa-edit Get Text from Text Field"} GetTextFromTextField --> ProcessText{"/fas:fa-cog Process Text"} ProcessText --"If Text Contains Suffix"--> CheckObjectExistence{"/fas:fa-check-square Check Object Existence"} ProcessText --"If Text Does Not Contain Suffix"--> CheckObjectExistence{"/fas:fa-check-square Check Object Existence"} CheckObjectExistence --"If Object Exists"--> AddSelection["/fas:fa-plus-circle Add Selection"] CheckObjectExistence --"If Object Does Not Exist"--> End["/fas:fa-stop End"] AddSelection --> 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 GetTextFromTextField fill:#ccffcc,stroke:#000,stroke-width:2px style ProcessText fill:#99ccff,stroke:#000,stroke-width:2px style CheckObjectExistence fill:#cc99ff,stroke:#000,stroke-width:2px style AddSelection fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the selectFromTF function:

  • Checks if shArgs exist, and if so, parses the tf, as, and us from it.

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

  • Gets the text from the specified text field.

  • Processes the text to check if it contains a suffix.

  • Checks if the object specified in the text exists.

  • If the object exists, it adds the selection.

  • If the object does not exist, the flowchart ends.

HyperSkin.selectHI(self, objName, objType='jnt', topSelect=True, includeShapes=False, childImplied=True)#

[shArgs : none]

Objective:

:: Selects all objects of a specified type under a given object in Autodesk Maya.

  • Allows for the selection of hierarchy based on object type, such as joints, curves, or meshes.

  • Offers options to include shapes, child implied objects, and whether to include the top object in the selection.

Parameters:
  • objName – (<type str>) # Name of the object to start selection from.

  • objType – (<type str, optional>) # Type of object to select. Default is ‘jnt’.

  • topSelect – (<type bool, optional>) # If True, selects the top node. Default is True.

  • includeShapes – (<type bool, optional>) # If True, includes shapes in the selection. Default is False.

  • endsWith – (<type str, optional>) # Select only objects ending with this suffix. Default is None.

Returns:

(<type list>) # List of selected objects. #_ As per the objType

Usage Example:

>>> selectHI('pSphere1', objType='mesh', topSelect=False, includeShapes=True)
# Selects all mesh type objects under 'pSphere1', excluding 'pSphere1' itself and including shape nodes.
Flow Chart Description:

The selectHI function follows these steps:

  1. Identifies the object type to select based on the input (objType).

  2. Selects the given object and its hierarchy.

  3. Filters the selection to match the specified object type.

  4. Adjusts the selection based on additional parameters like childImplied, topSelect, and includeShapes.

  5. Returns the final selection of objects.

graph TB Start[("fa:fa-play Start")] --> IdentifyObjectType["/fas:fa-crosshairs Identify Object Type"] IdentifyObjectType --> SelectGivenObjectAndHierarchy["/fas:fa-sitemap Select Given Object and Hierarchy"] SelectGivenObjectAndHierarchy --> FilterSelectionByObjectType["/fas:fa-filter Filter Selection By Object Type"] FilterSelectionByObjectType --> AdjustSelectionBasedOnParameters["/fas:fa-sliders-h Adjust Selection Based on Parameters"] AdjustSelectionBasedOnParameters --> ReturnFinalSelection["/fas:fa-check-circle Return Final Selection"] ReturnFinalSelection --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style IdentifyObjectType fill:#99ccff,stroke:#000,stroke-width:2px style SelectGivenObjectAndHierarchy fill:#99ccff,stroke:#000,stroke-width:2px style FilterSelectionByObjectType fill:#99ccff,stroke:#000,stroke-width:2px style AdjustSelectionBasedOnParameters fill:#cc99ff,stroke:#000,stroke-width:2px style ReturnFinalSelection fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

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

HyperSkin.selectLastSelectedVtx(self)#

[shArgs : none]

Purpose:

:: Re-selects the last selected vertices on a skin mesh in Autodesk Maya.

  • Useful for quickly re-selecting a previously modified set of vertices, enhancing workflow efficiency in modeling and rigging tasks.

  • Relies on the global variable lastSelectedVtx to remember the last selection, ensuring continuity in the editing process.

  • Simplifies the process of revisiting specific vertex groups without the need to manually re-select them.

Parameters:

none – This function does not require direct arguments but relies on the previously stored selection in lastSelectedVtx.

Returns:

None #This function does not return a value but performs an action in the Maya scene.

Usage Example:

>>> selectLastSelectedVtx()
# Re-selects the vertices that were last selected on the current skin mesh.
Note:

  • Ensure that the lastSelectedVtx variable is correctly set by previous operations in the script to make effective use of this function.

  • This function is particularly useful in rigging and skinning workflows where frequent re-selection of the same vertex groups is common.

graph TB Start[("fa:fa-play Start")] --> ConfirmSkinMesh["/fas:fa-check-square Confirm Skin Mesh"] ConfirmSkinMesh --> RetrieveLastSelection["/fas:fa-history Retrieve Last Vertex Selection"] RetrieveLastSelection --> ReSelectVertices["/fas:fa-mouse-pointer Re-select Vertices"] ReSelectVertices --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmSkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveLastSelection fill:#99ff99,stroke:#000,stroke-width:2px style ReSelectVertices fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The selectLastSelectedVtx function follows these steps:

  1. Begins by confirming the presence of a skin mesh in the Maya scene.

  2. Retrieves the last set of vertices selected from the global variable lastSelectedVtx.

  3. Re-selects these vertices on the skin mesh.

  4. Completes the process, leaving the last selected vertices highlighted in the Maya scene.

HyperSkin.selectSkinJnts(self, wInf=False)#

[shArgs : none]

Purpose:

:: Selects all joints influencing a skinned mesh in Autodesk Maya, aiding in rigging and weight painting tasks.

  • Offers an option to select either all influencing joints or only the weighted influencing joints of a skinned mesh.

  • Streamlines the process of selecting joints for skin weight adjustments or rig modifications.

  • Enhances rigging workflow efficiency by quickly isolating joint selections based on their influence on the mesh.

Parameters:
  • wInf – <bool> #If True, selects only the weighted influencing joints. If False, selects all influencing joints.

  • skinMesh – <str> #Automatically determined; the skinned mesh for which the joints are to be selected.

  • skinClust – <str> #Automatically determined; the skinCluster node associated with the skinned mesh.

Usage Example:

>>> selectSkinJnts(wInf=True)
# Selects only the joints that have actual skin weight influence on the skinned mesh.

>>> selectSkinJnts(wInf=False)
# Selects all joints that are capable of influencing the skinned mesh, regardless of their current weight values.
Note:

  • This function is particularly useful in skinning and weight painting workflows where specific joint selections are needed.

  • Ensure that the skinned mesh and its associated skinCluster are correctly set up in Maya before using this function.

graph TB Start[("fa:fa-play Start")] --> ConfirmMeshAndCluster["/fas:fa-check-square Confirm SkinMesh and SkinCluster"] ConfirmMeshAndCluster -- "If wInf is True" --> SelectWeightedJoints["/fas:fa-users Select Weighted Influencing Joints"] ConfirmMeshAndCluster -- "If wInf is False" --> SelectAllJoints["/fas:fa-users Select All Influencing Joints"] SelectWeightedJoints --> End[("fas:fa-stop End")] SelectAllJoints --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmMeshAndCluster fill:#99ccff,stroke:#000,stroke-width:2px style SelectWeightedJoints fill:#99ff99,stroke:#000,stroke-width:2px style SelectAllJoints fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The selectSkinJnts function follows this workflow:

  1. It starts by confirming the skinned mesh and its associated skinCluster in the Maya scene.

  2. Based on the wInf parameter:
    • If wInf is True, the function selects only those joints that have actual skin weight influence on the mesh.

    • If wInf is False, all joints capable of influencing the mesh are selected, irrespective of their weight values.

  3. The process concludes with the appropriate joint selection made, ready for further skinning or rigging tasks.

HyperSkin.selectSkinVertices(self, sidePrefix=None)#

[shArgs : none]

Purpose:

:: Selects vertices on a skin mesh based on a specified side prefix (such as ‘L_’ for left side) in Autodesk Maya.

  • Useful for quickly selecting a group of vertices on one side of a symmetrically modeled character.

  • Enhances efficiency in weight painting and vertex editing by automating the selection process.

Usage Example:

>>> selectSkinVertices('L_')
# Selects vertices on the left side of the skinned mesh.

Note: - If a side prefix is not provided, the function will select all vertices of the skinned mesh. - This function is particularly helpful in rigging and skinning workflows where precise vertex selection is required.

Parameters:

  • sidePrefix: (<str>, optional) The prefix used to identify the side of the mesh for vertex selection. Typical values are ‘L_’ for left and ‘R_’ for right.

Return:

  • None, but it updates the global variable lastSelectedVtx with the selected vertices.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Selection"} CheckSelection -- "Mesh Selected" --> ExtractVertices["/fas:fa-search Extract Vertices"] CheckSelection -- "No Mesh Selected" --> ConfirmSkinMesh["/fas:fa-link Confirm Skin Mesh"] ExtractVertices --> UpdateSelection["/fas:fa-check-square Update Selection"] ConfirmSkinMesh --> ExtractVertices UpdateSelection --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractVertices fill:#99ccff,stroke:#000,stroke-width:2px style UpdateSelection fill:#99ff99,stroke:#000,stroke-width:2px style ConfirmSkinMesh fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the selectSkinVertices function:

  1. The process starts by checking if a mesh is currently selected in Maya.

  2. If a mesh is selected, it extracts the vertices based on the provided side prefix.

  3. If no mesh is selected, it confirms the skin mesh using the confirmSkinMesh function.

  4. After confirming or selecting the mesh, it extracts the relevant vertices.

  5. The selection is updated, and the global variable lastSelectedVtx is set with the selected vertices.

  6. The process ends.

HyperSkin.setSkinWeights(self, vtxName, jntValDict, addInf=False, skinClust=None, unlockJnts=True, lockJnts=None, speedSkin=False)#

[shArgs : vn=vtxName, jvD=jntValDict, ai=addInf, sc=skinClust, uJ=unlockJnts, lJ=lockJnts, ss=speedSkin]

Purpose:

:: Applies specific skin weights to a vertex in a mesh influenced by a skin cluster in Autodesk Maya. This function is essential for precise weight painting and adjustments in character rigging.

Parameters:
  • vtxName – (<str>) #Name of the vertex to modify weights for, typically in the format ‘mesh.vtx[index]’.

  • jntValDict – (<dict>) #Dictionary containing joint names as keys and corresponding weight values as values.

  • addInf – (<bool>, optional) #If True, adds joints in jntValDict as new influences to the skin cluster if they’re not already influences. Default is False.

  • skinClust – (<str>, optional) #Name of the skinCluster node. If not provided, it’s derived from the history of the mesh. Default is None.

  • unlockJnts – (<bool>, optional) #If True, unlocks joints with non-zero weights for the vertex before setting new weights. Default is True.

  • lockJnts – (<list>, optional) #List of joint names to lock after setting weights. Default is None.

  • speedSkin – (<bool>, optional) #If True, uses a faster method to set weights, suitable for large number of vertices. Default is False.

Returns:

None #This function does not return a value but modifies the skin weights of the specified vertex.

Usage Example:

>>> setSkinWeights('body_geo.vtx[100]', {'joint1': 0.5, 'joint2': 0.5}, addInf=True)
# This will set the weights for 'body_geo.vtx[100]' influenced by 'joint1' and 'joint2' to 0.5 each.
Flow Chart Description:

The setSkinWeights function performs the following operations:

  1. Determines the skin cluster if not provided and checks for the required joints.

  2. Optionally adds new joints as influences to the skin cluster.

  3. Unlocks joints with existing weights for the vertex.

  4. Applies new skin weight values to the vertex based on the provided dictionary.

  5. Optionally locks specified joints after setting weights.

  6. Utilizes a speedSkin method for faster processing when dealing with large datasets.

graph TB Start[("fa:fa-play Start")] --> DetermineSkinCluster["/fas:fa-sitemap Determine Skin Cluster"] DetermineSkinCluster --> CheckJoints["/fas:fa-search Check Required Joints"] CheckJoints --"If addInf is True" --> AddInfluences["/fas:fa-plus-square Add New Influences"] CheckJoints --"If addInf is False" --> UnlockJoints["/fas:fa-unlock-alt Unlock Joints"] AddInfluences --> UnlockJoints UnlockJoints --> ApplyWeights["/fas:fa-balance-scale Apply New Weights"] ApplyWeights --> LockJoints["/fas:fa-lock Lock Joints (If Specified)"] LockJoints --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineSkinCluster fill:#99ccff,stroke:#000,stroke-width:2px style CheckJoints fill:#99ccff,stroke:#000,stroke-width:2px style AddInfluences fill:#99ccff,stroke:#000,stroke-width:2px style UnlockJoints fill:#99ccff,stroke:#000,stroke-width:2px style ApplyWeights fill:#99ccff,stroke:#000,stroke-width:2px style LockJoints fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.smoothEdgeLoops(self)#

[shArgs : none]

Purpose:

:: Smooths selected edge loops in Autodesk Maya, optimizing the mesh topology for better deformation and aesthetics.

  • Enhances mesh quality by evenly distributing vertex weights along selected edge loops.

  • Ideal for refining rigging and animation-ready meshes, particularly around joints and areas of high deformation.

Usage Example:

>>> smoothEdgeLoops()
# Smooths the edge loops of the selected edges in the Maya scene.
Note:

  • Before using this function, select the edges in the Maya scene that you want to smooth.

  • It’s particularly useful in character rigging to smooth skin weights along edge loops for more natural deformations.

Parameters:

  • None. This function operates on the currently selected edge loops in Maya.

Return:

  • None. The function applies smoothing directly to the selected edge loops in the scene.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Edge Loop Selection"} CheckSelection -- "Edge Loops Selected" --> SmoothEdgeLoops["/fas:fa-stream Smooth Edge Loops"] CheckSelection -- "No Edge Loops Selected" --> Error["/fas:fa-exclamation-triangle Error: No Edge Loops Selected"] SmoothEdgeLoops --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style SmoothEdgeLoops fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart outlines the smoothEdgeLoops function:

  1. The process begins by verifying if edge loops are selected in the Maya scene.

  2. If no edge loops are selected, an error message is displayed.

  3. If edge loops are selected, the function proceeds to smooth these loops.

  4. The smoothing process involves the equal distribution of vertex weights along the selected edge loops.

  5. The process concludes once the edge loops are smoothed, or if no edge loops were initially selected.

HyperSkin.smoothNearest(self)#

[shArgs : none]

Purpose:

:: Smooths skin weights for vertices nearest to the selected ones in Autodesk Maya.

  • Helps in refining skin deformations by smoothing the weights of adjacent vertices.

  • Utilizes Maya’s built-in weight smoothing tools for efficient skin weight management.

  • Enhances the quality of skinning by ensuring a more natural deformation around selected vertices.

Parameters:

none – This function is executed based on the user’s current selection in Maya.

Usage Example:

>>> # Select the vertices whose neighboring vertices you want to smooth
>>> smoothNearest()
# Executes the smoothing process on the vertices adjacent to the selected ones.
Note:

  • Ensure that vertices are selected on the mesh before running this function.

  • The function targets immediate neighboring vertices of the selected ones for smoothing.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Vertex Selection"} CheckSelection --"Vertices Selected"--> SmoothSkinWeights["/fas:fa-magic Smooth Skin Weights"] CheckSelection --"No Vertices Selected"--> Error["/fas:fa-exclamation-triangle Display Error"] SmoothSkinWeights --> GrowSelection["/fas:fa-expand-arrows-alt Grow Selection"] GrowSelection --> SmoothAdjacentWeights["/fas:fa-magic Smooth Adjacent Weights"] SmoothAdjacentWeights --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style SmoothSkinWeights fill:#99ccff,stroke:#000,stroke-width:2px style GrowSelection fill:#99ccff,stroke:#000,stroke-width:2px style SmoothAdjacentWeights fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart explains the smoothNearest function:

  1. The process starts and checks if vertices are selected.

  2. If no vertices are selected, an error is displayed and the process ends.

  3. If vertices are selected, it proceeds to smooth the skin weights of these vertices.

  4. Then, the selection is expanded to include adjacent vertices.

  5. The skin weights of these adjacent vertices are then smoothed.

  6. The process ends after smoothing adjacent vertices.

HyperSkin.smoothSkinWeights(self, vtxListOrMesh=None, jntList=None, smoothCount=1, prefixSide=None, **shortArgs)#

[shArgs : vlm=vtxListOrMesh, jl=jntList, sc=smoothCount, ps=prefixSide]

Purpose:

:: Performs smooth skinning on a list of vertices or a mesh by iteratively smoothing the skin weights in Autodesk Maya.

  • Enhances skin deformation quality by smoothing the skin weights, ensuring a more natural deformation of the mesh during animation.

  • Provides flexibility by allowing smoothing on a specific list of vertices, an entire mesh, or based on a side prefix.

  • Supports multiple smoothing iterations for refined skin weight distribution.

Parameters:
  • vtxListOrMesh – <str/list> #Vertices list or mesh object to be smoothed.

  • jntList – <list, optional> #List of joints influencing the vertices. If not specified, it’s automatically determined.

  • smoothCount – <int> #Number of smoothing iterations to apply.

  • prefixSide – <str, optional> #Side prefix to filter vertices for smoothing (e.g., ‘L_’ for left side).

Return:

  • None. The function applies smoothing directly to the skin weights of the specified vertices or mesh.

Usage Example::
>>> smoothSkinWeights('pSphere1', smoothCount=3)
# Smooths the skin weights of 'pSphere1' mesh with 3 iterations.
>>> smoothSkinWeights(vtxList=['pSphere1.vtx[1]', 'pSphere1.vtx[2]'], smoothCount=2)
# Smooths skin weights of specified vertices of 'pSphere1' with 2 iterations.
Note:

  • It’s essential to have a skinCluster associated with the vertices or mesh for successful smoothing.

  • The function can be used to target specific areas of a rigged mesh for more detailed skin weight adjustments.

graph TB Start[("fa:fa-play Start")] --> DetermineMeshAndJoints{"/fas:fa-search Determine Mesh and Joints"} DetermineMeshAndJoints --> ApplySmoothing{"/fas:fa-brush Apply Smoothing"} ApplySmoothing --> IterativeSmoothing{"/fas:fa-sync-alt Iterative Smoothing"} IterativeSmoothing --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineMeshAndJoints fill:#ffcc00,stroke:#000,stroke-width:2px style ApplySmoothing fill:#99ccff,stroke:#000,stroke-width:2px style IterativeSmoothing fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the smoothSkinWeights function:

  1. The process begins by determining the mesh and the joints influencing the specified vertices.

  2. The function then applies the initial skin smoothing.

  3. Iterative smoothing is performed based on the specified smooth count.

  4. The process completes after the smoothing iterations are applied, enhancing the skin deformation quality.

HyperSkin.snapDisc2SkinMesh(self, jntDisc, skinMesh, snapRotateTo=None, refineDisc=False)#

[shArgs : none]

Purpose:

:: Aligns a polygonal disc to the surface of a skin mesh in Autodesk Maya, refining its position and orientation for better rig control and visualization.

  • Provides an efficient way to align control discs to skin mesh surfaces, ensuring accuracy in rigging.

  • Offers options for refining the disc position and optionally aligning its rotation to another object.

  • Enhances rig controls’ integration with the character’s geometry, improving the animator’s experience.

Usage Example:

>>> alignedDisc = snapDisc2SkinMesh('jntDisc', 'skinMesh', snapRotateTo='directionJoint')
# Aligns the disc 'jntDisc' to the 'skinMesh' surface and optionally aligns its rotation to 'directionJoint'.

Note: - It’s crucial to provide a correctly positioned joint disc and a target skin mesh for accurate alignment. - The function can optionally refine the disc’s placement and align its rotation to another object, like a joint, to match directional orientation.

Parameters:

  • jntDisc: (<str/PyNode>) The joint disc that needs to be aligned to the skin mesh.

  • skinMesh: (<str/PyNode>) The target skin mesh to which the disc will be aligned.

  • snapRotateTo: (<str/PyNode>, optional) An object to which the disc’s rotation will be aligned.

  • refineDisc: (<bool>, optional) If set to True, refines the position of the disc for a better fit.

Returns:

<PyNode> #The aligned joint disc as a PyNode object.

graph TB Start[("fa:fa-play Start")] --> SetVariables["/fas:fa-cogs Set Initial Variables"] SetVariables --> DetachGuides["/fas:fa-cut Detach Outer and Inner Guides"] DetachGuides --> AlignCVs["/fas:fa-arrows-alt Align Control Vertices"] AlignCVs --> RefineDisc{"/fas:fa-tools Refine Disc?"} RefineDisc --"Yes"--> RefineCVs["/fas:fa-sync-alt Refine Control Vertices"] RefineCVs --> CreateLoftedDisc["/fas:fa-layer-group Create Lofted Disc"] RefineDisc --"No"--> CreateLoftedDisc AlignCVs --> CreateLoftedDisc CreateLoftedDisc --> ApplyShader["/fas:fa-paint-brush Apply Shader"] ApplyShader --> AlignRotation{"/fas:fa-sync-alt Align Rotation?"} AlignRotation --"Yes"--> SetRotation["/fas:fa-redo-alt Set Aligned Rotation"] AlignRotation --"No"--> Cleanup["/fas:fa-broom Cleanup and Finalize"] SetRotation --> Cleanup Cleanup --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SetVariables fill:#ffcc00,stroke:#000,stroke-width:2px style DetachGuides fill:#99ccff,stroke:#000,stroke-width:2px style AlignCVs fill:#99ccff,stroke:#000,stroke-width:2px style RefineDisc fill:#ffcc00,stroke:#000,stroke-width:2px style RefineCVs fill:#99ccff,stroke:#000,stroke-width:2px style CreateLoftedDisc fill:#99ccff,stroke:#000,stroke-width:2px style ApplyShader fill:#cc99ff,stroke:#000,stroke-width:2px style AlignRotation fill:#ffcc00,stroke:#000,stroke-width:2px style SetRotation fill:#99ccff,stroke:#000,stroke-width:2px style Cleanup fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart outlines the snapDisc2SkinMesh function:

  1. The process starts, and initial variables are set.

  2. Outer and inner guide controls are detached from the joint disc.

  3. Control vertices of the outer guide are aligned to the skin mesh surface.

  4. Based on the refineDisc option, control vertices may be further refined for a better fit.

  5. A new lofted disc is created from the aligned and refined guides.

  6. A shader is applied to the new disc for visualization.

  7. If snapRotateTo is provided, the disc’s rotation is aligned to the specified object.

  8. Any remaining guides are cleaned up, and the final joint disc is returned.

  9. The process ends.

HyperSkin.snapPiv_Obj(self, srcObj, destObj=[0, 0, 0])#

[shArgs : so=srcObj, do=destObj]

Purpose:

:: Snaps the pivot of a source object to a destination object or position.

  • This function is useful for accurately positioning the pivot points of objects in 3D space.

  • It enhances precision in animation and modeling workflows by allowing for exact pivot placement.

Parameters:
  • srcObj – <str> # Source object whose pivot is to be snapped.

  • destObj – <list/str, optional> # Destination object or position. Defaults to [0, 0, 0].

Returns:

None # This function does not return any value.

Code Examples:

>>> source_object = "cube1"
>>> destination_position = [1, 2, 3]
>>> snap_pivot_obj = snapPiv_Obj(source_object, destination_position)
graph TB style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style GetSrcObject fill:#00ccff,stroke:#000,stroke-width:2px style GetDestObject fill:#00ccff,stroke:#000,stroke-width:2px style GetDestinationPosition fill:#00cc00,stroke:#000,stroke-width:2px style MovePivot fill:#00cc00,stroke:#000,stroke-width:2px style ReturnSuccess fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px CheckShArgs --"If shArgs Exist"--> GetSrcObject{"/fas:fa-cogs Check Arguments"} CheckShArgs --"If shArgs Does Not Exist"--> GetSrcObject GetSrcObject --"Get Source Object"--> GetDestObject{"/fas:fa-search Get Destination Object"} GetDestObject --"Get Destination Object"--> GetDestinationPosition{"/fas:fa-search Get Destination Position"} GetDestinationPosition --"Get Destination Position"--> MovePivot{"/fas:fa-arrows-alt-h Move Pivot"} MovePivot --"Move Pivot"--> ReturnSuccess{"/fas:fa-check Return Success"} ReturnSuccess --"Return Success"--> End
Flow Chart Description:

This flowchart illustrates the snapPiv_Obj function:

  1. Starts the process by checking if shArgs exist.

  2. If shArgs exist, it proceeds to get the source object and destination object.

  3. If shArgs do not exist, it defaults to getting the source object and destination object.

  4. It then retrieves the destination position.

  5. It moves the pivot of the source object to the destination position.

  6. The function returns success.

HyperSkin.snapRot(self, src, destObj, dirUpObj=None, aimAxis=[1, 0, 0], upAxis=[0, 1, 0])#

[shArgs : s=src, do=destObj, duo=dirUpObj, aa=aimAxis, ua=upAxis]

Purpose:

:: Snaps the rotation of a source object to a destination object, with optional directional constraints.

  • This function is crucial for aligning objects precisely in 3D space, particularly in animation and rigging.

  • The optional directional constraints offer more control over the rotation alignment, making it versatile for various scenarios.

Parameters:
  • src – <str/list> # Source object or list of objects.

  • destObj – <str> # Destination object to snap to.

  • dirUpObj – <str, optional> # Object to define the ‘up’ direction. Default is None.

  • aimAxis – <list, optional> # Axis to aim during snapping. Default is [1, 0, 0].

  • upAxis – <list, optional> # ‘Up’ axis direction. Default is [0, 1, 0].

Returns:

None # This function does not return any value.

Code Examples:

>>> source_object = "obj1"
>>> destination_object = "target_obj"
>>> up_direction_object = "up_obj"
>>> aim_axis = [1, 0, 0]
>>> up_axis = [0, 1, 0]
>>> snap_rot = snapRot(source_object, destination_object, up_direction_object, aim_axis, up_axis)
graph TB style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style ConvertSrcToList fill:#ff9999,stroke:#000,stroke-width:2px style CheckConstraints fill:#99ccff,stroke:#000,stroke-width:2px style ApplyConstraints fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px Start[("fa:fa-play Start")] --> CheckShArgs{"/fas:fa-question-circle Check shArgs"} CheckShArgs --"If shArgs provided"--> ConvertSrcToList["/fas:fa-list-ol Convert Src to List"] CheckShArgs --"If shArgs not provided"--> ConvertSrcToList ConvertSrcToList --> CheckConstraints{"/fas:fa-sliders-h Check Constraints"} CheckConstraints --"If dirUpObj and aimAxis and upAxis"--> ApplyConstraints["/fas:fa-compress-arrows-alt Apply Aim Constraint"] CheckConstraints --"If only aimAxis and upAxis"--> ApplyConstraints["/fas:fa-expand-arrows-alt Apply Orient Constraint"] CheckConstraints --"No constraints"--> ApplyConstraints["/fas:fa-sync-alt Snap Rotation Directly"] ApplyConstraints --> End[("fas:fa-stop End")]
Flow Chart Description:

This flowchart illustrates the snapRot function:

  1. The process begins by checking if shArgs are provided, updating parameters like src, destObj, dirUpObj, aimAxis, and upAxis.

  2. It converts src into a list if it’s not already one.

  3. The function checks for the presence of directional constraints.

  4. Based on the constraints, it applies either an aim constraint, orient constraint, or snaps the rotation directly.

  5. The function concludes after applying the necessary rotation snapping to the source objects.

HyperSkin.snapTo_Obj(self, srcObjList, destObj=[0, 0, 0], snapRot=False)#

[shArgs : sol=srcObjList, do=destObj, sr=snapRot]

Purpose:

:: Snaps a list of source objects to a destination object or position, with an optional rotation snap.

  • This function allows precise positioning of objects in 3D space, useful in rigging and scene layout.

  • The optional rotation snap feature aligns the source objects’ orientations with the destination, enhancing the utility for animation tasks.

Parameters:
  • srcObjList – (<list>) # List of source objects to be snapped. srcObjList = srcObj | srcObjList (list of srcObjs)

  • destObj – (<list/str>, optional) # Destination object or position. Defaults to [0, 0, 0]. If a string is provided, it is interpreted as an object name.

  • snapRot – (<bool>, optional) # If True, snaps the rotation of source objects to the destination object. Default is False. if snapRot : Snaps srcObj’s rotation to destObj #_ destObj needs to be given

Returns:

None # This function does not return any value.

Code Examples:

>>> source_objects = ["obj1", "obj2", "obj3"]
>>> destination_position = [5, 10, 15]
>>> snap_to_obj = snapTo_Obj(source_objects, destination_position, snapRot=True)
graph TB style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style IterateObjects fill:#99ccff,stroke:#000,stroke-width:2px style GetDestination fill:#00ccff,stroke:#000,stroke-width:2px style SnapPosition fill:#00cc00,stroke:#000,stroke-width:2px style SnapRotation fill:#00cc00,stroke:#000,stroke-width:2px style ReturnSuccess fill:#00cc00,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px CheckShArgs --"If shArgs Exist"--> IterateObjects{"/fas:fa-cogs Check Arguments"} CheckShArgs --"If shArgs Does Not Exist"--> IterateObjects IterateObjects --"Iterate Through Source Objects"--> GetDestination{"/fas:fa-search Get Destination"} GetDestination --"Get Destination"--> SnapPosition{"/fas:fa-map-marker Snap Position"} SnapPosition --"Snap Position"--> SnapRotation{"/fas:fa-sync Snap Rotation"} SnapRotation --"Snap Rotation"--> ReturnSuccess{"/fas:fa-check Return Success"} ReturnSuccess --"Return Success"--> End
Flow Chart Description:

This flowchart illustrates the snapTo_Obj function:

  1. Starts the process by checking if shArgs exist.

  2. If shArgs exist, it proceeds to iterate through source objects.

  3. If shArgs do not exist, it defaults to iterating through source objects.

  4. It gets the destination object or position.

  5. It snaps the source objects to the destination position.

  6. If the snapRot parameter is set to True, it also snaps the rotation of source objects to the destination.

  7. The function returns success.

HyperSkin.snapTo_Vtx(self, srcList, vtx=[0, 0, 0])#

[shArgs : none]

Purpose:

:: Snaps the specified object or list of objects to a given vertex or position in Autodesk Maya.

  • Facilitates precise positioning of objects in 3D space, aligning them to specific vertices.

  • Essential for rigging and modeling, where accurate placement of objects relative to mesh vertices is crucial.

Parameters:
  • srcList – <list/str> #Source object or list of objects to be snapped. | srcList = srcObj | srcObjList (list of srcObjs)

  • vtx – <list/str> #Target vertex or position to which the source object(s) will be snapped.

Usage Example:

>>> snapTo_Vtx('pCube1', [2.0, 1.5, 2.2])
# Snaps 'pCube1' to the coordinates [2.0, 1.5, 2.2].

Note: - If a single object is provided, it is converted to a list for uniform processing. - Handles both a single target vertex or a list of target positions. - Ensures the pivot point of the source object aligns accurately with the target position.

Flow Chart Description:

The flowchart for the snapTo_Vtx function:

  1. The process starts by checking if the source is a single object or a list.

  2. For each source object in the list, the function calculates the required transformation.

  3. The source object is then moved to align its pivot with the target vertex or position.

  4. The process is repeated for each source object, ensuring precise alignment with the target.

graph TB Start[("fa:fa-play Start")] --> CheckInputType{"Check if srcList is a list"} CheckInputType --"Single Object"--> ConvertToList["Convert to List"] ConvertToList --> CalculateTransformation["Calculate Required Transformation"] CheckInputType --"Already a List"--> CalculateTransformation CalculateTransformation --> MoveObject["Move Each Object to Target"] MoveObject --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckInputType fill:#ffcc00,stroke:#000,stroke-width:2px style ConvertToList fill:#99ccff,stroke:#000,stroke-width:2px style CalculateTransformation fill:#99ff99,stroke:#000,stroke-width:2px style MoveObject fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.solveEndJnts(self)#

[shArgs : none]

Purpose:

:: Solves end joints in Autodesk Maya by creating vertex sets at the ends of mesh parts, often used in character rigging.

  • Addresses common rigging challenges where end joints need precise skinning or deformation.

  • Automates the process of identifying and isolating end joints for targeted skinning and manipulation.

Usage Example:

>>> solveEndJnts()
# Solves end joints for the selected top joints in the scene.

Note: - The function is most effective in scenarios where the rig’s skinning needs refinement at extremities, such as fingers or toes. - Select the top joints of the chain (e.g., finger base joints) before running this function.

Parameters:

  • sidePrefix: (<str>, optional) The prefix used to identify the side of the mesh for vertex selection. Typical values are ‘L_’ for left and ‘R_’ for right.

Return:

  • None, but it updates global variables used for processing vertex sets related to end joints.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Selection"} CheckSelection -- "Joints Selected" --> ProcessJoints["/fas:fa-cogs Process End Joints"] CheckSelection -- "No Joints Selected" --> Error["/fas:fa-exclamation-triangle Error: No Top Joints Selected"] ProcessJoints --> CreateVertexSets["/fas:fa-vector-square Create Vertex Sets"] CreateVertexSets --> Finalize["/fas:fa-check Finalize Vertex Sets"] Error --> End[("fas:fa-stop End")] Finalize --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessJoints fill:#99ccff,stroke:#000,stroke-width:2px style CreateVertexSets fill:#cc99ff,stroke:#000,stroke-width:2px style Finalize fill:#99ff99,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the solveEndJnts function:

  1. The process begins by checking if the top joints of a mesh part are selected.

  2. If no joints are selected, an error is displayed indicating the need to select top joints.

  3. If joints are selected, the function processes these end joints for solving.

  4. It creates vertex sets at the ends of the mesh parts corresponding to these joints.

  5. After creating and refining these vertex sets, the process is finalized.

  6. The process ends either after finalizing vertex sets or if no joints are selected initially.

HyperSkin.sortByDict(self, dictName, sortType='up', returnType='keys')#

[shArgs : none]

Purpose:

:: Sorts a dictionary by its values and returns sorted keys or values in Autodesk Maya.

  • Useful for organizing data in a dictionary based on numeric values.

  • Provides options for ascending (‘up’) or descending (‘down’) sorting.

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

  • sortType – <str> (default ‘up’) #Sorting order: ‘up’ for ascending, ‘down’ or ‘dn’ for descending.

  • returnType – <str> (default ‘keys’) #Determines the return type: ‘keys’ or ‘values’.

Usage Example:

>>> sortByDict({'j1':10, 'j2':2, 'j3':-1.0, 'j4':50.0, 'j5':0, 'j6':10}, 'up')
# Returns the keys of the dictionary sorted in ascending order based on their values.

Note: - The function is ideal for scenarios where sorting of data in a dictionary is needed based on numeric values. - The returnType parameter allows flexibility in retrieving either sorted keys or values. - Handles both integer and float values for sorting.

Flow Chart Description:

The flowchart for the sortByDict function:

  1. The function receives a dictionary and sorting parameters.

  2. It checks if the values are numeric (int or float) for sorting.

  3. Sorts the dictionary based on the specified order (‘up’ or ‘down’).

  4. Returns either sorted keys or values based on the returnType parameter.

graph TB Start[("fa:fa-play Start")] --> CheckDict{Check if Input is Dictionary} CheckDict --"If Not"--> Error[("fas:fa-exclamation-circle Error: Not a Dictionary")] CheckDict --"If Yes"--> CheckNumeric{Check if Values are Numeric} CheckNumeric --"Non-Numeric"--> Error2[("fas:fa-exclamation-circle Error: Non-Numeric Values")] CheckNumeric --"Numeric"--> SortValues{Sort Values Based on sortType} SortValues --> ReturnSorted["Return Sorted Keys or Values"] Error --> End[("fas:fa-stop End")] Error2 --> End ReturnSorted --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckDict fill:#ffcc00,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style CheckNumeric fill:#99ccff,stroke:#000,stroke-width:2px style Error2 fill:#ff6666,stroke:#000,stroke-width:3px style SortValues fill:#99ff99,stroke:#000,stroke-width:2px style ReturnSorted fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.startProgressWin(self, numObjs=0, winTitle=None, progressNote=None, doInterrupt=True, innerObjs=None, innerList=None, refreshView=0, useProgress=1, innerNote='Inner Progress', **shArgs)#

[shArgs : no=numObjs, wt=winTitle, pn=progressNote, di=doInterrupt, io=innerObjs, il=innerList, rv=refreshView, up=useProgress]

Purpose:

:: Initializes a custom progress window for tracking operations in Autodesk Maya.

  • Essential for visualizing the progress of lengthy operations or scripts.

  • Supports tracking both main and inner loops, with options for interrupting the process.

Parameters:
  • numObjs – <int> #Number of objects or operations to track in the main loop.

  • winTitle – <str> #Title of the progress window.

  • progressNote – <str> #Initial message displayed in the progress window.

  • doInterrupt – <bool> (default True) #Allows interruption of the progress.

  • innerObjs – <list/int> #Number of objects or operations in the inner loop.

  • innerList – <list> #List of items in the inner loop for progress tracking.

  • refreshView – <int> #Determines if the view should be refreshed during the process.

  • useProgress – <bool> (default True) #Enables or disables the use of the progress window.

  • innerNote – <str> (default ‘Inner Progress’) #Note for the inner progress bar.

Usage Example:

>>> startProgressWin(100, 'Processing Data', 'Progress: ', innerObjs=50)
# Initializes a progress window for 100 main operations and 50 inner operations.

Usage (If inner loop exist):

HyperSkin.startProgressWin(jntList_outer, 'Solving Joints !!', 'Please Wait', innerObjs=vtxList_someList)
        HyperSkin.startProgressWin(innerList=vtxList_inner)
                HyperSkin.progressWin(ci=vtx, innerList=vtxList_inner, ep=0, spt=__showProgressTime)
        HyperSkin.progressWin(ci=jnt)
HyperSkin.endProgressWin(jntList, 1)

Note: - Ideal for complex scripts where progress tracking is critical. - The function creates a new Maya window with progress bars and relevant information. - Customizable for different scenarios with main and inner operation tracking.

Flow Chart Description:

The flowchart for the startProgressWin function:

  1. The function is initiated with the given parameters.

  2. If ‘useProgress’ is True, the function proceeds to create a custom progress window.

  3. The window displays the progress of main and, if provided, inner operations.

  4. The user can monitor and, if enabled, interrupt the process through this window.

graph TB Start[("fa:fa-play Start")] --> CheckUseProgress{Check useProgress} CheckUseProgress --"If True"--> CreateWindow["Create Custom Progress Window"] CreateWindow --> InitializeProgress["Initialize Progress Bars and Settings"] InitializeProgress --> DisplayWindow["Display Progress Window"] CheckUseProgress --"If False"--> End[("fas:fa-stop End")] DisplayWindow --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckUseProgress fill:#ffcc00,stroke:#000,stroke-width:2px style CreateWindow fill:#99ccff,stroke:#000,stroke-width:2px style InitializeProgress fill:#99ff99,stroke:#000,stroke-width:2px style DisplayWindow fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.startTime(self, runCompute=True)#

[shArgs : none]

Purpose:

:: Initializes a timer for performance tracking in Autodesk Maya, particularly for ‘HyperSkin.computeTime()’ function.

  • Essential for calculating the total time taken by a process or set of operations in Maya.

  • Primarily used in performance analysis and optimization of scripts or functions.

Parameters:

runCompute – <bool> (default True) #Determines whether to start the timer or not.

Usage Example:

>>> startTime()
# Starts the timer for performance tracking.

Note: - The function sets a global variable ‘__start_Time’ to the current time. - Essential for developers and technical artists to optimize and debug their scripts. - The time calculation is displayed in Maya’s script editor for easy monitoring.

Flow Chart Description:

The flowchart for the startTime function:

  1. The process begins when the function is called.

  2. If the ‘runCompute’ parameter is set to True, the timer starts.

  3. The start time is stored in the global variable ‘__start_Time’.

  4. An information message is displayed in Maya’s script editor indicating the start of the timer.

graph TB Start[("fa:fa-play Start")] --> CheckRunCompute{Check runCompute} CheckRunCompute --"If True"--> StartTimer["Start Timer"] StartTimer --> StoreStartTime["Store Start Time in Global Variable"] StoreStartTime --> DisplayInfo["Display Start Time Info in Script Editor"] CheckRunCompute --"If False"--> End[("fas:fa-stop End")] DisplayInfo --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckRunCompute fill:#ffcc00,stroke:#000,stroke-width:2px style StartTimer fill:#99ccff,stroke:#000,stroke-width:2px style StoreStartTime fill:#99ff99,stroke:#000,stroke-width:2px style DisplayInfo fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.test(self)#

[shArgs : none]

Purpose:

:: Identifies and selects the nearest geometry to a given vertex from a list of geometries in Autodesk Maya.

  • Useful in scenarios where the closest geometry to a specified vertex needs to be identified, such as in skinning or rigging processes.

  • Streamlines tasks that require spatial relationships between geometries, enhancing efficiency in 3D modeling or rigging.

Usage Example:

>>> test()
# Selects a vertex and then identifies and selects the nearest geometry from a list of specified geometries.
Parameters:

  • None. The function operates based on the currently selected vertex and a predefined list of geometries.

Return:

  • None. The closest geometry to the selected vertex is automatically selected in the Maya scene.

Note:

  • Ensure a vertex is selected before executing this function for accurate results.

  • The function relies on a list of predefined geometries to compare distances.

graph TB Start[("fa:fa-play Start")] --> SelectVertex["/fas:fa-mouse-pointer Select Vertex"] SelectVertex --> RetrieveGeometries["/fas:fa-shapes Retrieve List of Geometries"] RetrieveGeometries --> IdentifyClosestGeometry["/fas:fa-ruler-combined Identify Closest Geometry"] IdentifyClosestGeometry --> SelectClosestGeometry["/fas:fa-hand-pointer Select Closest Geometry"] SelectClosestGeometry --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectVertex fill:#99ccff,stroke:#000,stroke-width:2px style RetrieveGeometries fill:#99ccff,stroke:#000,stroke-width:2px style IdentifyClosestGeometry fill:#99ccff,stroke:#000,stroke-width:2px style SelectClosestGeometry fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart demonstrates the test function:

  1. The process starts with the selection of a vertex in the Maya scene.

  2. The function then retrieves a list of geometries to compare against the selected vertex.

  3. It identifies the closest geometry to the selected vertex based on spatial proximity.

  4. The nearest geometry is automatically selected in the Maya scene, concluding the process.

HyperSkin.transferSkin(self, srcMesh_Or_VtxList=None, destMesh_Or_VtxList=None, removeSrcClust=False, removeDestClust=True, trgtPrfx=None)#

[shArgs : none]

Purpose:

:: Transfers skin weights from a source mesh or vertices to a destination mesh or vertices in Autodesk Maya.

  • Facilitates the transfer of skinning data between different meshes, useful in character rigging workflows.

  • Supports transferring weights from selected vertices, providing precise control over the skinning transfer.

  • Offers options to remove existing skin clusters and manage influence objects during the transfer process.

Usage Example:

>>> transferSkin(srcMesh_Or_VtxList="pCube1", destMesh_Or_VtxList="pCube2", removeSrcClust=True, removeDestClust=False, trgtPrfx=None)
# Transfers skin weights from 'pCube1' to 'pCube2', removes the skin cluster from 'pCube1', and retains the skin cluster on 'pCube2'.
Parameters:

  • srcMesh_Or_VtxList: (<str/list>, optional) Source mesh name or list of vertex names to transfer weights from.

  • destMesh_Or_VtxList: (<str/list>, optional) Destination mesh name or list of vertex names to transfer weights to.

  • removeSrcClust: (<bool>, optional) If True, removes the skin cluster from the source mesh after transfer. Defaults to False.

  • removeDestClust: (<bool>, optional) If True, removes the existing skin cluster on the destination mesh before transfer. Defaults to True.

  • trgtPrfx: (<str>, optional) Target prefix for destination mesh names, used when transferring weights to multiple meshes. Defaults to None.

Return:

  • None. The function modifies the skinning on the destination mesh based on the source mesh’s skin weights.

Note:

  • Ensure that the source and destination meshes are properly set up in the Maya scene before executing this function.

  • Useful for rigging characters where similar meshes (like left and right limbs) need to have consistent skinning.

  • The function can handle complex scenarios like partial weight transfers and managing influence objects.

graph TB Start[("fa:fa-play Start")] --> CheckMeshes{"/fas:fa-check-square Check Source & Destination Meshes"} CheckMeshes --"If Meshes Valid"--> TransferWeights{"/fas:fa-exchange-alt Transfer Skin Weights"} CheckMeshes --"If Meshes Invalid"--> End[("fas:fa-stop End")] TransferWeights --> ManageInfluences{"/fas:fa-user-friends Manage Influence Objects"} ManageInfluences --> RemoveSkinClusters{"/fas:fa-trash-alt Remove Skin Clusters"} RemoveSkinClusters --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style TransferWeights fill:#99ccff,stroke:#000,stroke-width:2px style ManageInfluences fill:#99ff99,stroke:#000,stroke-width:2px style RemoveSkinClusters fill:#ff99cc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart describes the transferSkin function:

  1. The process starts by checking the validity of the source and destination meshes or vertices.

  2. If valid, the function transfers the skin weights from the source to the destination.

  3. The function then manages any influence objects associated with the skinning.

  4. Optionally, it removes the skin clusters from the source and/or destination meshes as specified.

  5. The process ends after the skin weights are successfully transferred and any post-transfer operations are completed.

Testing:

HyperSkin.transferSkin(trgtPrfx='Trgt_')
HyperSkin.transferSkin_Jnt2Jnt(self, skinMesh=None, srcJnt=None, trgtJnt=None, trgtPrefix=None)#

[shArgs : none]

Purpose:

:: Transfers skinning information from one joint to another joint on the specified skinned mesh in Autodesk Maya.

  • Useful in rigging scenarios where skin weights need to be transferred from one joint to another, such as during rig modifications or updates.

  • Supports both single and multiple mesh transfers with optional joint prefixes for target joints.

  • Provides an interactive UI for specifying source and target joints and skinned mesh.

Usage Example:

>>> transferSkin_Jnt2Jnt(skinMesh='characterMesh', srcJnt='oldArmJoint', trgtJnt='newArmJoint')
# Transfers skin weights from 'oldArmJoint' to 'newArmJoint' on 'characterMesh'.
Parameters:

  • skinMesh: The mesh on which the skin weights are to be transferred.

  • srcJnt: The source joint from which skin weights are to be transferred.

  • trgtJnt: The target joint to which skin weights are to be transferred.

  • trgtPrefix: An optional prefix for the target joint, useful when transferring skin weights to a similar joint on a different side of the body.

Return:

  • None. The function performs the transfer of skin weights from the source joint to the target joint on the specified mesh.

Note:

  • Ensure the skin mesh and the joints involved in the transfer are correctly specified.

  • The function can handle multiple meshes and joint influences, adapting to various rigging setups.

graph TB Start[("fa:fa-play Start")] --> GetInputs["/fas:fa-edit Get Inputs"] GetInputs --> CheckMesh{"Check if Skinned"} CheckMesh --"Skinned Mesh"--> TransferWeights["/fas:fa-exchange-alt Transfer Weights"] CheckMesh --"Not Skinned"--> Error{"/fas:fa-exclamation-triangle Error"} TransferWeights --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetInputs fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMesh fill:#ffcc00,stroke:#000,stroke-width:2px style TransferWeights fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_Jnt2Jnt function:

  1. The process begins by gathering inputs such as the skinned mesh, source joint, target joint, and optional target prefix.

  2. It checks whether the specified mesh is skinned.

  3. If the mesh is skinned, it proceeds to transfer the skin weights from the source joint to the target joint.

  4. If the mesh is not skinned, it displays an error message.

  5. The process ends after the transfer is complete or if an error occurs.

HyperSkin.transferSkin_Jnts2Jnts(self, prefix=None, skinMesh=None, transferType=None, **shArgs)#

[shArgs : p=prefix, sm=skinMesh, tt=transferType]

Purpose:

:: Transfers skinning from a set of original joints to a duplicated joint chain in Autodesk Maya. This function is particularly useful for creating a single hierarchy joint chain for motion capture purposes.

  • Allows the creation of a duplicate joint chain that can be used independently of the original rig, while maintaining skinning information.

  • Supports various options for joint naming conventions and skin weight transfer.

Usage Example:

>>> transferSkin_Jnts2Jnts(prefix='mocap_', skinMesh='characterMesh', transferType='OneToOne')
# Duplicates the skinned joints with a prefix 'mocap_', and transfers skinning from the original joints to the new joint chain for 'characterMesh'.
Parameters:
param prefix:

<str> The prefix to be added to the duplicated joints.

param skinMesh:

<str> The name of the skinned mesh whose joints are to be duplicated and transferred.

param transferType:

<str> Specifies the type of skin weight transfer (e.g., ‘OneToOne’).

Return:
  • None. The function performs the operation of duplicating and transferring skin weights to a new joint chain.

Note:
  • It’s important to select the mesh or joints correctly before running this function.

  • The function can create a single hierarchy or retain the original joint hierarchy based on user input.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-question-circle Check Selection"} CheckSelection --"Mesh Selected"--> DuplicateJoints["/fas:fa-clone Duplicate Joints"] CheckSelection --"Joints Selected"--> DuplicateJoints DuplicateJoints --> TransferSkinning["/fas:fa-exchange-alt Transfer Skinning"] TransferSkinning --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style DuplicateJoints fill:#99ccff,stroke:#000,stroke-width:2px style TransferSkinning fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_Jnts2Jnts function:

  1. The process starts by checking the user’s selection, which can be either a mesh or joints.

  2. Based on the selection, the function duplicates the joints with the specified prefix.

  3. After duplication, skinning is transferred from the original joints to the duplicated joint chain.

  4. The process concludes once the skin weight transfer is complete.

Useful for creating single hierarchy joint chain for MoCap purpose

HyperSkin.transferSkin_ManyToMany_Mesh(self, transferType=2, **shArgs)#

[shArgs : tt=transferType]

Purpose:

:: Facilitates the transfer of skin weights from multiple source meshes to multiple target meshes in Autodesk Maya.

  • Streamlines the process of transferring skin weights in complex scenes with multiple meshes.

  • Allows for efficient skinning adjustments across similar geometries or variations of a character model.

Usage Example:

>>> transferSkin_ManyToMany_Mesh(transferType=2)
# Transfers skin weights from selected source meshes to their corresponding target meshes.
Parameters:

  • param transferType:

    <int> #Type of skin weight transfer to perform. E.g., 1 for closest point on surface, 2 for raycast, etc.

Return:

  • None. The function performs the skin weight transfer process and provides feedback via Maya’s UI.

Note:

  • Ensure that the target and source meshes are properly selected in Maya before executing this function.

  • The function uses a naming convention or vertex count to match source and target meshes.

  • The function provides feedback if any source mesh is not skinned or if the target mesh for a source mesh is not found.

graph TB Start[("fa:fa-play Start")] --> SelectMeshes{"/fas:fa-mouse-pointer Select Meshes"} SelectMeshes --> DetermineTargets{"/fas:fa-crosshairs Determine Target Meshes"} DetermineTargets --> CheckSkinned{"/fas:fa-check-circle Check if Source Meshes are Skinned"} CheckSkinned --"If Not Skinned"--> ErrorNonSkinned["/fas:fa-exclamation-triangle Error: Source Mesh Not Skinned"] CheckSkinned --"If Skinned"--> TransferWeights{"/fas:fa-exchange-alt Transfer Skin Weights"} TransferWeights --> CheckSuccess{"/fas:fa-tasks Check Transfer Success"} CheckSuccess --"If Successful"--> SuccessMessage["/fas:fa-thumbs-up Success Message"] CheckSuccess --"If Skipped"--> ErrorMessage["/fas:fa-times-circle Error Message"] ErrorNonSkinned --> End[("fas:fa-stop End")] ErrorMessage --> End SuccessMessage --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineTargets fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinned fill:#99ccff,stroke:#000,stroke-width:2px style ErrorNonSkinned fill:#ff6666,stroke:#000,stroke-width:3px style TransferWeights fill:#99ff99,stroke:#000,stroke-width:2px style CheckSuccess fill:#99ccff,stroke:#000,stroke-width:2px style ErrorMessage fill:#ff6666,stroke:#000,stroke-width:3px style SuccessMessage fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart explains the transferSkin_ManyToMany_Mesh function:

  1. The process starts with selecting the source and target meshes in Maya.

  2. The function identifies target meshes for each source mesh based on naming conventions or vertex count.

  3. It checks if each source mesh has skin weights applied.

  4. If a source mesh is not skinned, an error message is displayed.

  5. For skinned source meshes, it transfers skin weights to the corresponding target meshes.

  6. The function then checks if the transfer was successful for each mesh.

  7. Depending on the outcome, a success or error message is displayed.

  8. The process ends once all transfers are checked and messages are displayed.

HyperSkin.transferSkin_ManyToOne_Mesh(self)#

[shArgs : none]

Purpose:

:: Transfers skinning information from one skinned source mesh to multiple target meshes in Autodesk Maya.

  • Essential for copying skin weights from a skinned source mesh to other geometry, ensuring consistent deformation.

  • Useful in scenarios where multiple variations of a character or object require identical skinning.

Usage Example:

>>> transferSkin_ManyToOne_Mesh()
# Transfers skin weights from the selected source mesh to multiple target meshes.
Flow Chart Description:

The transferSkin_ManyToOne_Mesh function executes these steps:

  1. Verifies if the appropriate number of meshes are selected and if the last selected mesh is skinned.

  2. Iterates through each vertex of the source skinned mesh.

  3. Finds the nearest vertex on each target mesh to the current source vertex.

  4. Transfers the skin weights from the source vertex to the corresponding nearest vertices on the target meshes.

  5. Updates the progress window during the process.

graph TB Start[("fa:fa-play Start")] --> ValidateSelection["/fas:fa-check-circle Validate Selection"] ValidateSelection --> ForEachVertex{"/fas:fa-dot-circle For Each Vertex in Source Mesh"} ForEachVertex --"For Each Vertex"--> FindNearestVertices["/fas:fa-search-location Find Nearest Vertices on Target Meshes"] FindNearestVertices --> TransferWeights["/fas:fa-exchange-alt Transfer Skin Weights"] TransferWeights --> UpdateProgress["/fas:fa-sync Update Progress Window"] UpdateProgress --> ForEachVertex ForEachVertex --"All Vertices Processed"--> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ValidateSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ForEachVertex fill:#99ccff,stroke:#000,stroke-width:2px style FindNearestVertices fill:#cc99ff,stroke:#000,stroke-width:2px style TransferWeights fill:#99ff99,stroke:#000,stroke-width:2px style UpdateProgress fill:#ffcc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Returns:

None. This function transfers skin weights to target meshes but does not return any value.

HyperSkin.transferSkin_ManyVtx2ManyVtx(self)#

[shArgs : none]

Purpose:

:: Transfers skinning data from multiple source vertices to multiple destination vertices in Autodesk Maya.

  • This method facilitates transferring skin weights between different mesh vertices, improving the rigging process.

  • Ideal for fine-tuning skinning on complex models by matching skin weights between similar geometric areas.

Usage Example:

>>> transferSkin_ManyVtx2ManyVtx()
# Transfers skin weights from the vertices in the source list to the selected destination vertices.
Parameters:

  • None. This function relies on selected vertices and a specified list of source vertices.

Return:

  • None. The function performs the skin weight transfer process.

Note:

  • Ensure that the destination vertices are selected and the source vertices are specified in the appropriate text field.

  • This function is useful when dealing with detailed skinning adjustments across different parts of a mesh.

graph TB Start[("fa:fa-play Start")] --> SelectDestVtx{"Select Destination Vertices"} SelectDestVtx --> SpecifySrcVtx{"Specify Source Vertices"} SpecifySrcVtx --> TransferSkinning["/fas:fa-exchange-alt Transfer Skinning"] TransferSkinning --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectDestVtx fill:#ffcc00,stroke:#000,stroke-width:2px style SpecifySrcVtx fill:#ffcc00,stroke:#000,stroke-width:2px style TransferSkinning fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_ManyVtx2ManyVtx function:

  1. The process starts with the selection of destination vertices on a mesh.

  2. The user then specifies the source vertices from which the skin weights will be transferred.

  3. The function transfers the skinning data from each source vertex to the corresponding closest destination vertex.

  4. The process completes once the skin weight transfer is done for all selected vertices.

HyperSkin.transferSkin_Mesh2Mesh(self, fromMesh=None, toMesh=None, transferType=2, showProgress=False, **shArgs)#

[shArgs : fm=fromMesh, tm=toMesh, tt=transferType]

Purpose:

:: Transfers skinning data from one mesh to another in Autodesk Maya, ensuring consistent deformation across similar meshes.

  • Facilitates the transfer of complex skinning setups, including joints and influence objects, from one mesh to another.

  • Supports various transfer types to accommodate different mesh alignments and associations.

  • Ideal for projects where similar characters or objects require consistent skin deformation.

Parameters:

  • fromMesh (<str, optional>): The name of the source mesh from which the skin weights will be copied.

  • toMesh (<str, optional>): The name of the target mesh to which the skin weights will be applied.

  • transferType (<int, optional>): Determines the method of weight transfer. ‘1’ for closest point association, ‘2’ for a combination of closest joint and one-to-one associations.

Return:

  • None. The function transfers the skin weights from the source mesh to the target mesh.

Note:

  • Ensure both source and target meshes are properly set up in the Maya scene for the transfer.

  • The function logs detailed information in the script editor, including the number of joints and influence objects involved.

graph TB Start[("fa:fa-play Start")] --> PrepareTransfer["/fas:fa-exchange-alt Prepare Transfer Data"] PrepareTransfer --> IdentifySkinCluster{"/fas:fa-search Identify SkinCluster"} IdentifySkinCluster --"If Found"--> ExtractInfluences["/fas:fa-list Extract Influences"] IdentifySkinCluster --"If Not Found"--> Error[("/fas:fa-exclamation-triangle Error")] ExtractInfluences --> ApplySkinning["/fas:fa-user-md Apply Skinning to Target Mesh"] ApplySkinning --> CopyWeights{"/fas:fa-copy Copy Weights"} CopyWeights --> End[("fas:fa-stop End")] Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style PrepareTransfer fill:#99ccff,stroke:#000,stroke-width:2px style IdentifySkinCluster fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractInfluences fill:#99ff99,stroke:#000,stroke-width:2px style ApplySkinning fill:#99ff99,stroke:#000,stroke-width:2px style CopyWeights fill:#cc99ff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for transferSkin_Mesh2Mesh function:

  1. The process begins with preparing the data for skin weight transfer.

  2. It identifies the SkinCluster on the source mesh.

  3. If found, it extracts the influences (joints and influence objects) for the transfer.

  4. Applies skinning to the target mesh using the extracted influences.

  5. Copies the skin weights from the source to the target mesh, including the influence weights.

  6. The process concludes once the skin weights are successfully transferred.

  7. If the SkinCluster is not found, the process ends with an error message.

HyperSkin.transferSkin_MeshToVtxList(self)#

[shArgs : none]

Purpose:

:: Transfers skinning information from one mesh to a list of target vertices on another mesh in Autodesk Maya.

  • Allows for precise transfer of skin weights from a skinned source mesh to specific vertices on a target mesh or meshes.

  • Enhances rigging workflows by enabling targeted skin weight adjustments across different mesh elements.

Usage Example:

>>> transferSkin_MeshToVtxList()
# Transfers skin weights from the selected source mesh to specified target vertices on one or more target meshes.
Parameters:

  • None. This function operates based on the selected vertices and the meshes specified in the GUI.

Return:

  • None. This function performs the skin weight transfer process without returning any specific value.

Note:

  • The source mesh should be skinned before using this function.

  • Target meshes should be specified in the GUI, and the vertices to transfer weights to should be selected in the scene.

  • Ensure the target vertices are properly selected for accurate weight transfer.

Flow Chart Description:

This flowchart illustrates the transferSkin_MeshToVtxList function:

  1. The function begins by fetching the target mesh names from the GUI and selected vertices from the scene.

  2. It then checks if the source mesh is skinned and initiates the skin weight transfer process.

  3. For each selected vertex, the nearest vertex on the target mesh is identified.

  4. Skin weights from the source mesh are transferred to the corresponding nearest vertices on the target mesh.

  5. The process repeats for each selected vertex and completes once all weights are transferred.

graph TB Start[("fa:fa-play Start")] --> FetchData["/fas:fa-list Fetch Mesh and Vertex Data"] FetchData --> CheckSkin["/fas:fa-search-plus Check If Source Mesh is Skinned"] CheckSkin --"Not Skinned"--> Error["/fas:fa-exclamation-triangle Error: Source Mesh Not Skinned"] CheckSkin --"Skinned"--> TransferWeights["/fas:fa-exchange-alt Transfer Skin Weights"] TransferWeights --> Progress["/fas:fa-spinner Progress Update"] Progress --> Complete[("fas:fa-stop End")] Error --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style FetchData fill:#ffcc00,stroke:#000,stroke-width:2px style CheckSkin fill:#99ccff,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:3px style TransferWeights fill:#99ccff,stroke:#000,stroke-width:2px style Progress fill:#99ff99,stroke:#000,stroke-width:2px style Complete fill:#ff6666,stroke:#000,stroke-width:3px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.transferSkin_NearestJnts2Jnts(self, skinMeshes=None, trgtJnts=None, transferAll=False, **shArgs)#

[shArgs : sm=skinMeshes, tj=trgtJnts, ta=transferAll]

Purpose:

:: Transfers skinning from the nearest joints of one set to another set of joints in Autodesk Maya.

  • Efficient for transferring skinning information in scenarios like replacing parts of a rig.

  • Supports selective or full transfer of skinning data.

Parameters:
  • skinMeshes – <list> #List of skin meshes for which the skinning transfer should be applied.

  • trgtJnts – <list> #List of target joints to transfer the skinning to.

  • transferAll – <bool> #Indicates whether to transfer skinning to all joints or only selected ones.

Note:

  • The function requires at least one skinMesh and one joint as input.

  • ‘transferAll’ option dictates whether the skinning transfer is applied to all joints or only a specified subset.

Usage Example:

>>> transferSkin_NearestJnts2Jnts(skinMeshes=myMeshes, trgtJnts=targetJoints, transferAll=False)
# Transfers skinning from nearest joints of 'myMeshes' to 'targetJoints'.
Return:

  • None. The function performs the transfer of skin weights without returning any value.

graph TB Start[("fa:fa-play Start")] --> CheckInputs{"/fas:fa-check-circle Check Inputs"} CheckInputs -- "Valid Inputs" --> DetermineTransferMode{"/fas:fa-exchange-alt Determine Transfer Mode"} CheckInputs -- "Invalid Inputs" --> End[("fas:fa-stop End")] DetermineTransferMode --"Transfer All"--> TransferAllJoints["/fas:fa-random Transfer All Joints"] DetermineTransferMode --"Transfer Selected"--> TransferSelectedJoints["/fas:fa-random Transfer Selected Joints"] TransferAllJoints --> End TransferSelectedJoints --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckInputs fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineTransferMode fill:#99ccff,stroke:#000,stroke-width:2px style TransferAllJoints fill:#cc99ff,stroke:#000,stroke-width:2px style TransferSelectedJoints fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_NearestJnts2Jnts function:

  1. The process begins, checking for the validity of the input meshes and joints.

  2. If inputs are invalid, the process ends.

  3. If inputs are valid, the function determines whether to transfer to all joints or only selected ones.

  4. Based on this decision, the function either transfers skin weights to all joints or only to the selected ones.

  5. The process completes after the transfer is executed.

HyperSkin.transferSkin_OneToMany_Mesh(self, transferType=2, **shArgs)#

[shArgs : tt=transferType]

Purpose:

:: Transfers skinning from a source mesh to multiple target meshes in Autodesk Maya.

  • This function enables efficient skin weight transfer from one skinned mesh to multiple target meshes, maintaining skinning consistency.

  • Useful in scenarios like character variations or asset updates where similar skinning needs to be replicated across several meshes.

Parameters:

  • transferType (<int, optional>): Defines the type of transfer method. A value of 2 typically represents a default transfer method.

Return:

  • None. The function transfers skin weights from the source mesh to each selected target mesh.

Note:

  • The source mesh should be the last selected item, with one or more target meshes selected beforehand.

  • Ensure that the source mesh is properly skinned to achieve accurate transfer results.

  • This function is ideal for situations where multiple objects need to inherit skinning data from a single source.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-check-square Check Selection"} CheckSelection --"Valid Selection"--> TransferInit["/fas:fa-exchange-alt Transfer Initialization"] CheckSelection --"Invalid Selection"--> Error[("/fas:fa-times-circle Error")] TransferInit --> IterateMeshes["/fas:fa-sync-alt Iterate Through Target Meshes"] IterateMeshes --> TransferSkinning["/fas:fa-spray-can Transfer Skinning"] TransferSkinning --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style TransferInit fill:#99ccff,stroke:#000,stroke-width:2px style IterateMeshes fill:#99ff99,stroke:#000,stroke-width:2px style TransferSkinning fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px style Error fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for transferSkin_OneToMany_Mesh function:

  1. The process starts with checking the selection of meshes.

  2. If the selection is valid, it initializes the skin transfer.

  3. The function iterates through each selected target mesh.

  4. Skinning is transferred from the source mesh to each target mesh.

  5. The process concludes once all target meshes have received the skinning data.

HyperSkin.transferSkin_Overlap(self, srcMesh=None, destMesh=None, transferType='I2O')#

[shArgs : none]

Purpose:

:: Transfers skin weights from overlapping vertices of one mesh to another in Autodesk Maya.

  • Facilitates the transfer of skin weights between two meshes based on their spatial overlap.

  • Supports two transfer types: ‘Out to In’ (O2I) and ‘In to Out’ (I2O).

  • Enhances the rigging process by allowing the transfer of skinning information between different mesh topologies.

Usage Example:

>>> transferSkin_Overlap(srcMesh='sourceMesh', destMesh='targetMesh', transferType='I2O')
# Transfers skin weights from the inside overlapping vertices of 'sourceMesh' to the outside overlapping vertices of 'targetMesh'.
Parameters:

  • srcMesh: The source mesh from which skin weights will be transferred.

  • destMesh: The destination mesh to which skin weights will be applied.

  • transferType: Determines the direction of the transfer. ‘O2I’ transfers from outer to inner vertices, while ‘I2O’ does the opposite.

Return:

  • None. The function operates directly on the mesh objects in the scene.

Note:

  • The function requires two meshes to be selected in the scene for the transfer to occur.

  • The overlapping vertices are identified and used as the basis for transferring skin weights.

graph TB Start[("fa:fa-play Start")] --> SelectMeshes{"/fas:fa-mouse-pointer Select Meshes"} SelectMeshes --"Select Source and Destination Meshes"--> IdentifyOverlap["/fas:fa-object-group Identify Overlapping Vertices"] IdentifyOverlap --> TransferWeights["/fas:fa-exchange-alt Transfer Skin Weights"] TransferWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style IdentifyOverlap fill:#99ccff,stroke:#000,stroke-width:2px style TransferWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_Overlap function:

  1. The process starts with the selection of the source and destination meshes in Maya.

  2. The function identifies overlapping vertices between the two selected meshes.

  3. Skin weights are transferred from the overlapping vertices of the source mesh to the corresponding vertices of the destination mesh.

  4. The process ends after the skin weights are successfully transferred.

HyperSkin.transferSkin_Vtx2ManyVtx(self)#

[shArgs : none]

Purpose:

:: Transfers skinning information from a source vertex to multiple destination vertices in Autodesk Maya.

  • Efficient for transferring skin weights from one vertex to several others, ensuring consistent deformation.

  • Ideal for tweaking skin weights in detailed areas of a rigged mesh.

Usage Example:

>>> transferSkin_Vtx2ManyVtx()
# Transfers skin weights from the specified source vertex to selected destination vertices.
Parameters:

  • None. The function uses the last selected vertex as the source and earlier selected vertices as destinations.

Return:

  • None. Skin weights are transferred from the source vertex to each destination vertex in the selection.

Note:

  • Ensure the source and destination vertices belong to skinned meshes.

  • The function assumes the last selected vertex as the source for skin weight transfer.

graph TB Start[("fa:fa-play Start")] --> RetrieveSelection["/fas:fa-mouse-pointer Retrieve Selection"] RetrieveSelection --> IdentifySource{"/fas:fa-question-circle Identify Source Vertex"} IdentifySource --"Last Selected Vertex"--> TransferWeights["/fas:fa-exchange-alt Transfer Skin Weights"] TransferWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveSelection fill:#ffcc00,stroke:#000,stroke-width:2px style IdentifySource fill:#99ccff,stroke:#000,stroke-width:2px style TransferWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_Vtx2ManyVtx function:

  1. The process begins by retrieving the selection of vertices in Maya.

  2. It then identifies the source vertex for skin weight transfer, typically the last vertex in the selection.

  3. The skin weights are transferred from the source vertex to each of the other selected vertices.

  4. The process ends once the skin weights have been transferred to all selected destination vertices.

HyperSkin.transferSkin_Vtx2Vtx(self, src=None, dest=None)#

[shArgs : none]

Purpose:

:: Transfers skin weights from one vertex to another within the same or different mesh in Autodesk Maya.

  • Enables precise control over the skinning process by allowing transfer of skin weights at a per-vertex level.

  • Useful in scenarios where similar vertices across different meshes require identical skin weighting.

Usage Example:

>>> transferSkin_Vtx2Vtx('pSphere1.vtx[0]', 'pSphere2.vtx[0]')
# Transfers skin weights from vertex 0 of pSphere1 to vertex 0 of pSphere2.
Parameters:

  • src: The source vertex from which the skin weights are to be copied.

  • dest: The destination vertex to which the skin weights are to be applied.

Return:

  • None. The function directly modifies the skin weights of the destination vertex.

Note:

  • The source and destination vertices can belong to the same or different skinned meshes.

  • It’s crucial that both source and destination vertices are part of a mesh with an associated skinCluster.

graph TB Start[("fa:fa-play Start")] --> RetrieveWeights{"Retrieve Weights from Source Vertex"} RetrieveWeights --> ApplyWeights{"Apply Weights to Destination Vertex"} ApplyWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveWeights fill:#99ccff,stroke:#000,stroke-width:2px style ApplyWeights fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_Vtx2Vtx function:

  1. The process begins by retrieving the skin weights from the source vertex.

  2. The skin weights are then applied to the destination vertex.

  3. The process completes after successfully transferring the weights.

HyperSkin.transferSkin_VtxDist(self, skinObjs, distVal='BB')#

[shArgs : none]

Purpose:

:: Transfers skin weights based on vertex distance from one or more source objects to a destination object in Autodesk Maya.

  • Efficiently transfers skinning data based on proximity, either within a bounding box or a specified distance.

  • Useful in scenarios where skin weights need to be copied from multiple source objects to a single destination object.

Usage Example:

>>> transferSkin_VtxDist(['sourceObj1', 'sourceObj2'], 'BB')
# Transfers skin weights from 'sourceObj1' and 'sourceObj2' to the last object in the list based on bounding box proximity.
Parameters:

  • skinObjs (<type list>): List of source objects and the destination object.

  • distVal (<str/int>): Determines the method of distance calculation. ‘BB’ for bounding box, or an integer for specific distance.

Return:

  • None. The function performs the skin weight transfer without returning any value.

Note:

  • Ensure that the last object in skinObjs list is the intended destination for the skin weights.

  • Source and destination objects should have similar topology for optimal results.

  • The function works best when the vertices of the source and destination meshes are in close proximity.

graph TB Start[("fa:fa-play Start")] --> DetermineDist{"/fas:fa-ruler Determine Distance Method"} DetermineDist --"Using Bounding Box"--> TransferBB["/fas:fa-exchange-alt Transfer Skin Weights (BB)"] DetermineDist --"Using Specific Distance"--> TransferDist["/fas:fa-exchange-alt Transfer Skin Weights (Distance)"] TransferBB --> End[("fas:fa-stop End")] TransferDist --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style DetermineDist fill:#ffcc00,stroke:#000,stroke-width:2px style TransferBB fill:#99ccff,stroke:#000,stroke-width:2px style TransferDist fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferSkin_VtxDist function:

  1. The process begins, determining the method of distance calculation (Bounding Box or Specific Distance).

  2. If ‘BB’ (Bounding Box) is selected, skin weights are transferred based on the bounding box proximity.

  3. If a specific distance (integer) is provided, skin weights are transferred based on this distance threshold.

  4. The process completes once skin weights are transferred to the destination object.

HyperSkin.transferSkinning(self, transferType=2, **shArgs)#

[shArgs : tt=transferType]

Purpose:

:: Facilitates various types of skin weight transfers in Autodesk Maya, allowing for flexible and efficient skinning workflows.

  • This function supports multiple transfer types, including Mesh to Mesh, Joint to Joint, and Vertex to Vertex transfers.

  • It can handle both single and multiple transfer scenarios, adapting to different rigging and skinning needs.

  • Offers specialized options like Inside to Outside and Outside to Inside transfers for overlapping meshes.

Parameters:

  • transferType (<int, optional>): Specifies the type of transfer, with different numeric values representing different transfer methods.

Return:

  • None. The function executes the specified skin weight transfer based on user input and selected options in the Maya UI.

Note:

  • The specific transfer method is determined based on the user’s selection in the Maya UI, with radio buttons indicating different transfer options.

  • Ensure the appropriate meshes or joints are selected before executing the function for accurate results.

graph TB Start[("fa:fa-play Start")] --> CheckTransferType{"/fas:fa-exchange-alt Check Transfer Type"} CheckTransferType --"Mesh to Mesh"--> TransferM2M["/fas:fa-object-ungroup Transfer Mesh to Mesh"] CheckTransferType --"Mesh to Many Meshes"--> TransferM2M_Multi["/fas:fa-object-group Transfer Mesh to Many Meshes"] CheckTransferType --"Inside to Outside"--> TransferI2O["/fas:fa-arrow-alt-circle-right Transfer Inside to Outside"] CheckTransferType --"Outside to Inside"--> TransferO2I["/fas:fa-arrow-alt-circle-left Transfer Outside to Inside"] CheckTransferType --"Joint to Joint"--> TransferJ2J["/fas:fa-link Transfer Joint to Joint"] CheckTransferType --"Many to One Mesh"--> TransferMany2One["/fas:fa-compress-arrows-alt Transfer Many to One Mesh"] CheckTransferType --"Many to Many Meshes"--> TransferMany2Many["/fas:fa-object-group Transfer Many to Many Meshes"] CheckTransferType --"Mesh to Vertex List"--> TransferM2V["/fas:fa-th-list Transfer Mesh to Vertex List"] CheckTransferType --"Rig to Skeleton"--> TransferRig2Skeleton["/fas:fa-bone Transfer Rig to Skeleton"] CheckTransferType --"Vertex to Vertex"--> TransferV2V["/fas:fa-vector-square Transfer Vertex to Vertex"] CheckTransferType --"Vertex to Many Vertices"--> TransferV2V_One2Many["/fas:fa-expand-arrows-alt Transfer Vertex to Many Vertices"] CheckTransferType --"Many Vertices to Many Vertices"--> TransferV2V_M2M["/fas:fa-th Transfer Many Vertices to Many Vertices"] TransferM2M --> End[("fas:fa-stop End")] TransferM2M_Multi --> End TransferI2O --> End TransferO2I --> End TransferJ2J --> End TransferMany2One --> End TransferMany2Many --> End TransferM2V --> End TransferRig2Skeleton --> End TransferV2V --> End TransferV2V_One2Many --> End TransferV2V_M2M --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckTransferType fill:#ffcc00,stroke:#000,stroke-width:2px style TransferM2M fill:#99ccff,stroke:#000,stroke-width:2px style TransferM2M_Multi fill:#99ccff,stroke:#000,stroke-width:2px style TransferI2O fill:#99ccff,stroke:#000,stroke-width:2px style TransferO2I fill:#99ccff,stroke:#000,stroke-width:2px style TransferJ2J fill:#99ccff,stroke:#000,stroke-width:2px style TransferMany2One fill:#99ccff,stroke:#000,stroke-width:2px style TransferMany2Many fill:#99ccff,stroke:#000,stroke-width:2px style TransferM2V fill:#99ccff,stroke:#000,stroke-width:2px style TransferRig2Skeleton fill:#99ccff,stroke:#000,stroke-width:2px style TransferV2V fill:#99ccff,stroke:#000,stroke-width:2px style TransferV2V_One2Many fill:#99ccff,stroke:#000,stroke-width:2px style TransferV2V_M2M fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The flowchart for transferSkinning function:

  1. The process begins with determining the transfer type based on the Maya UI selection.

  2. Depending on the selection, it executes the appropriate transfer method, such as Mesh to Mesh, Joint to Joint, or Vertex to Vertex.

  3. Specialized options like Inside to Outside and Outside to Inside transfers for overlapping meshes are also supported.

  4. The process concludes once the chosen skin weight transfer method is executed.

HyperSkin.transferUVs(self, srcMesh=None, trgtMesh=None, spaceVal=1, delHistory=True, getMatchPercent=0, bestMatch=0, deleteMap=False)#

[shArgs : none]

Purpose:

:: Transfers UVs from a source mesh to a target mesh with various options for space value, history deletion, and UV matching in Autodesk Maya.

  • Allows for flexible and precise UV transfer between different geometry.

  • Provides options to delete history, match UVs, and find the best match for UV transfer.

  • Useful for rigging and modeling workflows where UV consistency across different models is required.

Usage Example:

>>> transferUVs('sourceMesh', 'targetMesh', spaceVal=1, delHistory=True)
# Transfers UVs from 'sourceMesh' to 'targetMesh' with specified options.
Parameters:

  • srcMesh (str): The name of the source mesh from which UVs are to be transferred.

  • trgtMesh (str): The name of the target mesh to which UVs are to be transferred.

  • spaceVal (int): The sample space value for the UV transfer.

  • delHistory (bool): Flag to delete history on the target mesh after transfer.

  • getMatchPercent (bool): Flag to calculate the percentage of UV match between source and target.

  • bestMatch (bool): Flag to find the best match for UV transfer.

  • deleteMap (bool): Flag to delete the transfer map node after completion.

Return:

  • Depending on the parameters, returns either the transfer map node, UV match percentage, or a list of match percentages for different space values.

Note:

  • The function assumes that the source and target meshes have similar topology for accurate UV transfer.

  • The spaceVal parameter affects the accuracy of the UV transfer and may need tweaking for different models.

graph TB Start[("fa:fa-play Start")] --> GetSourceAndTarget{"/fas:fa-exchange-alt Get Source and Target Meshes"} GetSourceAndTarget --> TransferUVs["/fas:fa-project-diagram Transfer UVs"] TransferUVs --> DeleteHistoryCheck{"/fas:fa-trash-alt Delete History?"} DeleteHistoryCheck --"Yes"--> DeleteHistory["/fas:fa-eraser Delete History"] DeleteHistoryCheck --"No"--> End[("fas:fa-stop End")] DeleteHistory --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetSourceAndTarget fill:#ffcc00,stroke:#000,stroke-width:2px style TransferUVs fill:#99ccff,stroke:#000,stroke-width:2px style DeleteHistoryCheck fill:#ffcc00,stroke:#000,stroke-width:2px style DeleteHistory fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the transferUVs function:

  1. The process begins by identifying the source and target meshes for UV transfer.

  2. UVs are then transferred from the source to the target mesh based on the specified parameters.

  3. After the transfer, the function checks if history on the target mesh needs to be deleted.

  4. If history deletion is chosen, it proceeds to delete the history.

  5. The process completes either after deleting history or immediately after UV transfer if no history deletion is required.

HyperSkin.unfreezeRotation(self, objList, grpLevel, vtxNumOrObj, trgtType='vtx')#

[shArgs : none]

Purpose:

:: Unfreezes or resets the rotation of objects in a list, aligning them according to specified target positions or vertices in Autodesk Maya.

  • Facilitates the reorientation of objects based on dynamic target positions, enhancing rigging flexibility.

  • Allows for precise alignment of objects with vertices or other objects, crucial for detailed rigging tasks.

Parameters:
  • objList – <list/str> #List of objects to unfreeze rotation or a single object.

  • grpLevel – <int> #Hierarchy level to pick for rotation unfreezing (0, 1, or 2).

  • vtxNumOrObj – <int/str> #Vertex number or object used as the target for alignment.

  • trgtType – <str> #Type of target, ‘vtx’ for vertex or ‘obj’ for object. Default is ‘vtx’.

Usage Example:

>>> unfreezeRotation(['pCube1', 'pCube2'], 1, 3, 'vtx')
# Unfreezes rotation of 'pCube1' and 'pCube2' at hierarchy level 1, aligning them to vertex 3.

Note: - Handles both single objects and lists uniformly. - The group level determines which hierarchy level is used for the rotation reset. - Supports both vertex and object-based target alignment for rotation adjustments.

Flow Chart Description:

The flowchart for the unfreezeRotation function:

  1. The process starts by converting the input object(s) to a list if necessary.

  2. For each object in the list, the function determines the relevant group level and extracts the target group.

  3. A locator is positioned at the target vertex or object, and another locator is used to determine the direction.

  4. The function resets the rotation of the target group to align it with the direction determined by the locators.

  5. The process is repeated for each object in the list, achieving the desired orientation.

graph TB Start[("fa:fa-play Start")] --> ConvertToList{"Convert to List if Single Object"} ConvertToList --> IterateObjects{"/fas:fa-th-list Iterate Over Objects"} IterateObjects --> DetermineGroupLevel{"/fas:fa-sitemap Determine Group Level"} DetermineGroupLevel --> PositionLocators["/fas:fa-location-arrow Position Direction Locators"] PositionLocators --> ResetRotation["/fas:fa-sync-alt Reset Object Rotation"] ResetRotation --> IterateObjects IterateObjects --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConvertToList fill:#99ccff,stroke:#000,stroke-width:2px style IterateObjects fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineGroupLevel fill:#99ff99,stroke:#000,stroke-width:2px style PositionLocators fill:#99ff99,stroke:#000,stroke-width:2px style ResetRotation fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
HyperSkin.updateDSCs(self)#

[shArgs : none]

Purpose:

:: The ‘updateDSCs’ function in Autodesk Maya is designed to update all Hyper Discs (‘DSCs’) in the scene by modifying their attributes.

  • This function primarily focuses on revising and enhancing the attribute setup of each DSC to align with the latest requirements or standards in the HyperSkin tool.

  • It plays a crucial role in maintaining the consistency and functionality of DSCs across different versions or updates of the HyperSkin tool.

Param:

None #This function does not take any parameters.

Returns:

None #This function does not return a value but updates the attributes of DSCs in the scene.

Usage Example:

>>> updateDSCs()
# This command will find all DSCs in the scene and update their attributes.
Note:

  • The function automatically detects all DSCs in the scene and applies necessary attribute changes.

  • It is essential for ensuring that existing DSCs are compatible with new features or changes introduced in updated versions of the HyperSkin tool.

  • The function intelligently handles attribute modifications, such as adding new attributes or altering existing ones, to ensure that DSCs perform optimally with the latest HyperSkin configurations.

graph TB Start[("fa:fa-play Start")] --> SelectDSCs{"Select All DSCs in Scene"} SelectDSCs --"DSCs Found"--> IterateDSCs[Iterate Through Each DSC] IterateDSCs --> UpdateAttrs["Update Attributes of Each DSC"] UpdateAttrs --> End[("fas:fa-stop End")] SelectDSCs --"No DSCs Found"--> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectDSCs fill:#ffcc00,stroke:#000,stroke-width:2px style IterateDSCs fill:#99ccff,stroke:#000,stroke-width:2px style UpdateAttrs fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The updateDSCs function operates as follows:

  1. The process begins by attempting to select all DSCs in the scene.

  2. If DSCs are found, the function iterates through each DSC.

  3. During iteration, it updates the attributes of each DSC. This includes adding, modifying, or deleting attributes as needed.

  4. The process concludes after all DSCs have been updated, ensuring they are in line with the current standards of the HyperSkin tool.

  5. If no DSCs are found in the scene, the process ends without making any changes.

HyperSkin.updateSkinWeights(self, filePath)#

[shArgs : none]

Purpose:

:: Updates the skin weights for a mesh from an XML file in Autodesk Maya.

  • Reads skin weight data from an XML file and applies it to the specified mesh.

  • Useful for transferring or updating skin weights across different scenes or rigs.

Usage Example:

>>> updateSkinWeights("C:/path/to/weights.xml")
# Updates the skin weights for a mesh based on data in the specified XML file.
Parameters:

  • filePath: The path to the XML file containing skin weight data.

Return:

  • None. This function updates the skin weights of the mesh directly.

Note:

  • The XML file should have the correct format and data for this function to work properly.

  • It’s important to ensure that the joints and skin clusters specified in the XML file exist in the current scene.

graph TB Start[("fa:fa-play Start")] --> ReadXML["/fas:fa-file-code Read XML File"] ReadXML --> ParseData["/fas:fa-stream Parse Skin Weight Data"] ParseData --> UpdateWeights["/fas:fa-sync-alt Update Skin Weights on Mesh"] UpdateWeights --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style ReadXML fill:#ffcc00,stroke:#000,stroke-width:2px style ParseData fill:#99ccff,stroke:#000,stroke-width:2px style UpdateWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the updateSkinWeights function:

  1. The process begins with reading the XML file specified in the filePath.

  2. The function then parses the skin weight data from the XML file.

  3. The skin weights are updated on the mesh as per the data parsed from the XML file.

  4. The process completes once the skin weights are updated.

HyperSkin.updateUI_Options(self)#

[shArgs : none]

Purpose:

:: The ‘updateUI_Options’ function in Autodesk Maya is designed to adjust the HyperSkin tool’s user interface (UI) based on the selected rigging template.

  • This function dynamically modifies the UI elements, such as text fields and option menus, to match the requirements of the chosen rigging approach.

  • It ensures a user-friendly experience by displaying relevant options and settings for different rigging templates.

Param:

None #This function does not take any parameters.

Returns:

None #This function does not return a value but updates the UI elements in the HyperSkin tool.

Usage Example:

>>> updateUI_Options()
# Adapts the HyperSkin UI based on the selected rigging template.
Note:

  • The function primarily targets different naming conventions and rigging approaches by adjusting the UI elements accordingly.

  • It is an integral part of the HyperSkin tool, enhancing usability and flexibility for different rigging needs in Maya.

  • The function responds to user selections in the HyperSkin UI, ensuring that the displayed options are relevant and appropriate for the chosen template.

graph TB Start[("fa:fa-play Start")] --> CheckTemplate{"/fas:fa-wrench Check Rigging Template"} CheckTemplate --"EasyRig Selected"--> SetPrefix["/fas:fa-text-height Set L_ and R_ Prefix"] CheckTemplate --"Other Templates"--> SetSuffix["/fas:fa-text-height Set _L and _R Suffix"] SetPrefix --> UpdateUI["/fas:fa-sync-alt Update UI Elements"] SetSuffix --> UpdateUI UpdateUI --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckTemplate fill:#ffcc00,stroke:#000,stroke-width:2px style SetPrefix fill:#99ccff,stroke:#000,stroke-width:2px style SetSuffix fill:#99ccff,stroke:#000,stroke-width:2px style UpdateUI fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The updateUI_Options function operates as follows:

  1. It begins by checking the selected rigging template in the HyperSkin UI.

  2. If the “EasyRig” template is selected, the function sets the prefix for left and right side controls to ‘L_’ and ‘R_’, respectively.

  3. For other templates, it sets the suffix for left and right side controls to ‘_L’ and ‘_R’.

  4. Once the prefixes or suffixes are set, the function updates the relevant UI elements to reflect these changes.

  5. The process concludes after the UI update, ensuring that the displayed options are appropriate for the selected rigging template.

HyperSkin.updateVtxCount(self)#

[shArgs : none]

Purpose:

:: The ‘updateVtxCount’ function in Autodesk Maya updates a textField in the HyperSkin UI with the count of selected vertices.

  • This function checks the number of currently selected vertices and displays the count in a specified textField.

  • It is particularly useful for tasks that require awareness of vertex selection, enhancing the interactivity of the HyperSkin tool.

Param:

None #This function does not take any parameters.

Returns:

None #This function does not return a value but updates the ‘as_VtxCount_TF’ textField in the HyperSkin UI.

Usage Example:

>>> updateVtxCount()
# Updates the vertex count display based on the current selection in Maya.
Note:

  • This function is a utility within the HyperSkin tool, specifically designed to improve user experience by providing real-time feedback on vertex selection.

  • It is an important feature for operations that depend on vertex-level manipulation, ensuring users are informed about their current selection.

graph TB Start[("fa:fa-play Start")] --> CheckSelection{"/fas:fa-mouse-pointer Check Vertex Selection"} CheckSelection --"Vertices Selected"--> UpdateField["/fas:fa-text-height Update TextField with Vertex Count"] CheckSelection --"No Vertices Selected"--> SetNone["/fas:fa-times-circle Set TextField to 'None'"] UpdateField --> End[("fas:fa-stop End")] SetNone --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateField fill:#99ccff,stroke:#000,stroke-width:2px style SetNone fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

The updateVtxCount function operates as follows:

  1. It starts by checking if any vertices are currently selected in Maya.

  2. If vertices are selected, the function updates the ‘as_VtxCount_TF’ textField with the count of selected vertices.

  3. If no vertices are selected, the function sets the textField to display ‘None’.

  4. The process concludes after updating the textField, effectively reflecting the current vertex selection status in the HyperSkin UI.