DeformEasy#

DeformEasy._isInTime(self, startDate=[2017, 1, 1], endDate=[2018, 1, 1], onlineTime=1, showDaysLeft=1, bufferTime=0)#
DeformEasy._mayaVer(self)#
DeformEasy.addSDKAttrsOnCtrls(self, ctrlList=None, **shArgs)#

[shArgs : cl=ctrlList]

Purpose:

:: Adds Set Driven Key (SDK) attributes to a list of control objects in Autodesk Maya.

  • Facilitates the creation of SDKs by preparing controls with necessary attributes.

  • Enables animators to more easily set up complex animations involving multiple attributes.

Parameters:

ctrlList – <list> # List of control objects to add SDK attributes to.

Returns:

None # This function does not return any value but modifies the provided controls.

Code Examples:

>>> control_list = ["ctrl1", "ctrl2", "ctrl3"]
>>> addSDKAttrsOnCtrls(control_list)
# Adds SDK attributes to each control in the list.
graph TB Start[("fa:fa-play Start")] --> CheckCtrlList{{"/fas:fa-question-circle Check ctrlList"}} CheckCtrlList --"If ctrlList Provided" --> ProcessCtrlList["/fas:fa-cogs Process ctrlList"] CheckCtrlList --"If ctrlList Not Provided" --> GetSelectedCtrls["/fas:fa-mouse-pointer Get Selected Ctrls"] GetSelectedCtrls --> ProcessCtrlList ProcessCtrlList --> IterateCtrls{{"/fas:fa-repeat Iterate through Ctrls"}} IterateCtrls --"For each ctrl" --> DisconnectTransforms["/fas:fa-unlink Disconnect Transforms"] DisconnectTransforms --> AddAttrDivider["/fas:fa-minus Add Attr Divider"] AddAttrDivider --> AddSDKSwitch["/fas:fa-toggle-on Add sdkSwitch"] AddSDKSwitch --> AddTranslateSDKs["/fas:fa-arrows-alt Add Translate SDKs"] AddTranslateSDKs --> AddRotateSDKs["/fas:fa-sync-alt Add Rotate SDKs"] AddRotateSDKs --> AddScaleSDKs["/fas:fa-expand-arrows-alt Add Scale SDKs"] AddScaleSDKs --> CreatePMA_Translate["/fas:fa-plus Create PMA for Translate"] CreatePMA_Translate --> CreateCond_Translate["/fas:fa-balance-scale Create Conditional for Translate"] CreateCond_Translate --> CreatePMA_Rotate["/fas:fa-plus Create PMA for Rotate"] CreatePMA_Rotate --> CreateCond_Rotate["/fas:fa-balance-scale Create Conditional for Rotate"] CreateCond_Rotate --> CreatePMA_Scale["/fas:fa-plus Create PMA for Scale"] CreatePMA_Scale --> CreateCond_Scale["/fas:fa-balance-scale Create Conditional for Scale"] CreateCond_Scale --> IterateCtrls IterateCtrls --"End of list" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckCtrlList fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessCtrlList fill:#99ff99,stroke:#000,stroke-width:2px style GetSelectedCtrls fill:#ff9999,stroke:#000,stroke-width:2px style IterateCtrls fill:#99ccff,stroke:#000,stroke-width:2px style DisconnectTransforms fill:#cc99ff,stroke:#000,stroke-width:2px style AddAttrDivider fill:#99ff99,stroke:#000,stroke-width:2px style AddSDKSwitch fill:#ffcc99,stroke:#000,stroke-width:2px style AddTranslateSDKs fill:#ccffcc,stroke:#000,stroke-width:2px style AddRotateSDKs fill:#ffcc99,stroke:#000,stroke-width:2px style AddScaleSDKs fill:#ccffcc,stroke:#000,stroke-width:2px style CreatePMA_Translate fill:#ff9999,stroke:#000,stroke-width:2px style CreateCond_Translate fill:#99ccff,stroke:#000,stroke-width:2px style CreatePMA_Rotate fill:#99ff99,stroke:#000,stroke-width:2px style CreateCond_Rotate fill:#cc99ff,stroke:#000,stroke-width:2px style CreatePMA_Scale fill:#99ff99,stroke:#000,stroke-width:2px style CreateCond_Scale fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the addSDKAttrsOnCtrls function:

  1. The function begins by checking if a control list is provided.

  2. If no control list is provided, it selects the currently selected control objects.

  3. Each control in the list is processed to add Set Driven Key attributes.

  4. For each control, the function disconnects existing transform connections.

  5. Adds an attribute divider for better organization.

  6. Adds an ‘sdkSwitch’ attribute to toggle SDK influence.

  7. Adds attributes for SDK translations, rotations, and scales.

  8. Creates Plus Minus Average nodes to combine original and SDK attributes.

  9. Creates conditional nodes to apply SDK influences based on the ‘sdkSwitch’ state.

  10. This process is repeated for all controls in the list.

  11. The process ends after all controls are updated.

DeformEasy.add_ClusterToTF(self, textFld, btnName=None, multiSelect=1, **shArgs)#

[shArgs : ]

Purpose:

:: Adds the name of selected cluster control(s) to a specified text field.

  • This function assists in inserting the names of selected cluster controls into a Maya UI text field.

  • It is designed for scenarios where cluster controls are frequently selected and their names need to be inputted into the UI.

  • The function supports both single and multiple cluster control selections.

  • It updates the text field with the selected cluster control names, separated by commas if multiple.

  • The function is particularly helpful in rigging scripts where clusters are commonly used.

Parameters:
  • textFld – <str> # Name of the text field to add the cluster control names to.

  • btnName – <str, optional> # Name of the button to update its state. Default is None.

  • multiSelect – <bool> # Whether to allow multiple cluster control selections. Default is True.

Returns:

None # This function updates UI elements but does not return any value.

Code Examples:

>>> add_ClusterToTF('clusterControlTextField')
# Adds the name(s) of selected cluster control(s) to 'clusterControlTextField'.
graph TB Start[("(fa:fa-play Start)")] --> CheckSelection{"/fas:fa-mouse-pointer Check Selection"} CheckSelection --"No Objects Selected" --> Error["/fas:fa-exclamation-circle Display Error"] CheckSelection --"Single Object Selected" --> ProcessSingleObject["/fas:fa-pencil-alt Process Single Object"] CheckSelection --"Multiple Objects Selected" --> ProcessMultipleObjects["/fas:fa-pencil-alt Process Multiple Objects"] ProcessSingleObject --> UpdateTextField["/fas:fa-keyboard Update Text Field"] ProcessMultipleObjects --> GenerateClusterList["/fas:fa-list-ul Generate Cluster List"] GenerateClusterList --> UpdateTextField UpdateTextField --> CheckButtonState{{"/fas:fa-question-circle Check Button State"}} CheckButtonState --"If Button State Exists" --> UpdateButtonState["/fas:fa-toggle-on Update Button State"] CheckButtonState --"No Button State" --> End[("fas:fa-stop End")] UpdateButtonState --> End Error --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ff9999,stroke:#000,stroke-width:2px style Error fill:#ff6666,stroke:#000,stroke-width:2px style ProcessSingleObject fill:#99ccff,stroke:#000,stroke-width:2px style ProcessMultipleObjects fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateTextField fill:#99ff99,stroke:#000,stroke-width:2px style GenerateClusterList fill:#ffcc00,stroke:#000,stroke-width:2px style CheckButtonState fill:#ff9999,stroke:#000,stroke-width:2px style UpdateButtonState fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the add_ClusterToTF function:

  1. The function starts by checking if any objects are selected.

  2. If no objects are selected, it displays an error message.

  3. If a single object is selected, it processes this object to extract the cluster control name.

  4. If multiple objects are selected, it generates a list of cluster control names.

  5. The cluster control name(s) are then added to the specified text field.

  6. The function checks if there is a button state to update.

  7. If a button state exists, it updates the button state based on the selection.

  8. The process ends after updating the text field and optionally the button state.

DeformEasy.add_Prefix(self, txtFldName, btnName=None, **shArgs)#

[shArgs : ]

Purpose:

:: Adds a prefix to the name of selected objects in a given text field.

  • This function is used to automate the process of prefixing object names in Maya.

  • It reads the selected objects and extracts a common prefix from their names.

  • The extracted prefix is then added to a specified text field.

  • It’s useful in rigging and other scenarios where consistent naming conventions are needed.

  • The function can also be used to update button states based on the presence of a prefix.

Parameters:
  • txtFldName – <str> # Name of the text field to add the prefix to.

  • btnName – <str, optional> # Name of the button to update its state. Default is None.

Returns:

None # This function updates UI elements but does not return any value.

Code Examples:

>>> add_Prefix('nameTextField')
# Adds a prefix to the selected object's name in 'nameTextField'.
graph TB Start[("(fa:fa-play Start)")] --> CheckSelection{{"/fas:fa-question-circle Check Selection"}} CheckSelection --"If Objects Selected" --> ExtractPrefix["/fas:fa-cut Extract Prefix"] CheckSelection --"If No Objects Selected" --> ClearTextField["/fas:fa-eraser Clear Text Field"] ExtractPrefix --> UpdateTextField["/fas:fa-text-width Update Text Field"] ClearTextField --> End[("fas:fa-stop End")] UpdateTextField --> CheckButton{{"/fas:fa-check-square Check Button"}} CheckButton --"If Button Provided" --> UpdateButtonState["/fas:fa-toggle-on Update Button State"] CheckButton --"If No Button" --> End UpdateButtonState --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ExtractPrefix fill:#ff9999,stroke:#000,stroke-width:2px style UpdateTextField fill:#99ccff,stroke:#000,stroke-width:2px style ClearTextField fill:#cc99ff,stroke:#000,stroke-width:2px style CheckButton fill:#99ff99,stroke:#000,stroke-width:2px style UpdateButtonState fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the add_Prefix function:

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

  2. If objects are selected, it extracts a common prefix from their names.

  3. The extracted prefix is added to the specified text field.

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

  5. Additionally, if a button name is provided, the button state is updated based on the presence of a prefix.

  6. The function then concludes its operation.

DeformEasy.add_Selection(self, textFld, btnName=None, multiSelect=False, **shArgs)#

[shArgs : ]

Purpose:

:: Adds the name of selected objects to a specified text field.

  • This function is designed to insert the names of selected objects into a Maya UI text field.

  • It supports single or multiple object selections.

  • The function updates the text field with the selected object names, separated by commas if multiple.

  • It is commonly used in UI scripts to simplify the process of selecting and entering object names.

  • Additionally, the function can update button states based on the current selection.

Parameters:
  • textFld – <str> # Name of the text field to add the object names to.

  • btnName – <str, optional> # Name of the button to update its state. Default is None.

  • multiSelect – <bool> # Whether to allow multiple object selections. Default is False.

Returns:

None # This function updates UI elements but does not return any value.

Code Examples:

>>> add_Selection('objectNameTextField')
# Adds the name(s) of selected object(s) to 'objectNameTextField'.
graph TB Start[("(fa:fa-play Start)")] --> CheckSelection{{"/fas:fa-question-circle Check Selection"}} CheckSelection --"If Objects Selected" --> CheckMultiSelect{{"/fas:fa-tasks Check MultiSelect"}} CheckSelection --"If No Objects Selected" --> ClearTextField["/fas:fa-eraser Clear Text Field"] CheckMultiSelect --"If MultiSelect is True" --> MultiSelection["/fas:fa-list-ol Multi Selection"] CheckMultiSelect --"If MultiSelect is False" --> SingleSelection["/fas:fa-list Single Selection"] MultiSelection --> UpdateTextField["/fas:fa-text-width Update Text Field (Multiple)"] SingleSelection --> UpdateTextField["/fas:fa-text-width Update Text Field (Single)"] ClearTextField --> End[("fas:fa-stop End")] UpdateTextField --> CheckButton{{"/fas:fa-check-square Check Button"}} CheckButton --"If Button Provided" --> UpdateButtonState["/fas:fa-toggle-on Update Button State"] CheckButton --"If No Button" --> End UpdateButtonState --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMultiSelect fill:#ff9999,stroke:#000,stroke-width:2px style MultiSelection fill:#99ccff,stroke:#000,stroke-width:2px style SingleSelection fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateTextField fill:#99ff99,stroke:#000,stroke-width:2px style ClearTextField fill:#ff9999,stroke:#000,stroke-width:2px style CheckButton fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateButtonState fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the add_Selection function:

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

  2. If objects are selected, it checks if MultiSelect is enabled.

  3. For MultiSelect, it concatenates selected object names and updates the text field.

  4. For SingleSelect, it updates the text field with the name of the single selected object.

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

  6. Additionally, if a button name is provided, the button state is updated based on the selection.

  7. The function then concludes its operation.

DeformEasy.as_AboutDeformEasy(self, **shArgs)#

[shArgs : ]

Purpose:

:: Displays information about the ‘DeformEasy’ tool in Autodesk Maya.

  • This function creates a UI window that contains credits and information about the ‘DeformEasy’ tool.

  • It provides details such as the author’s name, contact information, and relevant websites.

  • The function aims to acknowledge the creator’s work and provide users with resources for further information.

  • It is a standard practice in tool development to include such information for user reference.

  • The function enhances user experience by offering a direct link to the creator and additional resources.

Returns:

None # This function creates a UI window but does not return any value.

Code Examples:

>>> as_AboutDeformEasy()
# Displays information about the 'DeformEasy' tool.
DeformEasy.as_BakeToSkinCluster(self, vtxList=None, ctrlList=None, **shArgs)#

[shArgs : vl=vtxList, cl=ctrlList]

Purpose:

:: Transfers the deformation from control objects to a skin cluster on a geometry.

  • This function is useful for baking complex control-driven deformations into a skin cluster for optimization or export.

  • It allows for a seamless transition from control-based deformations to joint-based skinning, maintaining the original mesh deformation.

Parameters:
  • vtxList – <list, optional> # List of vertices on which the control-based deformations are to be baked. If not provided, it’s derived from the text field ‘as_VtxSelection_TF’.

  • ctrlList – <list, optional> # List of control objects driving the deformations. If not provided, it’s derived from the selected control objects.

Returns:

None # This function does not return a value but updates the skin cluster with new weights.

Code Examples:

>>> vertex_list = ["pSphere1.vtx[0]", "pSphere1.vtx[1]", "pSphere1.vtx[2]"]
>>> control_list = ["ctrl1", "ctrl2", "ctrl3"]
>>> as_BakeToSkinCluster(vertex_list, control_list)
# Bakes the deformations from the specified controls to the skin cluster of the geometry defined by the vertex list.
graph TB Start[("fa:fa-play Start")] --> CheckVtxList{"/fas:fa-stream Check Vertex List"} CheckVtxList --"If vtxList provided" --> GetBaseGeoMesh["/fas:fa-shapes Get Base Geometry Mesh"] CheckVtxList --"If vtxList not provided" --> RetrieveVtxFromField["/fas:fa-pencil-ruler Retrieve Vertices from Text Field"] RetrieveVtxFromField --> GetBaseGeoMesh GetBaseGeoMesh --"Retrieve base geometry mesh from vertex list" --> CheckSkinCluster{"/fas:fa-question-circle Check Skin Cluster"} CheckSkinCluster --"If skin cluster exists" --> HoldSkinJoints["/fas:fa-unlock Hold Skin Joints"] CheckSkinCluster --"If skin cluster does not exist" --> CreateSkinCluster["/fas:fa-plus-circle Create Skin Cluster"] CreateSkinCluster --> HoldSkinJoints HoldSkinJoints --"Unlock joint influences" --> CheckControlList{"/fas:fa-check-square Check Control List"} CheckControlList --"If ctrlList provided" --> CreateJointForEachCtrl["/fas:fa-sitemap Create Joint for Each Control"] CheckControlList --"If ctrlList not provided" --> RetrieveCtrlsFromSelection["/fas:fa-mouse-pointer Retrieve Controls from Selection"] RetrieveCtrlsFromSelection --> CreateJointForEachCtrl CreateJointForEachCtrl --"Create joints and setup hierarchy" --> BakeDeformationsToJoints{{"/fas:fa-code-branch Bake Deformations to Joints"}} BakeDeformationsToJoints --"Bake control deformations to joints" --> UpdateSkinClusterWeights["/fas:fa-balance-scale Update Skin Cluster Weights"] UpdateSkinClusterWeights --"Update weights for each vertex" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckVtxList fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveVtxFromField fill:#ff9999,stroke:#000,stroke-width:2px style GetBaseGeoMesh fill:#99ccff,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#99ff99,stroke:#000,stroke-width:2px style CreateSkinCluster fill:#cc99ff,stroke:#000,stroke-width:2px style HoldSkinJoints fill:#ff9999,stroke:#000,stroke-width:2px style CheckControlList fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveCtrlsFromSelection fill:#99ccff,stroke:#000,stroke-width:2px style CreateJointForEachCtrl fill:#99ff99,stroke:#000,stroke-width:2px style BakeDeformationsToJoints fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateSkinClusterWeights fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_BakeToSkinCluster function:

  1. The function starts by verifying if a vertex list (vtxList) is provided.

  2. If not, it retrieves vertex information from a specified text field.

  3. It then identifies the base geometry mesh associated with the vertices.

  4. Checks for the existence of a skin cluster on the base geometry.

  5. If no skin cluster exists, it creates one.

  6. Unlocks the joint influences in the skin cluster.

  7. Checks if a control list (ctrlList) is provided.

  8. If not, it retrieves control objects from the current selection.

  9. Creates a joint for each control and sets up a hierarchy.

  10. Bakes the deformations from the control objects to the joints.

  11. Updates the skin cluster weights based on the baked deformations.

  12. The process completes, transferring control-based deformations to joint-based skinning.

DeformEasy.as_CopyClusterWeights(self, vtxList=None, meshList=None, **shArgs)#

[shArgs : vl=vtxList, ml=meshList]

Purpose:

:: Copies cluster weights from a source mesh to a target mesh or a list of vertices.

  • This function is essential for transferring cluster weights, which is especially useful in rigging and animation workflows.

  • It enables the replication of deformation effects from one part of a model to another, ensuring consistency and saving time.

Parameters:
  • vtxList – <list, optional> # List of target vertices to which cluster weights are to be copied. If not provided, it’s derived from the selected vertices.

  • meshList – <list, optional> # List of target meshes to which cluster weights are to be copied. If not provided, it’s derived from the selected mesh objects.

Returns:

None # This function does not return a value but updates the cluster weights on the target vertices or meshes.

Code Examples:

>>> vertex_list = ["pSphere1.vtx[10]", "pSphere1.vtx[11]"]
>>> mesh_list = ["pSphere1", "pSphere2"]
>>> as_CopyClusterWeights(vertex_list, mesh_list)
# Copies the cluster weights from the source to the specified vertices and meshes.
graph TB Start[("fa:fa-play Start")] --> CheckShArgs{{"/fas:fa-question Check shArgs"}} CheckShArgs --"If shArgs provided" --> UpdateVtxList["/fas:fa-edit Update vtxList"] CheckShArgs --"If shArgs not provided" --> DetermineVtxMeshList{{"/fas:fa-code-branch Determine Vtx/Mesh List"}} UpdateVtxList --> DetermineVtxMeshList DetermineVtxMeshList --"If vtxList given" --> CopyWeightsToVtxList["/fas:fa-copy Copy Weights to VtxList"] DetermineVtxMeshList --"If meshList given" --> CopyWeightsToMeshList["/fas:fa-copy Copy Weights to MeshList"] DetermineVtxMeshList --"If no list given" --> PromptSelection["/fas:fa-hand-pointer Prompt for Selection"] CopyWeightsToVtxList --> LoopThroughVtxList{{"/fas:fa-repeat Loop Through VtxList"}} CopyWeightsToMeshList --> LoopThroughMeshList{{"/fas:fa-repeat Loop Through MeshList"}} PromptSelection --> ErrorMsg[("fas:fa-exclamation-triangle Error: Select vertices or mesh")] LoopThroughVtxList --"For each vertex" --> FindNearestVertex["/fas:fa-search-plus Find Nearest Vertex"] LoopThroughMeshList --"For each mesh" --> AttachMeshToCluster["/fas:fa-paperclip Attach Mesh to Cluster"] FindNearestVertex --> GetWeightValue["/fas:fa-balance-scale Get Weight Value"] AttachMeshToCluster --> GetVtxListMesh["/fas:fa-list-ol Get Vertex List from Mesh"] GetWeightValue --> SetWeightValue["/fas:fa-pen-alt Set Weight Value"] GetVtxListMesh --> CopyWeightsToVtxList SetWeightValue --> UpdateProgress["/fas:fa-sync-alt Update Progress"] UpdateProgress --> EndLoopVtxList[("fas:fa-repeat End Loop VtxList")] EndLoopVtxList --"End of loop" --> SelectVtxList["/fas:fa-hand-pointer Select VtxList"] SelectVtxList --> End[("fas:fa-stop End")] ErrorMsg --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckShArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateVtxList fill:#ff9999,stroke:#000,stroke-width:2px style DetermineVtxMeshList fill:#99ccff,stroke:#000,stroke-width:2px style CopyWeightsToVtxList fill:#99ff99,stroke:#000,stroke-width:2px style CopyWeightsToMeshList fill:#99ff99,stroke:#000,stroke-width:2px style PromptSelection fill:#ff9999,stroke:#000,stroke-width:2px style LoopThroughVtxList fill:#cc99ff,stroke:#000,stroke-width:2px style LoopThroughMeshList fill:#cc99ff,stroke:#000,stroke-width:2px style ErrorMsg fill:#ff6666,stroke:#000,stroke-width:2px style FindNearestVertex fill:#99ccff,stroke:#000,stroke-width:2px style GetWeightValue fill:#99ff99,stroke:#000,stroke-width:2px style AttachMeshToCluster fill:#99ccff,stroke:#000,stroke-width:2px style SetWeightValue fill:#cc99ff,stroke:#000,stroke-width:2px style GetVtxListMesh fill:#99ff99,stroke:#000,stroke-width:2px style UpdateProgress fill:#99ccff,stroke:#000,stroke-width:2px style EndLoopVtxList fill:#cc99ff,stroke:#000,stroke-width:2px style SelectVtxList fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_CopyClusterWeights function:

  1. The function starts by checking if vtxList or meshList is provided. If not, it prompts the user for a selection.

  2. If vtxList is given, it copies cluster weights to each vertex in the list by finding the nearest vertex and transferring the weights.

  3. If meshList is provided, it attaches each mesh to a cluster and copies weights to all vertices of the mesh.

  4. For each vertex, the function finds the nearest vertex on the source mesh, gets the weight value from the source, and sets it on the target vertex.

  5. The progress is updated after processing each vertex.

  6. The function concludes by reselecting the vtxList.

DeformEasy.as_CreateClustCtrl(self, **shArgs)#

Purpose:

:: Automates the creation of cluster controls for a mesh in Autodesk Maya, enhancing rigging workflows.

  • This function streamlines the process of creating and attaching cluster controls to mesh vertices.

  • It supports both single and multiple control creation, adapting to various rigging requirements.

Returns:

None # This function does not return a value but creates cluster controls for the selected mesh vertices.

Code Examples:

>>> as_CreateClustCtrl()
# Creates cluster controls for the selected mesh vertices and links them to the specified top group.
graph TB Start[("fa:fa-play Start")] --> CheckMultiRivets{"/fas:fa-th-large Check Multiple Rivets"} CheckMultiRivets --"If multiple rivets" --> ProcessMultiRivets["/fas:fa-object-group Process Multiple Rivets"] CheckMultiRivets --"If not multiple rivets" --> CheckVerticesSelected{"/fas:fa-mouse-pointer Check Vertices Selected"} ProcessMultiRivets --> CreateStickyCtrlMulti["/fas:fa-cogs Create Sticky Control for Multiple Rivets"] CheckVerticesSelected --"If vertices selected" --> CreateStickyCtrl["/fas:fa-cogs Create Sticky Control"] CheckVerticesSelected --"If no vertices selected" --> ErrorNoVertices["/fas:fa-exclamation-triangle Error: No Vertices Selected"] CreateStickyCtrlMulti --> End[("fas:fa-stop End")] CreateStickyCtrl --> End ErrorNoVertices --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMultiRivets fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessMultiRivets fill:#99ccff,stroke:#000,stroke-width:2px style CreateStickyCtrlMulti fill:#ff9999,stroke:#000,stroke-width:2px style CheckVerticesSelected fill:#cc99ff,stroke:#000,stroke-width:2px style CreateStickyCtrl fill:#99ff99,stroke:#000,stroke-width:2px style ErrorNoVertices fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_CreateClustCtrl function:

  1. The process starts by checking if multiple rivets need to be created.

  2. If multiple rivets are required, it processes and creates sticky controls for each rivet.

  3. If not, it checks if vertices are selected on the mesh.

  4. If vertices are selected, a sticky control is created for the selected vertices.

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

  6. The function concludes either by creating the necessary cluster controls or displaying an error message.

DeformEasy.as_CreateSkinCtrls(self, **shArgs)#

[shArgs : pj=parentJnt, sm=skinMesh, rl=refLoc, mc=mirrCheck, lp=LPrefix, rp=RPrefix, n=name, gg=globalGrp, cg=ctrlGrp, av=asVtx, tgm=topGrpMain]

Purpose:

:: Creates skin controls for a specified mesh in Autodesk Maya, typically used in character rigging.

  • This function automates the process of creating skin controls linked to a parent joint, facilitating advanced rigging setups.

  • It supports both mirrored and non-mirrored control creation based on user preference.

Parameters:
  • parentJnt – <str> # Name of the parent joint for the skin controls.

  • skinMesh – <str> # Name of the mesh to which the skin controls are applied.

  • refLoc – <str> # Reference locator used in the control creation process.

  • mirrCheck – <bool> # Indicates if mirrored control creation is enabled.

  • LPrefix – <str> # Prefix for naming controls on the left side.

  • RPrefix – <str> # Prefix for naming controls on the right side.

  • name – <str> # Base name for the controls.

Returns:

None # This function does not return a value but creates skin controls for rigging.

Code Examples:

>>> as_CreateSkinCtrls()
# Creates skin controls for a specified mesh with the given parameters.
graph TB Start[("fa:fa-play Start")] --> CheckMirrored{"/fas:fa-mirror Check Mirrored"} CheckMirrored --"If mirroring is enabled" --> CreateSkinCtrlMirrored["/fas:fa-object-group Create Skin Control Mirrored"] CheckMirrored --"If mirroring is not enabled" --> CreateSkinCtrlNonMirrored["/fas:fa-object-ungroup Create Skin Control Non-Mirrored"] CreateSkinCtrlMirrored --> End[("fas:fa-stop End")] CreateSkinCtrlNonMirrored --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMirrored fill:#ffcc00,stroke:#000,stroke-width:2px style CreateSkinCtrlMirrored fill:#99ccff,stroke:#000,stroke-width:2px style CreateSkinCtrlNonMirrored fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_CreateSkinCtrls function:

  1. The process begins by determining if mirrored control creation is enabled.

  2. If mirroring is enabled, skin controls are created with mirroring settings.

  3. If mirroring is not enabled, skin controls are created without mirroring.

  4. The function concludes after creating the necessary skin controls based on the mirroring preference.

DeformEasy.as_CreateSkinCtrls2(self, **shArgs)#

[shArgs : cl=ctrlList, sm=skinMesh, bs=bsMesh, rl=refLoc, mc=mirrCheck, lp=LPrefix, rp=RPrefix, n=name, sj=skinJnt, nj=nVtx]

Purpose:

:: Creates a second version of skin controls for a specified mesh, with more detailed control over skin joints and mirroring.

  • This function is designed for advanced rigging in Autodesk Maya, allowing for precise control over skin joints in character models.

  • It provides functionality to handle skinning with both base and blend shape meshes.

Parameters:
  • ctrlList – <list> # List of control objects for the skin controls.

  • skinMesh – <str> # Name of the base mesh to which the skin controls are applied.

  • bsMesh – <str> # Name of the blend shape mesh associated with the skin controls.

  • refLoc – <str> # Reference locator for alignment purposes.

  • mirrCheck – <bool> # Flag to enable or disable mirrored control creation.

  • LPrefix – <str> # Prefix for controls on the left side.

  • RPrefix – <str> # Prefix for controls on the right side.

  • name – <str> # Name of the control object.

  • skinJnt – <str> # Name of the skin joint associated with the control.

  • nVtx – <str> # Nearest vertex on the mesh to the control.

Returns:

None # This function does not return a value but creates and configures skin controls.

Code Examples:

>>> as_CreateSkinCtrls2()
# Advanced creation of skin controls for rigging a character mesh with specific control over skin joints.
graph TB Start[("fa:fa-play Start")] --> CheckSelectedCtrls{"/fas:fa-check-circle Check Selected Controls"} CheckSelectedCtrls --"For each selected control" --> GetSkinJntGrp["/fas:fa-object-ungroup Get Skin Joint Group"] GetSkinJntGrp --> DetermineSkinJnt["/fas:fa-code-branch Determine Skin Joint"] DetermineSkinJnt --> DeleteConstraints["/fas:fa-trash-alt Delete Constraints"] DeleteConstraints --> UpdateCtrlName["/fas:fa-edit Update Control Name"] UpdateCtrlName --> FindNearestVertex["/fas:fa-search-location Find Nearest Vertex"] FindNearestVertex --> CreateRivet["/fas:fa-compass Create Rivet"] CreateRivet --> SetupRivetGrp["/fas:fa-layer-group Setup Rivet Group"] SetupRivetGrp --> PositionRivetGrp["/fas:fa-arrows-alt Position Rivet Group"] PositionRivetGrp --> CreateSkinControl["/fas:fa-object-group Create Skin Control"] CreateSkinControl --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelectedCtrls fill:#ffcc00,stroke:#000,stroke-width:2px style GetSkinJntGrp fill:#ff9999,stroke:#000,stroke-width:2px style DetermineSkinJnt fill:#99ccff,stroke:#000,stroke-width:2px style DeleteConstraints fill:#cc99ff,stroke:#000,stroke-width:2px style UpdateCtrlName fill:#99ff99,stroke:#000,stroke-width:2px style FindNearestVertex fill:#ff9999,stroke:#000,stroke-width:2px style CreateRivet fill:#99ccff,stroke:#000,stroke-width:2px style SetupRivetGrp fill:#cc99ff,stroke:#000,stroke-width:2px style PositionRivetGrp fill:#99ff99,stroke:#000,stroke-width:2px style CreateSkinControl fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_CreateSkinCtrls2 function:

  1. Starts by checking the selected controls for skinning.

  2. Retrieves the skin joint group for each control.

  3. Determines the specific skin joint and deletes any existing constraints.

  4. Updates the control name for the skinning process.

  5. Finds the nearest vertex on the mesh to the control.

  6. Creates a rivet at the position of the nearest vertex.

  7. Sets up and positions the rivet group relative to the control.

  8. Finalizes by creating the skin control linked to the rivet.

  9. The process repeats for each selected control until completion.

DeformEasy.as_CreateStickyCtrl(self, meshList=None, vtxList=False, mirrorMesh=False, **shArgs)#

[shArgs : ml=meshList, vl=vtxList, mm=mirrorMesh, crl=currentRivet_L, crr=currentRivet_R, n=name, cl=ctrlLoc, mc=mirrCheck, lp=LPrefix, rp=RPrefix, pa=primaryAxis, cs=ctrlShape, gv=globalCtrl, sc=scaleConstraint]

Purpose:

:: Creates a sticky control for a specified mesh or vertex list, with options for mirroring and control shapes.

  • This function is useful for creating controls that stick to a mesh’s surface, ideal for facial rigging or detailed character control.

  • It allows for custom control shapes and mirroring across a specified axis.

Parameters:
  • meshList – <list> # List of meshes to which the sticky control will be applied.

  • vtxList – <bool> # Flag to determine if vertex list is used instead of a full mesh.

  • mirrorMesh – <bool> # Flag to enable mirroring of the sticky control to the opposite side of the mesh.

  • currentRivet_L – <str> # Current rivet for the left side.

  • currentRivet_R – <str> # Current rivet for the right side.

  • name – <str> # Name for the sticky control.

  • ctrlLoc – <str> # Location for the control (e.g., ‘Left’, ‘Right’, ‘None’).

  • mirrCheck – <bool> # Flag to enable or disable mirrored control creation.

  • LPrefix – <str> # Prefix for left side controls.

  • RPrefix – <str> # Prefix for right side controls.

  • primaryAxis – <str> # The primary axis for control orientation.

  • ctrlShape – <str> # The shape of the control (e.g., ‘Round3d’, ‘Nail’, ‘Diamond’).

  • globalCtrl – <str> # Global control for scaling constraints.

  • scaleConstraint – <bool> # Flag to apply scale constraints to the control.

Returns:

None # This function does not return a value but creates sticky controls on the mesh.

Code Examples:

>>> as_CreateStickyCtrl()
# Creates a sticky control on the selected mesh or vertices with custom options for shape and mirroring.
graph TB Start[("fa:fa-play Start")] --> CheckSelections{"/fas:fa-check-circle Check Selections"} CheckSelections --> DetermineSelectionType{{"/fas:fa-question-circle Determine Selection Type"}} DetermineSelectionType --"If vtxList" --> UseVtxList["/fas:fa-th-list Use Vertex List"] DetermineSelectionType --"If not vtxList" --> UseMeshList["/fas:fa-cubes Use Mesh List"] UseMeshList --> GetMeshFromVtxList["/fas:fa-code-branch Get Mesh From Vertex List"] UseVtxList --> CreateCtrlShape["/fas:fa-shapes Create Control Shape"] GetMeshFromVtxList --> CreateCtrlShape CreateCtrlShape --> SetupCtrl["/fas:fa-cogs Setup Control"] SetupCtrl --> CreateCluster["/fas:fa-sitemap Create Cluster"] CreateCluster --> SetupRivetGroup["/fas:fa-layer-group Setup Rivet Group"] SetupRivetGroup --> PositionCtrlGroup["/fas:fa-arrows-alt Position Control Group"] PositionCtrlGroup --> ConnectCtrlToClusterLoc["/fas:fa-link Connect Control to Cluster Locator"] ConnectCtrlToClusterLoc --> FinalizeClusterSetup["/fas:fa-check-circle Finalize Cluster Setup"] FinalizeClusterSetup --> CheckMirror{"Check for Mirror"} CheckMirror --"If Mirrored"--> CreateMirrorCtrl["/fas:fa-clone Create Mirror Control"] CheckMirror --"If Not Mirrored"--> AttachMeshToCluster["/fas:fa-paperclip Attach Mesh to Cluster"] CreateMirrorCtrl --> AttachMeshToCluster AttachMeshToCluster --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelections fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineSelectionType fill:#ff9999,stroke:#000,stroke-width:2px style UseVtxList fill:#99ccff,stroke:#000,stroke-width:2px style UseMeshList fill:#cc99ff,stroke:#000,stroke-width:2px style GetMeshFromVtxList fill:#99ff99,stroke:#000,stroke-width:2px style CreateCtrlShape fill:#ff9999,stroke:#000,stroke-width:2px style SetupCtrl fill:#99ccff,stroke:#000,stroke-width:2px style CreateCluster fill:#cc99ff,stroke:#000,stroke-width:2px style SetupRivetGroup fill:#99ff99,stroke:#000,stroke-width:2px style PositionCtrlGroup fill:#ff9999,stroke:#000,stroke-width:2px style ConnectCtrlToClusterLoc fill:#99ccff,stroke:#000,stroke-width:2px style FinalizeClusterSetup fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMirror fill:#99ff99,stroke:#000,stroke-width:2px style CreateMirrorCtrl fill:#ff9999,stroke:#000,stroke-width:2px style AttachMeshToCluster fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_CreateStickyCtrl function:

  1. The process begins by checking the selections for mesh or vertex list.

  2. Depending on the selection type, either the vertex list or mesh list is used.

  3. A control shape is created based on specified options.

  4. The control is then set up with relevant attributes and positioning.

  5. A cluster is created for the control, and a rivet group is set up.

  6. The control group is positioned, and the control is connected to the cluster locator.

  7. The cluster setup is finalized, and the function checks if mirroring is required.

  8. If mirrored, a corresponding mirror control is created.

  9. Finally, the mesh is attached to the cluster, completing the control setup.

DeformEasy.as_DeformEasy(self, **shArgs)#

Purpose:

:: Initializes and configures the ‘as_DeformEasy’ window in Autodesk Maya, setting up various frame layouts and UI elements.

  • This function acts as the main entry point for the ‘as_DeformEasy’ tool, creating the main window and tab layouts.

  • It handles the configuration of UI elements such as frame layouts for cluster information, rig information, and other custom controls.

  • Additionally, it manages the opening and closing of various sections within the UI based on user interactions.

Returns:

None # This function does not return a value but initializes and displays the UI in Maya.

Code Examples:

>>> as_DeformEasy()
# Initializes and displays the 'as_DeformEasy' window with various interactive UI elements.
DeformEasy.as_ExportAllClusterCtrls(self, **shArgs)#

[shArgs : co=clustOut]

Purpose:

:: Exports all control data associated with the specified cluster(s) to an external file.

  • Useful for backing up or transferring control data related to cluster deformations between Maya scenes or models.

  • Helps maintain consistency in rigging setups across different projects or iterations.

Parameters:

clustOut – <str/list> # Name(s) of the cluster(s) whose control data are to be exported.

Returns:

None # This function does not return any value but exports the control data of the cluster(s) to a file.

Code Examples:

>>> cluster_name = "cluster1"
>>> as_ExportAllClusterCtrls(cluster_name)
# Exports all control data of the specified cluster.
graph TB Start[("fa:fa-play Start")] --> RetrieveClusterName{{"/fas:fa-search-plus Retrieve Cluster Name"}} RetrieveClusterName --"Get Cluster Name from UI" --> CheckMultipleClusters{"/fas:fa-clone Check for Multiple Clusters"} CheckMultipleClusters --"Multiple Clusters" --> MapClusterList["/fas:fa-map-signs Map Cluster List"] CheckMultipleClusters --"Single Cluster" --> SetClusterList["/fas:fa-list Set Cluster List"] MapClusterList --> ExportClusterControls["/fas:fa-upload Export Cluster Controls"] SetClusterList --> ExportClusterControls ExportClusterControls --> ShowMessage["/fas:fa-comment Show Success Message"] ShowMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveClusterName fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMultipleClusters fill:#99ff99,stroke:#000,stroke-width:2px style MapClusterList fill:#ff9999,stroke:#000,stroke-width:2px style SetClusterList fill:#99ccff,stroke:#000,stroke-width:2px style ExportClusterControls fill:#cc99ff,stroke:#000,stroke-width:2px style ShowMessage fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_ExportAllClusterCtrls function:

  1. The function starts by retrieving the name of the cluster from the user interface.

  2. It checks whether multiple clusters are specified for the export.

  3. If multiple clusters are detected, they are mapped into a list.

  4. If only a single cluster is specified, it sets the cluster list accordingly.

  5. The function then proceeds to export all control data associated with the specified cluster(s).

  6. A success message is displayed upon completion of the export process.

  7. The process concludes after the exportation and confirmation message.

DeformEasy.as_ExportClusterWeights(self, **shArgs)#

[**shArgs : co=clustOut]

Purpose:

:: Exports the weight information of specified cluster(s) to an external file for backup or usage in different scenes or projects.

  • This function handles the exportation of cluster weights, aiding in the preservation and transfer of deformation data across scenes.

  • It supports exporting weights of multiple clusters, enhancing the flexibility in managing complex rigging setups.

Parameters:

clustOut – <str/list> # The name(s) of the cluster(s) whose weights are to be exported. Extracted from a UI text field.

Returns:

None # This function does not return any value but exports the cluster weight data to a file.

Code Examples:

>>> clust_name = "cluster1"
>>> as_ExportClusterWeights(clust_name)
# Exports the weights of 'cluster1' to an external file.
graph TB Start[("fa:fa-play Start")] --> RetrieveClusterName{{"/fas:fa-search-plus Retrieve Cluster Name"}} RetrieveClusterName --"Get Cluster Name from UI" --> CheckMultipleClusters{"/fas:fa-clone Check for Multiple Clusters"} CheckMultipleClusters --"Multiple Clusters" --> MapClusterList["/fas:fa-map-signs Map Cluster List"] CheckMultipleClusters --"Single Cluster" --> SetClusterList["/fas:fa-list Set Cluster List"] MapClusterList --> ExportClusterWeights["/fas:fa-upload Export Cluster Weights"] SetClusterList --> ExportClusterWeights ExportClusterWeights --> ShowMessage["/fas:fa-comment Show Success Message"] ShowMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveClusterName fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMultipleClusters fill:#99ff99,stroke:#000,stroke-width:2px style MapClusterList fill:#ff9999,stroke:#000,stroke-width:2px style SetClusterList fill:#99ccff,stroke:#000,stroke-width:2px style ExportClusterWeights fill:#cc99ff,stroke:#000,stroke-width:2px style ShowMessage fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_ExportClusterWeights function:

  1. The process begins with retrieving the name of the cluster from the user interface.

  2. It then checks if multiple clusters are specified.

  3. If multiple clusters are identified, it maps them into a list.

  4. If a single cluster is specified, it sets the cluster list accordingly.

  5. The function proceeds to export the cluster weights to an external file.

  6. A success message is displayed upon completion of the export process.

  7. The process ends after the exportation and confirmation message.

DeformEasy.as_GetJiggleDeform(self, mesh=None, animCtrl=None, **shArgs)#

Purpose:

:: Adds jiggle deformation to a mesh in Autodesk Maya, creating dynamic secondary motion effects.

  • This function is typically used in character animation to add realism through natural movement.

  • It allows animators to control jiggle parameters through an animation control.

Parameters:
  • mesh – <str, optional> # The target mesh to apply jiggle deformation. Defaults to the selected mesh if not provided.

  • animCtrl – <str, optional> # The control object to manage jiggle attributes. Defaults to a specified global control if not provided.

Returns:

None # This function does not return a value but applies jiggle deformation to the specified mesh.

Code Examples:

>>> as_GetJiggleDeform(mesh='characterMesh', animCtrl='globalCtrl')
# Applies jiggle deformation to 'characterMesh' and links jiggle attributes to 'globalCtrl'.
graph TB Start[("fa:fa-play Start")] --> SelectMesh{"/fas:fa-mouse-pointer Select Mesh"} SelectMesh --"If mesh is provided" --> UseProvidedMesh["/fas:fa-hand-point-up Use Provided Mesh"] SelectMesh --"If mesh is not provided" --> GetSelectedMesh["/fas:fa-hand-pointer-up Get Selected Mesh"] UseProvidedMesh --> ApplyJiggleDeform["/fas:fa-wave-square Apply Jiggle Deformation"] GetSelectedMesh --> ApplyJiggleDeform ApplyJiggleDeform --> CheckAnimCtrl{"/fas:fa-question Check Animation Control"} CheckAnimCtrl --"If animCtrl is provided" --> UseProvidedAnimCtrl["/fas:fa-hand-point-right Use Provided Animation Control"] CheckAnimCtrl --"If animCtrl is not provided" --> UseDefaultAnimCtrl["/fas:fa-hand-point-left Use Default Animation Control"] UseProvidedAnimCtrl --> AddJiggleAttributes["/fas:fa-plus Add Jiggle Attributes"] UseDefaultAnimCtrl --> AddJiggleAttributes AddJiggleAttributes --> ConnectAttributes["/fas:fa-link Connect Attributes to Jiggle Node"] ConnectAttributes --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMesh fill:#ffcc00,stroke:#000,stroke-width:2px style UseProvidedMesh fill:#99ccff,stroke:#000,stroke-width:2px style GetSelectedMesh fill:#ff9999,stroke:#000,stroke-width:2px style ApplyJiggleDeform fill:#cc99ff,stroke:#000,stroke-width:2px style CheckAnimCtrl fill:#99ff99,stroke:#000,stroke-width:2px style UseProvidedAnimCtrl fill:#ff9999,stroke:#000,stroke-width:2px style UseDefaultAnimCtrl fill:#99ccff,stroke:#000,stroke-width:2px style AddJiggleAttributes fill:#cc99ff,stroke:#000,stroke-width:2px style ConnectAttributes fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_GetJiggleDeform function:

  1. Starts by checking if a specific mesh is provided for jiggle deformation.

  2. If a mesh is provided, it uses that mesh. If not, it selects the currently selected mesh in Maya.

  3. Applies jiggle deformation to the chosen mesh.

  4. Checks if an animation control (animCtrl) is provided to manage jiggle attributes.

  5. If an animCtrl is provided, it uses that. If not, it defaults to a specified global control.

  6. Adds jiggle attributes (jiggle, stiffness, damping, jiggleWeight) to the animation control.

  7. Connects these attributes to the jiggle node on the mesh to control the deformation.

  8. The process concludes with jiggle deformation applied and controllable via the animation control.

DeformEasy.as_GetSoftModCtrl(self, name=None, vtx=None, jnt='', **shArgs)#

[shArgs : n=name, v=vtx, j=jnt]

Purpose:

:: Creates soft modification controls for specified vertex and joint in Autodesk Maya.

  • This function is used to create a soft modification deformer with associated controls, typically for fine-tuning mesh deformations.

  • It allows for the selection of specific vertices and joints, and provides options for mirroring and control setup.

Parameters:
  • name – <str, optional> # Custom name for the soft modification control. If not provided, a default name is used.

  • vtx – <str> # The vertex to which the soft modification deformer will be applied.

  • jnt – <str, optional> # The joint to which the soft modification control will be constrained. If not provided, it prompts for joint selection.

Returns:

None # This function does not return a value but creates soft modification controls in the scene.

Code Examples:

>>> as_GetSoftModCtrl(name='MySoftMod', vtx='pCube1.vtx[0]', jnt='joint1')
# Creates a soft modification control for 'pCube1.vtx[0]' and constrains it to 'joint1'.
graph TB Start[("fa:fa-play Start")] --> CheckArgs{{"/fas:fa-question-circle Check Args"}} CheckArgs --"If shArgs provided" --> UpdateParameters["/fas:fa-sync-alt Update Parameters"] CheckArgs --"If shArgs not provided" --> GetSelectedObjects["/fas:fa-mouse-pointer Get Selected Objects"] UpdateParameters --> ValidateVtxJnt["/fas:fa-check-double Validate Vertex and Joint"] GetSelectedObjects --> ValidateVtxJnt ValidateVtxJnt --> CheckVertexSelection{{"/fas:fa-search-plus Check Vertex Selection"}} CheckVertexSelection --"If Vertex Selected" --> CheckJointSelection{{"/fas:fa-code-branch Check Joint Selection"}} CheckVertexSelection --"If No Vertex Selected" --> ErrorNoVertexSelected["/fas:fa-times-circle Error: No Vertex Selected"] CheckJointSelection --"If Joint Selected" --> CreateSoftModCtrl["/fas:fa-magic Create Soft Mod Control"] CheckJointSelection --"If No Joint Selected" --> PromptJointSelection["/fas:fa-hand-pointer Prompt Joint Selection"] PromptJointSelection --> CreateSoftModCtrl CreateSoftModCtrl --> End[("fas:fa-stop End")] ErrorNoVertexSelected --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateParameters fill:#99ccff,stroke:#000,stroke-width:2px style GetSelectedObjects fill:#ff9999,stroke:#000,stroke-width:2px style ValidateVtxJnt fill:#cc99ff,stroke:#000,stroke-width:2px style CheckVertexSelection fill:#99ff99,stroke:#000,stroke-width:2px style CheckJointSelection fill:#ffcc00,stroke:#000,stroke-width:2px style ErrorNoVertexSelected fill:#ff6666,stroke:#000,stroke-width:2px style CreateSoftModCtrl fill:#99ff99,stroke:#000,stroke-width:2px style PromptJointSelection fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_GetSoftModCtrl function:

  1. The process starts by checking if specific arguments are provided and updates parameters accordingly.

  2. If no vertex is selected, it displays an error message.

  3. For a selected vertex, it checks for joint selection.

  4. If no joint is selected, it prompts the user to select one.

  5. The function then creates a soft modification control for the specified vertex and joint.

  6. The process concludes after creating the soft mod control.

DeformEasy.as_GetWorkbox(self, **shArgs)#
DeformEasy.as_HoldSkinJnts(self, skinClust, onOff=0, **shArgs)#

[shArgs : sc=skinClust, oo=onOff]

Purpose:

:: Toggles the locking of influence weights for joints in a skin cluster.

  • This function is crucial for skinning processes in rigging, allowing for selective weight adjustments on specific joints.

  • It provides a quick way to lock or unlock all joint influences in a given skin cluster.

Parameters:
  • skinClust – <str> # Name of the skin cluster whose joint influences are to be locked or unlocked.

  • onOff – <int> # Flag to turn on (1) or off (0) the lock influence weights (liw) attribute for each joint.

Returns:

None # This function does not return a value but affects the skin cluster’s joint influences.

Code Examples:

>>> skin_cluster_name = "mySkinCluster"
>>> as_HoldSkinJnts(skin_cluster_name, 1)
# Locks all joint influences in the specified skin cluster.
graph TB Start[("fa:fa-play Start")] --> GetSkinCluster{"/fas:fa-sitemap Get Skin Cluster"} GetSkinCluster --"Retrieve skin cluster information" --> RetrieveInfluences["/fas:fa-list Retrieve Influences"] RetrieveInfluences --"List all joint influences in skin cluster" --> ToggleInfluenceLock{{"/fas:fa-lock-open Toggle Influence Lock"}} ToggleInfluenceLock --"Lock/Unlock influences based on onOff flag" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetSkinCluster fill:#ffcc00,stroke:#000,stroke-width:2px style RetrieveInfluences fill:#ff9999,stroke:#000,stroke-width:2px style ToggleInfluenceLock fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_HoldSkinJnts function:

  1. The function begins by obtaining the specified skin cluster.

  2. It then retrieves all joint influences associated with the skin cluster.

  3. Based on the onOff flag, it locks (1) or unlocks (0) the influence weights for each joint.

  4. This process ensures precise control over skinning in rigging workflows.

DeformEasy.as_ImportClusterWeights(self, **shArgs)#

[shArgs : co=clustOut]

Purpose:

:: Imports cluster weight data from an external file into the specified cluster(s) in the current Maya scene.

  • Facilitates the reapplication of previously saved cluster weight data to clusters in different scenes or models.

  • Streamlines the process of setting up complex rigging and deformation setups by reusing existing data.

Parameters:

clustOut – <str/list> # Name(s) of the cluster(s) where the imported weights are to be applied.

Returns:

None # This function does not return any value but imports the cluster weight data into the specified cluster(s).

Code Examples:

>>> cluster_name = "cluster1"
>>> as_ImportClusterWeights(cluster_name)
# Imports the weights into the specified cluster.
graph TB Start[("fa:fa-play Start")] --> RetrieveClusterName{{"/fas:fa-search-plus Retrieve Cluster Name"}} RetrieveClusterName --"Get Cluster Name from UI" --> CheckMultipleClusters{"/fas:fa-clone Check for Multiple Clusters"} CheckMultipleClusters --"Multiple Clusters" --> MapClusterList["/fas:fa-map-signs Map Cluster List"] CheckMultipleClusters --"Single Cluster" --> SetClusterList["/fas:fa-list Set Cluster List"] MapClusterList --> ImportClusterWeights["/fas:fa-download Import Cluster Weights"] SetClusterList --> ImportClusterWeights ImportClusterWeights --> ShowMessage["/fas:fa-comment Show Success Message"] ShowMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveClusterName fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMultipleClusters fill:#99ff99,stroke:#000,stroke-width:2px style MapClusterList fill:#ff9999,stroke:#000,stroke-width:2px style SetClusterList fill:#99ccff,stroke:#000,stroke-width:2px style ImportClusterWeights fill:#cc99ff,stroke:#000,stroke-width:2px style ShowMessage fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_ImportClusterWeights function:

  1. The function starts by retrieving the name of the cluster from the user interface.

  2. It checks whether multiple clusters are specified for the import.

  3. If multiple clusters are detected, they are mapped into a list.

  4. If only a single cluster is specified, it sets the cluster list accordingly.

  5. The function then proceeds to import the cluster weights from an external file.

  6. A success message is displayed upon completion of the import process.

  7. The process concludes after the importation and confirmation message.

DeformEasy.as_MirrorClustWeights(self, clustHand=None, srcWord=None, repWord=None, **shArgs)#

[shArgs : ch=clustHand, sw=srcWord, rw=repWord]

Purpose:

:: Mirrors the weights from one cluster to its opposite counterpart in a symmetrical model.

  • This function is useful in rigging, particularly when dealing with symmetrical characters, as it ensures consistent deformation on both sides.

  • It automates the weight mirroring process, saving time and maintaining accuracy.

Parameters:
  • clustHand – <str> # The cluster handle whose weights are to be mirrored.

  • srcWord – <str> # The source word in the cluster’s name indicating the side (e.g., ‘L’ for left).

  • repWord – <str> # The replacement word for the mirrored cluster’s name indicating the opposite side (e.g., ‘R’ for right).

Returns:

None # This function performs an action and does not return a value.

Code Examples:

>>> clustHandle = "L_arm_Cluster"
>>> sourceWord = "L"
>>> replaceWord = "R"
>>> as_MirrorClustWeights(clustHandle, sourceWord, replaceWord)
# Mirrors the cluster weights from the left arm to the right arm.
graph TB Start[("fa:fa-play Start")] --> CheckClustHand{{"/fas:fa-question Check clustHand"}} CheckClustHand --"If clustHand Provided" --> UseProvidedClustHand["/fas:fa-hand-pointer Use Provided clustHand"] CheckClustHand --"If clustHand Not Provided" --> FetchClusterHandle["/fas:fa-magnet Fetch Cluster Handle"] UseProvidedClustHand --> SelectVertices["/fas:fa-object-group Select Vertices"] FetchClusterHandle --> SelectVertices SelectVertices --> CheckSrcWord{{"/fas:fa-search-plus Check srcWord"}} CheckSrcWord --"If srcWord Provided" --> UseProvidedSrcWord["/fas:fa-user-check Use Provided srcWord"] CheckSrcWord --"If srcWord Not Provided" --> FetchSourceWord["/fas:fa-text-width Fetch Source Word"] UseProvidedSrcWord --> CheckRepWord{{"/fas:fa-exchange-alt Check repWord"}} FetchSourceWord --> CheckRepWord CheckRepWord --"If repWord Provided" --> UseProvidedRepWord["/fas:fa-user-check Use Provided repWord"] CheckRepWord --"If repWord Not Provided" --> FetchReplaceWord["/fas:fa-text-width Fetch Replace Word"] UseProvidedRepWord --> MirrorWeights["/fas:fa-arrows-alt-h Mirror Weights"] FetchReplaceWord --> MirrorWeights MirrorWeights --> CheckVtxList{{"/fas:fa-list-ol Check vtxList"}} CheckVtxList --"If vtxList Provided" --> UseProvidedVtxList["/fas:fa-hand-pointer Use Provided vtxList"] CheckVtxList --"If vtxList Not Provided" --> FetchVtxList["/fas:fa-dot-circle Fetch Vertex List"] UseProvidedVtxList --> PerformMirroring["/fas:fa-sync-alt Perform Mirroring"] FetchVtxList --> PerformMirroring PerformMirroring --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckClustHand fill:#ffcc00,stroke:#000,stroke-width:2px style UseProvidedClustHand fill:#ff9999,stroke:#000,stroke-width:2px style FetchClusterHandle fill:#99ccff,stroke:#000,stroke-width:2px style SelectVertices fill:#99ff99,stroke:#000,stroke-width:2px style CheckSrcWord fill:#cc99ff,stroke:#000,stroke-width:2px style UseProvidedSrcWord fill:#99ccff,stroke:#000,stroke-width:2px style FetchSourceWord fill:#99ff99,stroke:#000,stroke-width:2px style CheckRepWord fill:#cc99ff,stroke:#000,stroke-width:2px style UseProvidedRepWord fill:#99ccff,stroke:#000,stroke-width:2px style FetchReplaceWord fill:#99ff99,stroke:#000,stroke-width:2px style MirrorWeights fill:#99ccff,stroke:#000,stroke-width:2px style CheckVtxList fill:#cc99ff,stroke:#000,stroke-width:2px style UseProvidedVtxList fill:#99ccff,stroke:#000,stroke-width:2px style FetchVtxList fill:#99ff99,stroke:#000,stroke-width:2px style PerformMirroring fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_MirrorClustWeights function:

  1. The process begins by checking if a cluster handle is provided.

  2. If not, the function fetches the cluster handle from user input or the scene.

  3. It then confirms the source word (indicating the side of the cluster).

  4. If the source word is not provided, the function retrieves it from user input.

  5. Similarly, the function checks for the replacement word.

  6. With these parameters, it proceeds to mirror the weights from one cluster to its counterpart.

  7. The function then checks if a list of vertices is provided.

  8. If not, it fetches the list of vertices from the cluster.

  9. Finally, the function performs the mirroring of weights to the opposite cluster.

DeformEasy.as_PaintByWorkbox(self, **shArgs)#

Purpose:

:: Applies cluster deformation to a mesh in Autodesk Maya based on proximity to a workbox.

  • This function is used in character rigging to create localized deformations on a mesh.

  • It calculates vertex distances from a workbox and sets cluster weights accordingly.

Returns:

None # This function does not return a value but alters cluster weights on the selected mesh.

Code Examples:

>>> as_PaintByWorkbox()
# Applies cluster deformation to selected mesh based on its proximity to a workbox.
graph TB Start[("fa:fa-play Start")] --> SelectMesh["/fas:fa-mouse-pointer Select Mesh"] SelectMesh --> GetVertexList["/fas:fa-th-list Get Vertex List"] GetVertexList --> InitializeVariables["/fas:fa-sync Initialize Variables"] InitializeVariables --> LoopVertices{{"/fas:fa-repeat Loop Through Vertices"}} LoopVertices --> CheckProximity["/fas:fa-ruler-combined Check Proximity to Workbox"] CheckProximity --"If Inside Workbox" --> AddToClusterList["/fas:fa-plus-square Add to Cluster List"] CheckProximity --"If Outside Workbox" --> ContinueLoop["/fas:fa-arrow-right Continue Loop"] AddToClusterList --> EndLoop{{"/fas:fa-repeat End Loop"}} EndLoop --"If More Vertices" --> LoopVertices EndLoop --"If No More Vertices" --> CalculateDistances["/fas:fa-ruler Calculate Distances"] CalculateDistances --> LoopClusterVertices{{"/fas:fa-repeat Loop Cluster Vertices"}} LoopClusterVertices --> CalculateWeight["/fas:fa-balance-scale Calculate Weight"] CalculateWeight --> ApplyCluster["/fas:fa-paint-roller Apply Cluster"] ApplyCluster --> EndLoopCluster{{"/fas:fa-repeat End Loop Cluster"}} EndLoopCluster --"If More Cluster Vertices" --> LoopClusterVertices EndLoopCluster --"If No More Cluster Vertices" --> Finalize["/fas:fa-check-circle Finalize"] Finalize --> End[("fas:fa-stop End")] ContinueLoop --> EndLoop style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectMesh fill:#ffcc00,stroke:#000,stroke-width:2px style GetVertexList fill:#99ccff,stroke:#000,stroke-width:2px style InitializeVariables fill:#ff9999,stroke:#000,stroke-width:2px style LoopVertices fill:#cc99ff,stroke:#000,stroke-width:2px style CheckProximity fill:#99ff99,stroke:#000,stroke-width:2px style AddToClusterList fill:#ff9999,stroke:#000,stroke-width:2px style ContinueLoop fill:#99ccff,stroke:#000,stroke-width:2px style EndLoop fill:#cc99ff,stroke:#000,stroke-width:2px style CalculateDistances fill:#99ff99,stroke:#000,stroke-width:2px style LoopClusterVertices fill:#ffcc00,stroke:#000,stroke-width:2px style CalculateWeight fill:#ff6666,stroke:#000,stroke-width:2px style ApplyCluster fill:#99ff99,stroke:#000,stroke-width:2px style EndLoopCluster fill:#ff9999,stroke:#000,stroke-width:2px style Finalize fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_PaintByWorkbox function:

  1. Begins by selecting a mesh for cluster deformation.

  2. Retrieves the vertex list of the selected mesh.

  3. Initializes variables needed for calculation.

  4. Loops through each vertex to check its proximity to the workbox.

  5. Adds vertices inside the workbox to a cluster list.

  6. Calculates the distance of each vertex from a reference point.

  7. Loops through cluster vertices to calculate their deformation weight.

  8. Applies cluster weights based on the calculated values.

  9. Finalizes the process by completing the cluster weight application.

DeformEasy.as_PaintCluster(self, **shArgs)#

[shArgs : mn=meshName, co=clustOut]

Purpose:

:: Provides a tool for manually painting cluster weights on a mesh in Autodesk Maya.

  • Enables fine control over the distribution of cluster weights through an interactive painting interface.

  • The function sets up the necessary context and selects the appropriate cluster for weight painting.

Parameters:
  • meshName – <str> # The name of the mesh to paint cluster weights on.

  • clustOut – <str> # The cluster handle whose weights will be painted.

Returns:

None # This function does not return any value but initiates a weight painting session.

Code Examples:

    clustName =PyNode(connectionInfo(selected()[0] + '.scale', dfs=1)[0].split('.')[0])
    clustOut = connectionInfo(clustName + '.worldMatrix[0]', dfs=1)[0].split('.')[0]

>>> mesh_name = "pCube1"
>>> cluster_handle = "cluster1Handle"
>>> as_PaintCluster(mesh_name, cluster_handle)
# Sets up the painting context for the specified cluster on the given mesh.
graph TB Start[("fa:fa-play Start")] --> CheckMeshList{{"/fas:fa-check-circle Check meshList"}} CheckMeshList --"If meshList Provided" --> SelectMeshes["/fas:fa-object-group Select Meshes"] CheckMeshList --"If meshList Not Provided" --> CheckClustOut{{"/fas:fa-question-circle Check clustOut"}} SelectMeshes --> ConvertToVertices["/fas:fa-exchange-alt Convert Selection To Vertices"] CheckClustOut --"If clustOut Provided" --> SelectVertices["/fas:fa-vector-square Select Vertices"] CheckClustOut --"If clustOut Not Provided" --> FetchClusterName["/fas:fa-search Fetch Cluster Name"] ConvertToVertices --> ResetWeights["/fas:fa-undo-alt Reset Weights"] SelectVertices --> ResetWeights FetchClusterName --> CheckVtxList{{"/fas:fa-check-circle Check vtxList"}} CheckVtxList --"If vtxList Provided" --> ResetWeights CheckVtxList --"If vtxList Not Provided" --> ConfirmResetAll["/fas:fa-exclamation-triangle Confirm Reset All"] ConfirmResetAll --"Confirm Reset All" --> ResetAllWeights["/fas:fa-undo-alt Reset All Weights"] ResetAllWeights --> End[("fas:fa-stop End")] ResetWeights --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshList fill:#ffcc00,stroke:#000,stroke-width:2px style SelectMeshes fill:#99ccff,stroke:#000,stroke-width:2px style CheckClustOut fill:#cc99ff,stroke:#000,stroke-width:2px style ConvertToVertices fill:#99ff99,stroke:#000,stroke-width:2px style SelectVertices fill:#99ccff,stroke:#000,stroke-width:2px style FetchClusterName fill:#99ff99,stroke:#000,stroke-width:2px style CheckVtxList fill:#cc99ff,stroke:#000,stroke-width:2px style ResetWeights fill:#99ccff,stroke:#000,stroke-width:2px style ConfirmResetAll fill:#ff6666,stroke:#000,stroke-width:2px style ResetAllWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_ResetCluster function:

  1. The function begins by checking if a list of meshes is provided.

  2. If meshes are specified, they are selected, and their vertices are targeted for resetting weights.

  3. In the absence of a specified mesh list, the function checks if a specific cluster handle is provided.

  4. If no cluster handle is provided, it is fetched from the user interface.

  5. The function then checks if a list of specific vertices is provided for weight resetting.

  6. If specific vertices are not provided, the function prompts for confirmation to reset weights for all vertices linked to the cluster.

  7. Upon confirmation, or if specific vertices or meshes are provided, the cluster weights are reset to 0.

  8. The process ends after resetting the weights.

DeformEasy.as_ResetCluster(self, meshList=None, vtxList=None, clustOut=None, showMessage=None, **shArgs)#

[shArgs : ml=meshList, vl=vtxList, co=clustOut, sm=showMessage]

Purpose:

:: Resets the weights of a cluster to 0 for the selected vertices or meshes.

  • Resets cluster weights to their default state.

  • Can be applied to a specific list of vertices or all vertices associated with a cluster.

Parameters:
  • meshList – <list> # List of meshes to reset cluster weights on.

  • vtxList – <list> # List of specific vertices to reset cluster weights on.

  • clustOut – <str> # The cluster whose weights need to be reset.

  • showMessage – <bool> # Whether to display a message on completion.

Returns:

None # This function does not return any value but modifies the cluster weights.

Code Examples:

    clustName =PyNode(connectionInfo(selected()[0] + '.scale', dfs=1)[0].split('.')[0])
    clustOut = connectionInfo(clustName + '.worldMatrix[0]', dfs=1)[0].split('.')[0]
>>> mesh_list = ["pCube1", "pSphere1"]
>>> vertex_list = ["pCube1.vtx[0]", "pCube1.vtx[1]"]
>>> cluster_handle = "cluster1Handle"
>>> showMessage = True
>>> as_ResetCluster(mesh_list, vertex_list, cluster_handle, showMessage)
# Resets the weights of the specified cluster for given meshes and vertices.
graph TB Start[("fa:fa-play Start")] --> CheckMeshList{{"/fas:fa-check-circle Check meshList"}} CheckMeshList --"If meshList Provided" --> SelectMeshes["/fas:fa-object-group Select Meshes"] CheckMeshList --"If meshList Not Provided" --> CheckClustOut{{"/fas:fa-question-circle Check clustOut"}} SelectMeshes --> ConvertToVertices["/fas:fa-exchange-alt Convert Selection To Vertices"] CheckClustOut --"If clustOut Provided" --> SelectVertices["/fas:fa-vector-square Select Vertices"] CheckClustOut --"If clustOut Not Provided" --> FetchClusterName["/fas:fa-search Fetch Cluster Name"] ConvertToVertices --> ResetWeights["/fas:fa-undo-alt Reset Weights"] SelectVertices --> ResetWeights FetchClusterName --> CheckVtxList{{"/fas:fa-check-circle Check vtxList"}} CheckVtxList --"If vtxList Provided" --> ResetWeights CheckVtxList --"If vtxList Not Provided" --> ConfirmResetAll["/fas:fa-exclamation-triangle Confirm Reset All"] ConfirmResetAll --"Confirm Reset All" --> ResetAllWeights["/fas:fa-undo-alt Reset All Weights"] ResetAllWeights --> End[("fas:fa-stop End")] ResetWeights --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshList fill:#ffcc00,stroke:#000,stroke-width:2px style SelectMeshes fill:#99ccff,stroke:#000,stroke-width:2px style CheckClustOut fill:#cc99ff,stroke:#000,stroke-width:2px style ConvertToVertices fill:#99ff99,stroke:#000,stroke-width:2px style SelectVertices fill:#99ccff,stroke:#000,stroke-width:2px style FetchClusterName fill:#99ff99,stroke:#000,stroke-width:2px style CheckVtxList fill:#cc99ff,stroke:#000,stroke-width:2px style ResetWeights fill:#99ccff,stroke:#000,stroke-width:2px style ConfirmResetAll fill:#ff6666,stroke:#000,stroke-width:2px style ResetAllWeights fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_ResetCluster function:

  1. The function begins by checking if a list of meshes is provided.

  2. If meshes are specified, they are selected, and their vertices are targeted for resetting weights.

  3. In the absence of a specified mesh list, the function checks if a specific cluster handle is provided.

  4. If no cluster handle is provided, it is fetched from the user interface.

  5. The function then checks if a list of specific vertices is provided for weight resetting.

  6. If specific vertices are not provided, the function prompts for confirmation to reset weights for all vertices linked to the cluster.

  7. Upon confirmation, or if specific vertices or meshes are provided, the cluster weights are reset to 0.

  8. The process ends after resetting the weights.

DeformEasy.as_SelectClustVertices(self, clustHand=None, minWeight=0.01, vtxList=None, **shArgs)#

[shArgs : ch=clustHand, mw=minWeight, vl=vtxList]

Purpose:

:: Selects vertices that are influenced by a specific cluster based on a minimum weight threshold.

  • This function is vital in rigging and animation for refining cluster influences on a mesh.

  • It allows for precise control over vertex selection based on cluster weight, facilitating more accurate and nuanced deformations.

Parameters:
  • clustHand – <str> # The cluster handle from which to select vertices.

  • minWeight – <float> # The minimum weight threshold for selecting vertices.

  • vtxList – <list> # A list of vertices to consider for selection. If None, it selects all vertices influenced by the cluster.

Returns:

None # The function selects vertices in the Maya scene and does not return a value.

Code Examples:

>>> clusterHandle = "arm_Cluster"
>>> minimumWeight = 0.05
>>> vertexList = ["pCube1.vtx[0]", "pCube1.vtx[1]"]
>>> as_SelectClustVertices(clusterHandle, minimumWeight, vertexList)
# Selects vertices from 'pCube1' influenced by 'arm_Cluster' with weights greater than 0.05.
graph TB Start[("fa:fa-play Start")] --> CheckClustHand{{"/fas:fa-question Check clustHand"}} CheckClustHand --"If clustHand Provided" --> UseProvidedClustHand["/fas:fa-hand-pointer Use Provided clustHand"] CheckClustHand --"If clustHand Not Provided" --> FetchClusterHandle["/fas:fa-magnet Fetch Cluster Handle"] UseProvidedClustHand --> SelectVertices["/fas:fa-object-group Select Vertices"] FetchClusterHandle --> SelectVertices SelectVertices --> CheckSelectionList{{"/fas:fa-list-ol Check Selection List"}} CheckSelectionList --"If Selection is Vertex" --> GetClusterWeights["/fas:fa-balance-scale Get Cluster Weights"] CheckSelectionList --"Else" --> GetClusterWeightsAll["/fas:fa-balance-scale Get All Cluster Weights"] GetClusterWeights --> FilterByWeight["/fas:fa-filter Filter By Weight"] GetClusterWeightsAll --> FilterByWeight FilterByWeight --> FinalSelection["/fas:fa-check-circle Finalize Selection"] FinalSelection --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckClustHand fill:#ffcc00,stroke:#000,stroke-width:2px style UseProvidedClustHand fill:#ff9999,stroke:#000,stroke-width:2px style FetchClusterHandle fill:#99ccff,stroke:#000,stroke-width:2px style SelectVertices fill:#99ff99,stroke:#000,stroke-width:2px style CheckSelectionList fill:#cc99ff,stroke:#000,stroke-width:2px style GetClusterWeights fill:#99ccff,stroke:#000,stroke-width:2px style GetClusterWeightsAll fill:#99ff99,stroke:#000,stroke-width:2px style FilterByWeight fill:#99ccff,stroke:#000,stroke-width:2px style FinalSelection fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_SelectClustVertices function:

  1. The process starts by checking if a cluster handle is provided.

  2. If not provided, the function fetches the cluster handle from the user input or scene.

  3. It then selects vertices based on the cluster handle.

  4. The function checks if the current selection is a vertex.

  5. Based on the selection, it retrieves the cluster weights for the selected vertices or all vertices.

  6. The vertices are then filtered based on the minimum weight threshold.

  7. Finally, the function selects the vertices that meet the criteria and updates the Maya scene selection.

DeformEasy.as_SelectMirrEdge(self, mirrAxis='x', mirrType='exact', **shArgs)#

[shArgs : ma=mirrAxis, mt=mirrType]

Purpose:

:: Automates the selection of mirror edges for a given mesh based on a specified axis and mirror type.

  • Aids in symmetrical modeling and rigging tasks by finding and selecting corresponding edges on the opposite side of a mesh.

  • Supports different mirroring methods such as exact, high to low, or low to high.

Parameters:
  • mirrAxis – <str> # The axis (‘x’, ‘y’, or ‘z’) along which the mirroring is performed.

  • mirrType – <str> # The type of mirroring strategy (‘exact’, ‘hi2low’, ‘low2hi’).

Returns:

None # This function selects mirror edges but does not return any value.

Code Examples:

>>> as_SelectMirrEdge(mirrAxis='x', mirrType='exact')
# Finds and selects mirror edges along the X-axis with exact mirroring.
graph TB Start[("fa:fa-play Start")] --> RetrieveSelectedEdges["/fas:fa-project-diagram Retrieve Selected Edges"] RetrieveSelectedEdges --> DetermineMeshName["/fas:fa-cube Determine Mesh Name"] DetermineMeshName --> GetMirrorEdgeList["/fas:fa-list-ol Get Mirror Edge List"] GetMirrorEdgeList --> InitializeLocators["/fas:fa-map-marker-alt Initialize Locators"] InitializeLocators --> StartProgressWin["/fas:fa-tachometer-alt Start Progress Window"] StartProgressWin --> LoopEdges{{"/fas:fa-repeat Loop Through Edges"}} LoopEdges --"For Each Edge" --> PositionLocators["/fas:fa-arrows-alt-h Position Locators"] PositionLocators --> DetermineMirroredEdge["/fas:fa-exchange-alt Determine Mirrored Edge"] DetermineMirroredEdge --> AddToFinalList["/fas:fa-plus-circle Add to Final List"] AddToFinalList --> EndLoop[("fas:fa-repeat End Loop")] EndLoop --"If More Edges" --> LoopEdges EndLoop --"If No More Edges" --> EndProgressWin["/fas:fa-stopwatch End Progress Window"] EndProgressWin --> SelectFinalEdges["/fas:fa-hand-pointer Select Final Edges"] SelectFinalEdges --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveSelectedEdges fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineMeshName fill:#ff9999,stroke:#000,stroke-width:2px style GetMirrorEdgeList fill:#99ccff,stroke:#000,stroke-width:2px style InitializeLocators fill:#99ff99,stroke:#000,stroke-width:2px style StartProgressWin fill:#99ccff,stroke:#000,stroke-width:2px style LoopEdges fill:#cc99ff,stroke:#000,stroke-width:2px style PositionLocators fill:#99ff99,stroke:#000,stroke-width:2px style DetermineMirroredEdge fill:#99ccff,stroke:#000,stroke-width:2px style AddToFinalList fill:#99ff99,stroke:#000,stroke-width:2px style EndLoop fill:#cc99ff,stroke:#000,stroke-width:2px style EndProgressWin fill:#99ccff,stroke:#000,stroke-width:2px style SelectFinalEdges fill:#00cc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_SelectMirrEdge function:

  1. The function starts by retrieving the currently selected edges.

  2. It then determines the name of the mesh these edges belong to.

  3. Based on this mesh, it gets a list of potential mirror edges.

  4. Two locators are initialized to assist in finding the mirror edges.

  5. A progress window is opened to provide feedback during the process.

  6. For each edge, the function positions locators to determine the mirrored edge.

  7. Once the mirrored edge is determined, it is added to a final list for selection.

  8. The progress window is updated for each edge processed.

  9. Upon completion, the final list of mirrored edges is selected.

  10. The function ends after selecting the mirrored edges.

DeformEasy.as_SelectMirrEdge_Old(self)#
DeformEasy.as_SelectMirrVtx(self, LPrefix=None, RPrefix=None, **shArgs)#

[shArgs : lp=LPrefix, rp=RPrefix]

Purpose:

:: Selects the mirror vertex of the currently selected vertex, based on left and right prefixes.

  • Useful in symmetrical editing or rigging, ensuring mirrored vertices are accurately selected.

  • The function takes into consideration the naming conventions (left and right prefixes) for symmetry.

Parameters:
  • LPrefix – <str, optional> # Left side prefix for naming conventions.

  • RPrefix – <str, optional> # Right side prefix for naming conventions.

Returns:

<dict> # Dictionary mapping the selected vertex to its mirror counterpart.

Code Examples:

>>> as_SelectMirrVtx(LPrefix='L_', RPrefix='R_')
# Selects the mirror vertex of the currently selected vertex based on 'L_' and 'R_' prefixes.
graph TB Start[("fa:fa-play Start")] --> CheckSelection{{"/fas:fa-check-square Check Selection is Vertex"}} CheckSelection --"Selection is Vertex" --> RetrievePrefixes["/fas:fa-text-width Retrieve LPrefix and RPrefix"] CheckSelection --"Selection is Not Vertex" --> Error["/fas:fa-exclamation-triangle Error: Selection Not a Vertex"] RetrievePrefixes --> PerformMirrorSelection["/fas:fa-exchange-alt Perform Mirror Vertex Selection"] PerformMirrorSelection --> CheckMirrorResult{{"/fas:fa-search-plus Check if Mirror Vertex Found"}} CheckMirrorResult --"Mirror Vertex Found" --> SelectMirrorVertex["/fas:fa-hand-pointer Select Mirror Vertex"] CheckMirrorResult --"No Mirror Vertex" --> RevertSelection["/fas:fa-undo-alt Revert to Original Selection"] Error --> End[("fas:fa-stop End")] SelectMirrorVertex --> End RevertSelection --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style RetrievePrefixes fill:#ff9999,stroke:#000,stroke-width:2px style PerformMirrorSelection fill:#99ccff,stroke:#000,stroke-width:2px style CheckMirrorResult fill:#99ff99,stroke:#000,stroke-width:2px style SelectMirrorVertex fill:#99ccff,stroke:#000,stroke-width:2px style RevertSelection 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:

This flowchart illustrates the as_SelectMirrVtx function:

  1. The function begins by verifying if the current selection is a vertex.

  2. It then retrieves the left and right side prefixes (LPrefix and RPrefix) to identify the corresponding naming conventions.

  3. The function performs the mirror vertex selection based on the identified prefixes.

  4. After determining if a mirror vertex is found, it either selects the mirror vertex or reverts to the original selection.

  5. The function concludes by either selecting the mirror vertex or handling the case where no mirror vertex is found.

DeformEasy.as_SelectMirrVtx_Old(self, LPrefix=None, RPrefix=None, **shArgs)#
DeformEasy.as_SmoothCluster(self, **shArgs)#

[shArgs : mn=meshName, lp=LPrefix, rp=RPrefix, co=clustOut]

Purpose:

:: Smooths the weight distribution of a cluster on a mesh, creating more natural deformations.

  • Enhances the visual quality of deformations by ensuring weight gradients are smooth and gradual.

  • Ideal for refining rigging and deformation setups for organic and smooth movements.

Parameters:
  • meshName – <str> # The name of the mesh to which the cluster is applied.

  • LPrefix – <str> # The prefix used for left-sided controls or clusters.

  • RPrefix – <str> # The prefix used for right-sided controls or clusters.

  • clustOut – <str> # Name of the cluster to be smoothed.

Returns:

None # This function does not return any value but smooths the cluster weights on the mesh.

Code Examples:

>>> mesh_name = "characterMesh"
>>> LPrefix = "L_"
>>> RPrefix = "R_"
>>> cluster_name = "cluster1"
>>> as_SmoothCluster(mesh_name, LPrefix, RPrefix, cluster_name)
# Smooths the weights of the specified cluster on the mesh.
graph TB Start[("fa:fa-play Start")] --> RetrieveMesh{{"/fas:fa-search-plus Retrieve Mesh"}} RetrieveMesh --"Get Mesh Name from UI or Selection" --> RetrievePrefixes{{"/fas:fa-code-branch Retrieve Prefixes"}} RetrievePrefixes --"Get Left and Right Prefixes from UI" --> RetrieveClusterName{{"/fas:fa-search-plus Retrieve Cluster Name"}} RetrieveClusterName --"Get Cluster Name from UI" --> ActivateSmoothTool["/fas:fa-brush Activate Smooth Tool"] ActivateSmoothTool --> SetOpacity["/fas:fa-tint Set Opacity"] SetOpacity --> SetPaintingOption["/fas:fa-paint-brush Set Painting Option"] SetPaintingOption --> ClearBrush["/fas:fa-eraser Clear Brush"] ClearBrush --> RepeatClear["/fas:fa-redo-alt Repeat Clear Brush"] RepeatClear --> ActivateSmoothToolAgain["/fas:fa-brush Activate Smooth Tool Again"] ActivateSmoothToolAgain --> CheckMirrorOption{{"/fas:fa-exchange-alt Check Mirror Option"}} CheckMirrorOption --"If Mirror Option Enabled" --> RetrieveOppositeCluster{{"/fas:fa-sync-alt Retrieve Opposite Cluster"}} CheckMirrorOption --"If No Mirror Option" --> End[("fas:fa-stop End")] RetrieveOppositeCluster --"Get Opposite Cluster Name" --> RepeatProcessForOpposite["/fas:fa-repeat Repeat Process for Opposite Cluster"] RepeatProcessForOpposite --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveMesh fill:#ffcc00,stroke:#000,stroke-width:2px style RetrievePrefixes fill:#99ff99,stroke:#000,stroke-width:2px style RetrieveClusterName fill:#ff9999,stroke:#000,stroke-width:2px style ActivateSmoothTool fill:#99ccff,stroke:#000,stroke-width:2px style SetOpacity fill:#cc99ff,stroke:#000,stroke-width:2px style SetPaintingOption fill:#99ff99,stroke:#000,stroke-width:2px style ClearBrush fill:#ffcc99,stroke:#000,stroke-width:2px style RepeatClear fill:#ccffcc,stroke:#000,stroke-width:2px style ActivateSmoothToolAgain fill:#ffcc99,stroke:#000,stroke-width:2px style CheckMirrorOption fill:#cc99ff,stroke:#000,stroke-width:2px style RetrieveOppositeCluster fill:#99ccff,stroke:#000,stroke-width:2px style RepeatProcessForOpposite fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the as_SmoothCluster function:

  1. The function starts by retrieving the mesh name from the UI or the current selection.

  2. It then retrieves left and right prefixes from the UI for determining cluster sides.

  3. The cluster name is retrieved from the UI.

  4. The smooth tool is activated for the selected cluster.

  5. Opacity is set for the paint tool, and the painting option is configured for smoothing.

  6. The brush is cleared repeatedly to ensure proper application.

  7. The smooth tool is reactivated for the opposite cluster if the mirror option is enabled.

  8. The opposite cluster is identified and the smoothing process is repeated for it.

  9. The process ends after smoothing both clusters or the single cluster if the mirror option is not enabled.

DeformEasy.as_SnapRotTo(self, toWorld=0, **shArgs)#

[shArgs : tw=toWorld, sl=sList]

Purpose:

:: Snaps the rotation of selected objects to a target object or to world space, aligning their rotational axes.

  • Useful in rigging and animation to match the orientations of different objects precisely.

  • Facilitates alignment tasks, ensuring consistent and expected rotation across multiple objects.

Parameters:
  • toWorld – <int> # Indicates whether to snap to world space (1) or to another object (0).

  • sList – <list> # List of selected objects to be aligned in rotation.

Returns:

None # This function does not return any value but updates the rotation of selected objects.

Code Examples:

>>> to_world = 1
>>> selected_objects = ["obj1", "obj2", "obj3"]
>>> as_SnapRotTo(to_world, selected_objects)
# Snaps the rotation of selected objects to world space.
graph TB Start[("fa:fa-play Start")] --> CheckSelection{{"/fas:fa-check-circle Check Selection"}} CheckSelection --"If Selection is Valid" --> DetermineSnapMode{{"/fas:fa-exchange-alt Determine Snap Mode"}} DetermineSnapMode --"Snap to World" --> SnapRotToWorld["/fas:fa-globe Snap Rotation to World"] DetermineSnapMode --"Snap to Object" --> SnapRotToObject["/fas:fa-object-group Snap Rotation to Object"] SnapRotToWorld --> ProcessMultipleObjs{{"/fas:fa-sync-alt Process Multiple Objects"}} SnapRotToObject --> ProcessMultipleObjs ProcessMultipleObjs --> End[("fas:fa-stop End")] CheckSelection --"If No Valid Selection" --> ErrorMsg[("/fas:fa-exclamation-triangle Error Message")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckSelection fill:#ffcc00,stroke:#000,stroke-width:2px style DetermineSnapMode fill:#99ccff,stroke:#000,stroke-width:2px style SnapRotToWorld fill:#99ff99,stroke:#000,stroke-width:2px style SnapRotToObject fill:#ff9999,stroke:#000,stroke-width:2px style ProcessMultipleObjs fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px style ErrorMsg fill:#ff6666,stroke:#000,stroke-width:2px
Flow Chart Description:

This flowchart illustrates the as_SnapRotTo function:

  1. The process begins by checking if there is a valid selection of objects.

  2. Depending on the input, the function determines whether to snap rotations to world space or to another object.

  3. If snapping to world space, it aligns the rotation of each selected object to world space.

  4. If snapping to another object, it aligns the rotation of each selected object to the last selected object.

  5. The function processes each object in the selection list to apply the appropriate rotation alignment.

  6. If there is no valid selection, an error message is displayed, indicating the need for a valid selection.

  7. The process ends after all selected objects have their rotations snapped accordingly.

DeformEasy.attachMeshesToClust(self, meshList=None, clust=None, **shArgs)#

[shArgs : ml=meshList, c=clust]

Purpose:

:: Attaches a list of meshes to a specified cluster, allowing for deformation control in Autodesk Maya.

  • Streamlines the process of adding multiple meshes to a single cluster for unified deformation.

  • Optional feature to reorder deformers for better deformation control and pipeline integration.

Parameters:
  • meshList – <list> # List of mesh objects to be attached to the cluster.

  • clust – <str> # Name of the cluster to which the meshes will be attached.

Returns:

None # This function does not return any value but modifies the provided meshes and cluster.

Code Examples:

>>> mesh_list = ["mesh1", "mesh2", "mesh3"]
>>> cluster_name = "myCluster"
>>> attachMeshesToClust(mesh_list, cluster_name)
# Attaches all meshes in the list to the specified cluster.
graph TB Start[("fa:fa-play Start")] --> CheckMeshList{{"/fas:fa-question-circle Check meshList"}} CheckMeshList --"If meshList Provided" --> ProcessMeshList["/fas:fa-cogs Process meshList"] CheckMeshList --"If meshList Not Provided" --> GetSelectedMeshes["/fas:fa-mouse-pointer Get Selected Meshes"] GetSelectedMeshes --> ProcessMeshList ProcessMeshList --> CheckClust{{"/fas:fa-search-plus Check clust"}} CheckClust --"If clust Provided" --> AttachMeshesToCluster["/fas:fa-link Attach Meshes to Cluster"] CheckClust --"If clust Not Provided" --> GetClusterFromUI["/fas:fa-desktop Get Cluster from UI"] GetClusterFromUI --> AttachMeshesToCluster AttachMeshesToCluster --> CheckReorderDeformers{{"/fas:fa-sort Check Reorder Deformers"}} CheckReorderDeformers --"If Reorder Deformers" --> ReorderDeformers["/fas:fa-random Reorder Deformers"] CheckReorderDeformers --"No Reorder" --> End[("fas:fa-stop End")] ReorderDeformers --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMeshList fill:#ffcc00,stroke:#000,stroke-width:2px style ProcessMeshList fill:#99ff99,stroke:#000,stroke-width:2px style GetSelectedMeshes fill:#ff9999,stroke:#000,stroke-width:2px style CheckClust fill:#99ccff,stroke:#000,stroke-width:2px style AttachMeshesToCluster fill:#cc99ff,stroke:#000,stroke-width:2px style GetClusterFromUI fill:#99ff99,stroke:#000,stroke-width:2px style CheckReorderDeformers fill:#ffcc99,stroke:#000,stroke-width:2px style ReorderDeformers fill:#ccffcc,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the attachMeshesToClust function:

  1. Starts by checking if a list of meshes is provided.

  2. If not provided, it selects the currently selected mesh objects.

  3. Checks if the cluster is provided.

  4. If no cluster is provided, it retrieves the cluster name from the UI.

  5. Attaches the meshes to the specified cluster.

  6. Checks if reorder deformers option is enabled.

  7. If enabled, reorders the deformers for better deformation control.

  8. The process completes after all meshes are attached and deformers are reordered if necessary.

DeformEasy.changeColors(self, **shArgs)#

[shArgs : ]

Purpose:

:: Alters the color of control objects in Maya based on their naming conventions and side (left or right).

  • Facilitates better visual organization and differentiation of controls in a rig, especially in complex character setups.

  • Allows for easy identification of left and right side controls through color coding.

Returns:

None # This function changes control colors in the scene but does not return any value.

Code Examples:

>>> changeColors()
# Changes the colors of control objects based on their naming conventions and specified color settings.
graph TB Start[("fa:fa-play Start")] --> SelectControls["/fas:fa-mouse-pointer Select Controls"] SelectControls --> EnableOverrides["/fas:fa-toggle-on Enable Color Overrides"] EnableOverrides --> SetGlobalColor["/fas:fa-palette Set Global Control Color"] SetGlobalColor --> DetermineColorType{{"/fas:fa-question Determine Color Type"}} DetermineColorType --> SelectLeftControls["/fas:fa-arrow-left Select Left Side Controls"] DetermineColorType --> SelectRightControls["/fas:fa-arrow-right Select Right Side Controls"] SelectLeftControls --> SetLeftColor["/fas:fa-fill-drip Set Left Control Color"] SetLeftColor --> End[("fas:fa-stop End")] SelectRightControls --> SetRightColor["/fas:fa-fill-drip Set Right Control Color"] SetRightColor --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectControls fill:#ffcc00,stroke:#000,stroke-width:2px style EnableOverrides fill:#ff9999,stroke:#000,stroke-width:2px style SetGlobalColor fill:#99ccff,stroke:#000,stroke-width:2px style DetermineColorType fill:#99ff99,stroke:#000,stroke-width:2px style SelectLeftControls fill:#99ccff,stroke:#000,stroke-width:2px style SetLeftColor fill:#99ff99,stroke:#000,stroke-width:2px style SelectRightControls fill:#99ccff,stroke:#000,stroke-width:2px style SetRightColor fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the changeColors function:

  1. The process starts by selecting all control objects in the scene.

  2. Color overrides are enabled for these controls.

  3. Global control color is set to a standard color (Yellow).

  4. The function determines the color type based on user preferences or default settings.

  5. Left side controls are selected and colored either Blue or Light Blue based on the color type.

  6. Right side controls are selected and colored either Red or Pink based on the color type.

DeformEasy.checkMirrorSelection(self, **shArgs)#

[shArgs : ]

Purpose:

:: Checks the selected object and performs a mirror selection based on the object type (vertex or edge).

  • This function is designed to simplify the process of selecting mirror counterparts of vertices or edges in a 3D model.

  • It is particularly useful in rigging and modeling workflows where symmetrical operations are common.

Returns:

None # This function does not return a value but performs a mirror selection on the active object.

Code Examples:

>>> checkMirrorSelection()
# Performs a mirror selection on the currently selected vertex or edge.
graph TB Start[("fa:fa-play Start")] --> RetrieveSelection["/fas:fa-hand-pointer Retrieve Current Selection"] RetrieveSelection --> CheckObjectType{{"/fas:fa-code-branch Check Object Type"}} CheckObjectType --"If Vertex" --> MirrorVertexSelection["/fas:fa-dot-circle Mirror Vertex Selection"] CheckObjectType --"If Edge" --> MirrorEdgeSelection["/fas:fa-ellipsis-h Mirror Edge Selection"] MirrorVertexSelection --> End[("fas:fa-stop End")] MirrorEdgeSelection --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style RetrieveSelection fill:#ffcc00,stroke:#000,stroke-width:2px style CheckObjectType fill:#ff9999,stroke:#000,stroke-width:2px style MirrorVertexSelection fill:#99ccff,stroke:#000,stroke-width:2px style MirrorEdgeSelection fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the checkMirrorSelection function:

  1. The function begins by retrieving the current selection in the 3D modeling environment.

  2. It then checks the type of the selected object, determining whether it is a vertex or an edge.

  3. If the selection is a vertex, the function performs a mirror vertex selection, targeting the symmetrical counterpart.

  4. If the selection is an edge, the function performs a mirror edge selection, similarly targeting the symmetrical counterpart.

  5. The function concludes after executing the mirror selection based on the object type.

DeformEasy.createIsoparmRivet(self, **shArgs)#

[shArgs : bn=baseName]

Purpose:

:: Creates isoparm rivets for curve-based controls in Autodesk Maya.

  • This function facilitates the creation of rivets based on isoparms, which are useful for rigging and animation tasks.

  • It allows for naming and managing these rivets for organizational purposes.

Parameters:

baseName – <str> # Base name for creating the rivet and associated curve.

Returns:

None # This function does not return a value but creates isoparm rivets in the scene.

Code Examples:

>>> createIsoparmRivet(baseName='MyRivet')
# Creates an isoparm rivet with associated curve named 'MyRivet_Crv' and the rivet named 'MyRivet_Rivet'.
graph TB Start[("fa:fa-play Start")] --> CheckArgs{{"/fas:fa-question-circle Check Args"}} CheckArgs --"If shArgs provided" --> UpdateBaseName["/fas:fa-sync-alt Update BaseName"] CheckArgs --"If shArgs not provided" --> SetBaseName["/fas:fa-text-width Set BaseName"] UpdateBaseName --> CreateCurve["/fas:fa-bezier-curve Create Curve"] SetBaseName --> CreateCurve CreateCurve --> CheckIsoparmGrp{{"/fas:fa-layer-group Check Isoparm Grp"}} CheckIsoparmGrp --"If Isoparm Grp Exists" --> ParentCurveToGrp["/fas:fa-object-group Parent Curve to Grp"] CheckIsoparmGrp --"If Isoparm Grp Does Not Exist" --> CreateIsoparmGrp["/fas:fa-plus-square Create Isoparm Grp"] CreateIsoparmGrp --> ParentCurveToGrp ParentCurveToGrp --> CreateLocator["/fas:fa-map-pin Create Locator"] CreateLocator --> CreatePMA["/fas:fa-plus-circle Create PMA Node"] CreatePMA --> ConnectBoundingBox["/fas:fa-link Connect Bounding Box"] ConnectBoundingBox --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateBaseName fill:#99ccff,stroke:#000,stroke-width:2px style SetBaseName fill:#ff9999,stroke:#000,stroke-width:2px style CreateCurve fill:#cc99ff,stroke:#000,stroke-width:2px style CheckIsoparmGrp fill:#99ff99,stroke:#000,stroke-width:2px style ParentCurveToGrp fill:#ffcc00,stroke:#000,stroke-width:2px style CreateIsoparmGrp fill:#ff6666,stroke:#000,stroke-width:2px style CreateLocator fill:#99ff99,stroke:#000,stroke-width:2px style CreatePMA fill:#ff9999,stroke:#000,stroke-width:2px style ConnectBoundingBox fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the createIsoparmRivet function:

  1. The process begins by checking if specific arguments are provided and updates the base name accordingly.

  2. It creates a curve with the specified base name.

  3. The function checks if an Isoparm Group exists in the scene.

  4. If the Isoparm Group does not exist, it creates one.

  5. The curve is then parented to the Isoparm Group.

  6. A locator is created and named as a rivet.

  7. A Plus Minus Average (PMA) node is created to calculate the curve’s center.

  8. The bounding box of the curve is connected to the locator, positioning it at the curve’s center.

  9. The process concludes after setting up the isoparm rivet.

DeformEasy.createRivet(self, ctrlName=None, showProgress=False, **shArgs)#

[shArgs : cn=ctrlName, sp=showProgress]

Purpose:

:: Creates a rivet on a mesh vertex in Autodesk Maya, used for attaching controls to specific mesh locations.

  • This function is crucial in rigging workflows, where precise control attachment to the mesh is required.

  • It supports creating single or multiple rivets and has options for progress display and control naming.

Parameters:
  • ctrlName – <str, optional> # Name for the created control. If not provided, a default or next available name is used.

  • showProgress – <bool, optional> # Flag to display progress if set to True. Default is False.

Returns:

<list> # Returns a list of created rivet names.

Code Examples:

>>> createRivet(ctrlName='MyRivet', showProgress=True)
# Creates a rivet named 'MyRivet' and shows progress during creation.
graph TB Start[("fa:fa-play Start")] --> CheckArgs{{"/fas:fa-question-circle Check Args"}} CheckArgs --"If shArgs provided" --> SetShowProgress["/fas:fa-eye Set Show Progress"] CheckArgs --"If shArgs not provided" --> SelectVertices["/fas:fa-mouse-pointer Select Vertices"] SetShowProgress --> CheckMultipleRivets{{"/fas:fa-layer-group Check Multiple Rivets"}} SelectVertices --> CheckMultipleRivets CheckMultipleRivets --"If Multiple Rivets" --> CreateMultipleRivets["/fas:fa-plus-square Create Multiple Rivets"] CheckMultipleRivets --"If Single Rivet" --> SetCtrlPrefix["/fas:fa-text-height Set Ctrl Prefix"] CreateMultipleRivets --> ReturnMultipleRivets["/fas:fa-list-ol Return Multiple Rivets"] SetCtrlPrefix --> CreateRivetProcess["/fas:fa-hammer Create Rivet Process"] CreateRivetProcess --> CheckMirror["/fas:fa-mirror Check Mirror"] CheckMirror --"If Mirror" --> DetermineMirrorBehavior{{"/fas:fa-random Determine Mirror Behavior"}} CheckMirror --"If No Mirror" --> FinalizeRivet["/fas:fa-check-circle Finalize Rivet"] DetermineMirrorBehavior --"If Behavior 1" --> MirrorObjects["/fas:fa-mirror Mirror Objects"] DetermineMirrorBehavior --"If Behavior 2" --> PrepareMirrorTranslation["/fas:fa-arrows-alt-h Prepare Mirror Translation"] MirrorObjects --> FinalizeRivet PrepareMirrorTranslation --> AdjustOppositeRivet["/fas:fa-sliders-h Adjust Opposite Rivet"] AdjustOppositeRivet --> FinalizeRivet FinalizeRivet --> End[("fas:fa-stop End")] ReturnMultipleRivets --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style SetShowProgress fill:#99ccff,stroke:#000,stroke-width:2px style SelectVertices fill:#ff9999,stroke:#000,stroke-width:2px style CheckMultipleRivets fill:#cc99ff,stroke:#000,stroke-width:2px style CreateMultipleRivets fill:#99ff99,stroke:#000,stroke-width:2px style ReturnMultipleRivets fill:#ff9999,stroke:#000,stroke-width:2px style SetCtrlPrefix fill:#99ccff,stroke:#000,stroke-width:2px style CreateRivetProcess fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMirror fill:#99ff99,stroke:#000,stroke-width:2px style DetermineMirrorBehavior fill:#ffcc00,stroke:#000,stroke-width:2px style MirrorObjects fill:#ff6666,stroke:#000,stroke-width:2px style PrepareMirrorTranslation fill:#99ff99,stroke:#000,stroke-width:2px style AdjustOppositeRivet fill:#ff9999,stroke:#000,stroke-width:2px style FinalizeRivet fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the createRivet function:

  1. Starts by checking if arguments are provided, setting up the progress display.

  2. If no arguments given, it prompts to select mesh vertices.

  3. Determines if multiple rivets need to be created, proceeding accordingly.

  4. If creating multiple rivets, it returns the list of rivet names.

  5. For a single rivet, sets the control prefix based on the naming convention.

  6. Proceeds with the rivet creation process.

  7. Checks for mirror options and applies the selected mirroring behavior.

  8. Finalizes the rivet creation and concludes the process.

DeformEasy.detachMeshesFromClust(self, meshList=None, **shArgs)#

[shArgs : ml=meshList]

Purpose:

:: Removes a list of meshes from a specified cluster, detaching them from any associated deformation control in Autodesk Maya.

  • Facilitates the process of detaching multiple meshes from a single cluster for independent manipulation or further modifications.

  • Enhances flexibility in managing cluster-based deformations on multiple objects.

Parameters:

meshList – <list> # List of mesh objects to be detached from the cluster.

Returns:

None # This function does not return any value but updates the cluster and mesh list relationships.

Code Examples:

>>> mesh_list = ["mesh1", "mesh2", "mesh3"]
>>> detachMeshesFromClust(mesh_list)
# Detaches all meshes in the list from their associated cluster.
graph TB Start[("fa:fa-play Start")] --> ConfirmAction{{"/fas:fa-question-circle Confirm Action"}} ConfirmAction --"User confirms action" --> CheckMeshList{{"/fas:fa-check-circle Check meshList"}} ConfirmAction --"User cancels action" --> End[("fas:fa-stop End")] CheckMeshList --"If meshList Provided" --> ProcessMeshList["/fas:fa-cogs Process meshList"] CheckMeshList --"If meshList Not Provided" --> GetSelectedMeshes["/fas:fa-mouse-pointer Get Selected Meshes"] GetSelectedMeshes --> ProcessMeshList ProcessMeshList --> GetClusterName{{"/fas:fa-search-plus Get Cluster Name"}} GetClusterName --"Retrieve Cluster Name from UI" --> DetachMeshesFromCluster["/fas:fa-unlink Detach Meshes from Cluster"] DetachMeshesFromCluster --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ConfirmAction fill:#ffcc00,stroke:#000,stroke-width:2px style CheckMeshList fill:#99ff99,stroke:#000,stroke-width:2px style ProcessMeshList fill:#ff9999,stroke:#000,stroke-width:2px style GetSelectedMeshes fill:#99ccff,stroke:#000,stroke-width:2px style GetClusterName fill:#cc99ff,stroke:#000,stroke-width:2px style DetachMeshesFromCluster fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the detachMeshesFromClust function:

  1. The process starts by confirming the user’s intent to detach selected meshes from the cluster.

  2. If the user confirms, the function checks if a list of meshes is provided.

  3. If the list is not provided, it retrieves the currently selected mesh objects.

  4. The cluster name is then fetched from the user interface.

  5. The function proceeds to detach the specified meshes from the identified cluster.

  6. The process ends once all selected meshes are detached from the cluster.

DeformEasy.followSkinMeshConstrain(self, vtx=None, ibVal=0.0001, **shArgs)#

Purpose:

:: Creates a parent constraint for a vertex to follow skin mesh deformations in Autodesk Maya.

  • This function is designed to allow a locator to follow the deformations of a skinned mesh at a specified vertex.

  • It queries the skin cluster associated with the mesh and applies constraints based on the influence weights of the skinning.

Parameters:
  • vtx – <str, optional> # The vertex on the skinned mesh to be followed. If not provided, uses the first selected vertex.

  • ibVal – <float> # Influence bias value for querying skin weights, default is 0.0001.

Returns:

None # No return value; the function’s purpose is to create constraints in Maya.

Code Examples:

>>> followSkinMeshConstrain(vtx='pCube1.vtx[5]', ibVal=0.0001)
# Creates a constraint for a locator to follow the deformation at vertex 5 of 'pCube1'.
graph TB Start[("(fa:fa-play Start)")] --> GetVertex{{"/fas:fa-search-plus Get Vertex"}} GetVertex --"If vtx provided" --> UseProvidedVtx["/fas:fa-check-circle Use Provided Vertex"] GetVertex --"If vtx not provided" --> UseSelectedVtx["/fas:fa-mouse-pointer Use Selected Vertex"] UseProvidedVtx --> GetVtxMesh["/fas:fa-stream Get Vertex Mesh"] UseSelectedVtx --> GetVtxMesh GetVtxMesh --> GetSkinCluster["/fas:fa-sitemap Get Skin Cluster"] GetSkinCluster --> CheckSkinCluster{{"/fas:fa-question-circle Check Skin Cluster"}} CheckSkinCluster --"If SkinCluster Found" --> QueryWeights["/fas:fa-balance-scale Query Weights"] CheckSkinCluster --"If No SkinCluster" --> ErrorNoSkinCluster["/fas:fa-exclamation-triangle Error: No SkinCluster"] QueryWeights --> GetInfluences["/fas:fa-code-branch Get Influences"] GetInfluences --> CreateLoc["/fas:fa-map-pin Create Locator"] CreateLoc --> LoopInfluences{{"/fas:fa-repeat Loop Influences"}} LoopInfluences --> ParentConstraint["/fas:fa-link Parent Constraint"] ParentConstraint --> SetInterpType["/fas:fa-cog Set Interpolation Type"] SetInterpType --> End[("fas:fa-stop End")] ErrorNoSkinCluster --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetVertex fill:#ffcc00,stroke:#000,stroke-width:2px style UseProvidedVtx fill:#99ccff,stroke:#000,stroke-width:2px style UseSelectedVtx fill:#cc99ff,stroke:#000,stroke-width:2px style GetVtxMesh fill:#99ff99,stroke:#000,stroke-width:2px style GetSkinCluster fill:#ff9999,stroke:#000,stroke-width:2px style CheckSkinCluster fill:#ffcc00,stroke:#000,stroke-width:2px style QueryWeights fill:#99ccff,stroke:#000,stroke-width:2px style GetInfluences fill:#cc99ff,stroke:#000,stroke-width:2px style CreateLoc fill:#99ff99,stroke:#000,stroke-width:2px style LoopInfluences fill:#ff9999,stroke:#000,stroke-width:2px style ParentConstraint fill:#99ccff,stroke:#000,stroke-width:2px style SetInterpType fill:#cc99ff,stroke:#000,stroke-width:2px style ErrorNoSkinCluster fill:#ff6666,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the followSkinMeshConstrain function:

  1. The process begins by determining if a vertex is provided or using the selected vertex.

  2. The mesh of the vertex is identified, followed by obtaining the associated skin cluster.

  3. If no skin cluster is found, an error is generated.

  4. Otherwise, it queries the weights and influences of the skin cluster.

  5. A locator is created at the vertex position.

  6. The function then loops through the influences, applying a parent constraint for each.

  7. Finally, it sets the interpolation type for the parent constraint.

DeformEasy.getSculptCtrl(self, refLoc=None, meshList=None, ctrlPrefix=None, displacement=0.1, falloff=0.5, ctrlMainGrp=None, **shArgs)#

[shArgs : rl=refLoc, ml=meshList, cp=ctrlPrefix, d=displacement, f=falloff, cmg=ctrlMainGrp]

Purpose:

:: Creates sculpt deformers for the given mesh list in Autodesk Maya, providing control over the sculpting effect.

  • This function is useful for creating sculpt deformers and associated controls, allowing for dynamic sculpting on specified mesh objects.

  • It supports customizations such as prefix naming for controls, displacement intensity, and falloff distance.

Parameters:
  • refLoc – <str, optional> # The reference locator to align the sculpt control. If not provided, it uses the selected locator.

  • meshList – <list, optional> # The list of mesh objects to apply the sculpting to. Defaults to selected mesh objects if not provided.

  • ctrlPrefix – <str, optional> # The prefix for naming the sculpt control and related nodes. Defaults to ‘as_Sculpt_’.

  • displacement – <float> # The maximum displacement distance for the sculpt effect.

  • falloff – <float> # The falloff distance for the sculpt effect.

  • ctrlMainGrp – <str, optional> # The main group to which the control should be parented. Not used in the current implementation.

Returns:

None # This function does not return a value but creates sculpt deformers and controls in Maya.

Code Examples:

>>> getSculptCtrl(refLoc='locator1', meshList=['pCube1', 'pSphere1'], ctrlPrefix='MySculpt', displacement=0.2, falloff=1.0)
# Creates sculpt deformers for 'pCube1' and 'pSphere1' with custom control settings.
graph TB Start[("(fa:fa-play Start)")] --> CheckRefLoc{{"/fas:fa-question-circle Check refLoc"}} CheckRefLoc --"If refLoc provided" --> UseProvidedRefLoc["/fas:fa-check-circle Use Provided refLoc"] CheckRefLoc --"If refLoc not provided" --> UseSelectedLoc["/fas:fa-mouse-pointer Use Selected Locator"] UseProvidedRefLoc --> CheckMeshList{{"/fas:fa-question-circle Check Mesh List"}} UseSelectedLoc --> CheckMeshList CheckMeshList --"If meshList provided" --> UseProvidedMeshList["/fas:fa-check-circle Use Provided Mesh List"] CheckMeshList --"If meshList not provided" --> UseSelectedMeshes["/fas:fa-mouse-pointer Use Selected Meshes"] UseProvidedMeshList --> CheckCtrlPrefix{{"/fas:fa-question-circle Check Ctrl Prefix"}} UseSelectedMeshes --> CheckCtrlPrefix CheckCtrlPrefix --"If ctrlPrefix provided" --> UseProvidedCtrlPrefix["/fas:fa-check-circle Use Provided Ctrl Prefix"] CheckCtrlPrefix --"If ctrlPrefix not provided" --> UseDefaultCtrlPrefix["/fas:fa-undo Use Default Ctrl Prefix"] UseProvidedCtrlPrefix --> CreateSculptDeformers["/fas:fa-object-group Create Sculpt Deformers"] UseDefaultCtrlPrefix --> CreateSculptDeformers CreateSculptDeformers --> RenameSculptNodes["/fas:fa-text-height Rename Sculpt Nodes"] RenameSculptNodes --> CreateControl["/fas:fa-cogs Create Control"] CreateControl --> PositionControl["/fas:fa-arrows-alt Position Control"] PositionControl --> AddCtrlAttributes["/fas:fa-sliders-h Add Control Attributes"] AddCtrlAttributes --> ConnectAttributes["/fas:fa-link Connect Attributes to Sculpt Node"] ConnectAttributes --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckRefLoc fill:#ffcc00,stroke:#000,stroke-width:2px style UseProvidedRefLoc fill:#99ccff,stroke:#000,stroke-width:2px style UseSelectedLoc fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMeshList fill:#99ff99,stroke:#000,stroke-width:2px style UseProvidedMeshList fill:#ff9999,stroke:#000,stroke-width:2px style UseSelectedMeshes fill:#ffcc00,stroke:#000,stroke-width:2px style CheckCtrlPrefix fill:#99ccff,stroke:#000,stroke-width:2px style UseProvidedCtrlPrefix fill:#cc99ff,stroke:#000,stroke-width:2px style UseDefaultCtrlPrefix fill:#99ff99,stroke:#000,stroke-width:2px style CreateSculptDeformers fill:#ff9999,stroke:#000,stroke-width:2px style RenameSculptNodes fill:#ffcc00,stroke:#000,stroke-width:2px style CreateControl fill:#99ccff,stroke:#000,stroke-width:2px style PositionControl fill:#cc99ff,stroke:#000,stroke-width:2px style AddCtrlAttributes fill:#99ff99,stroke:#000,stroke-width:2px style ConnectAttributes fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the getSculptCtrl function:

  1. The process begins with checking if a reference locator (refLoc) is provided. If not, the selected locator is used.

  2. Next, it checks if a mesh list is provided. If not, the selected mesh objects are used.

  3. It then verifies if a control prefix (ctrlPrefix) is provided or uses a default prefix.

  4. Sculpt deformers are created for the specified mesh list.

  5. The sculpt nodes are renamed according to the provided or default prefix.

  6. A control is created and positioned according to the reference locator.

  7. Attributes for falloff and displacement are added to the control.

  8. Finally, these attributes are connected to the sculpt node, completing the setup.

DeformEasy.grpIt(self, grpObj, **shArgs)#

Purpose:

:: Groups the specified object in Autodesk Maya and sets its pivot to the world origin.

  • This function is commonly used to create a new group for a given object, resetting the group’s pivot to the world origin (0, 0, 0).

Parameters:

grpObj – <str> # The name of the object to be grouped.

Returns:

<str> # The name of the newly created group.

Code Examples:

>>> groupedObj = grpIt('pCube1')
# Groups 'pCube1' and sets its pivot to the world origin, returning the name of the new group.
graph TB Start[("(fa:fa-play Start)")] --> SelectObject["/fas:fa-mouse-pointer Select Object"] SelectObject --> CreateGroup["/fas:fa-object-group Create Group"] CreateGroup --> ResetPivot["/fas:fa-crosshairs Reset Pivot to World Origin"] ResetPivot --> RenameGroup["/fas:fa-text-height Rename Group"] RenameGroup --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style SelectObject fill:#ffcc00,stroke:#000,stroke-width:2px style CreateGroup fill:#99ccff,stroke:#000,stroke-width:2px style ResetPivot fill:#cc99ff,stroke:#000,stroke-width:2px style RenameGroup fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the grpIt function:

  1. The process starts by selecting the specified object (grpObj).

  2. A new group is created with the selected object.

  3. The pivot of the newly created group is reset to the world origin (0, 0, 0).

  4. Finally, the group is renamed to append ‘_Grp’ to the original object’s name, and the new group’s name is returned.

DeformEasy.message(self, messageTxt, **shArgs)#

[shArgs : mt=messageTxt]

Purpose:

:: Displays a message to the user through a Maya confirm dialog window.

  • Useful for providing feedback or instructions to the user during script execution.

  • Enhances user interaction and script usability by providing clear communication.

Parameters:

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

Returns:

None # This function does not return a value but displays a message window.

Code Examples:

>>> messageText = "Operation completed successfully."
>>> message(messageText)
# Displays a dialog window with the message "Operation completed successfully."
graph TB Start[("fa:fa-play Start")] --> CheckMessageTxt{{"/fas:fa-envelope-open-text Check messageTxt"}} CheckMessageTxt --"If messageTxt Provided" --> DisplayMessage["/fas:fa-comment-alt Display Message"] CheckMessageTxt --"If messageTxt Not Provided" --> FetchMessageTxt["/fas:fa-envelope-open Fetch Message Text"] FetchMessageTxt --> DisplayMessage DisplayMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMessageTxt fill:#ffcc00,stroke:#000,stroke-width:2px style DisplayMessage fill:#99ccff,stroke:#000,stroke-width:2px style FetchMessageTxt fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the message function:

  1. The process begins by checking if the message text is provided.

  2. If the message text is not provided, the function prompts the user to input the message text.

  3. Once the message text is confirmed, the function displays it in a Maya confirm dialog window.

DeformEasy.mirrorClust(self, clustHand=None, srcWord='L_', repWord='R_', **shArgs)#

[shArgs : ch=clustHand, sw=srcWord, rw=repWord]

Purpose:

:: Mirrors the weights of a specified cluster handle from one side of a model to the other.

  • This function is particularly useful in rigging processes, ensuring symmetrical deformation on both sides of a character or object.

  • Automates the weight mirroring process, saving time and increasing accuracy.

Parameters:
  • clustHand – <str> # The cluster handle whose weights need to be mirrored.

  • srcWord – <str> # The prefix or naming convention of the source side (e.g., ‘L_’ for left).

  • repWord – <str> # The prefix or naming convention of the target side (e.g., ‘R_’ for right).

Returns:

None # This function does not return a value but mirrors cluster weights.

Code Examples:

>>> clusterHandle = "L_arm_Cluster"
>>> sourceWord = "L_"
>>> replaceWord = "R_"
>>> mirrorClust(clusterHandle, sourceWord, replaceWord)
# Mirrors the weights of the 'L_arm_Cluster' from the left to the right side.
graph TB Start[("fa:fa-play Start")] --> CheckClustHand{{"/fas:fa-question-circle Check clustHand"}} CheckClustHand --"If clustHand Provided" --> SetPrefixes["/fas:fa-text-width Set Prefixes"] CheckClustHand --"If clustHand Not Provided" --> SelectClustHand["/fas:fa-mouse-pointer Select clustHand"] SetPrefixes --> GetVtxWeights["/fas:fa-balance-scale Get Vertex Weights"] SelectClustHand --> GetVtxWeights GetVtxWeights --> CheckPrefixes{{"/fas:fa-code-branch Check Prefixes"}} CheckPrefixes --"If LPrefix & RPrefix" --> SelectMirrorVertices["/fas:fa-hand-pointer Select Mirrored Vertices"] CheckPrefixes --"No Prefixes" --> MirrorWithoutPrefixes["/fas:fa-exchange-alt Mirror Without Prefixes"] SelectMirrorVertices --> CreateOppositeCluster["/fas:fa-sitemap Create Opposite Cluster"] MirrorWithoutPrefixes --> CreateOppositeCluster CreateOppositeCluster --> ApplyWeightsToOppCluster["/fas:fa-arrow-right Apply Weights to Opposite Cluster"] ApplyWeightsToOppCluster --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckClustHand fill:#ffcc00,stroke:#000,stroke-width:2px style SetPrefixes fill:#99ccff,stroke:#000,stroke-width:2px style SelectClustHand fill:#99ff99,stroke:#000,stroke-width:2px style GetVtxWeights fill:#ff9999,stroke:#000,stroke-width:2px style CheckPrefixes fill:#cc99ff,stroke:#000,stroke-width:2px style SelectMirrorVertices fill:#99ccff,stroke:#000,stroke-width:2px style MirrorWithoutPrefixes fill:#99ff99,stroke:#000,stroke-width:2px style CreateOppositeCluster fill:#cc99ff,stroke:#000,stroke-width:2px style ApplyWeightsToOppCluster fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mirrorClust function:

  1. The function starts by checking if a cluster handle is provided. If not, it prompts the user to select one.

  2. It sets the left and right side prefixes for identifying the mirror side.

  3. The function retrieves the weights of vertices affected by the cluster.

  4. Based on the prefixes, it selects mirrored vertices on the opposite side of the model.

  5. A new cluster is created for the mirrored vertices, mirroring the original cluster’s setup.

  6. The weights from the original cluster are then applied to the vertices of the opposite cluster.

DeformEasy.mirrorCtrlRivet(self, **shArgs)#

[shArgs : lr=LRivet, lp=LPrefix, rp=RPrefix, pa=primaryAxis, sa=secondaryAxis, mb=mirrBehavior]

Purpose:

:: Mirrors control rivets from one side of a character to the other in Autodesk Maya.

  • This function is used in character rigging to create symmetrical control setups, particularly for rivets.

  • It supports various mirroring behaviors and axis configurations, making it versatile for different rigging needs.

Parameters:
  • LRivet – <str> # The rivet control to be mirrored.

  • LPrefix – <str> # The prefix for left side naming conventions.

  • RPrefix – <str> # The prefix for right side naming conventions.

  • primaryAxis – <str> # The primary axis for mirroring.

  • secondaryAxis – <str> # The secondary axis for additional alignment.

  • mirrBehavior – <int> # The mirroring behavior type (e.g., 1 for rotate, 2 for translate).

Returns:

None # This function does not return a value but mirrors rivet controls in the scene.

Code Examples:

>>> mirrorCtrlRivet(LRivet='leftRivet', LPrefix='L_', RPrefix='R_', primaryAxis='X-Axis', secondaryAxis='Y-Axis', mirrBehavior=1)
# Mirrors the 'leftRivet' control to the right side with specified axis settings and behavior.
graph TB Start[("fa:fa-play Start")] --> CheckArgs{{"/fas:fa-question-circle Check Args"}} CheckArgs --"If shArgs provided" --> UpdateRivetInfo["/fas:fa-sync-alt Update Rivet Info"] CheckArgs --"If shArgs not provided" --> SelectRivet["/fas:fa-mouse-pointer Select Rivet"] UpdateRivetInfo --> SetPrefixes["/fas:fa-text-width Set Prefixes"] SelectRivet --> SetPrefixes SetPrefixes --> SetAxis["/fas:fa-arrows-alt Set Axis"] SetAxis --> DetermineMirrorBehavior{{"/fas:fa-random Determine Mirror Behavior"}} DetermineMirrorBehavior --"If Behavior 1" --> MirrorObjects["/fas:fa-mirror Mirror Objects"] DetermineMirrorBehavior --"If Behavior 2" --> PrepareMirrorTranslation["/fas:fa-arrows-alt-h Prepare Mirror Translation"] MirrorObjects --> SelectOppositeRivet["/fas:fa-search-plus Select Opposite Rivet"] PrepareMirrorTranslation --> AdjustOppositeRivet["/fas:fa-sliders-h Adjust Opposite Rivet"] AdjustOppositeRivet --> SelectOppositeRivet SelectOppositeRivet --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckArgs fill:#ffcc00,stroke:#000,stroke-width:2px style UpdateRivetInfo fill:#99ccff,stroke:#000,stroke-width:2px style SelectRivet fill:#ff9999,stroke:#000,stroke-width:2px style SetPrefixes fill:#cc99ff,stroke:#000,stroke-width:2px style SetAxis fill:#99ff99,stroke:#000,stroke-width:2px style DetermineMirrorBehavior fill:#ffcc00,stroke:#000,stroke-width:2px style MirrorObjects fill:#ff6666,stroke:#000,stroke-width:2px style PrepareMirrorTranslation fill:#99ff99,stroke:#000,stroke-width:2px style AdjustOppositeRivet fill:#ff9999,stroke:#000,stroke-width:2px style SelectOppositeRivet fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the mirrorCtrlRivet function:

  1. Begins by checking if arguments are provided and updates the rivet information accordingly.

  2. If no arguments are given, it prompts to select a rivet.

  3. Sets the prefixes based on left and right naming conventions.

  4. Defines the primary and secondary axes for mirroring.

  5. Determines the mirroring behavior, choosing between object mirroring or translation adjustment.

  6. If mirroring objects (Behavior 1), it executes the mirror operation.

  7. If adjusting translation (Behavior 2), it prepares and adjusts the opposite rivet accordingly.

  8. Finally, selects the opposite rivet and concludes the process.

DeformEasy.move_SDKValues(self, ctrlList=None, **shArgs)#

[shArgs : cl=ctrlList]

Purpose:

:: Moves specified SDK (Set Driven Key) values from one attribute to another on a list of control objects.

  • This function is useful in rigging scenarios where SDK values need to be transferred between different attributes.

  • It supports a predefined dictionary mapping for attributes.

  • The function can operate on a given list of controls or default to the currently selected objects in Maya.

  • It adjusts the original and target attributes for each control based on the mapping in sdkDict.

  • Attributes ‘sx’, ‘sy’, ‘sz’ are treated differently to maintain scaling consistency.

Parameters:

ctrlList – <list> # List of control nodes to apply SDK value transfers. Defaults to currently selected objects if not provided.

Returns:

None # This function performs an operation on control objects and does not return any value.

Code Examples:

>>> control_list = ["ctrl1", "ctrl2", "ctrl3"]
>>> move_SDKValues(control_list)
# Transfers SDK values for each control in 'control_list' according to the predefined attribute mapping.
graph TB Start[("(fa:fa-play Start)")] --> CheckControlList{{"/fas:fa-question-circle Check Control List"}} CheckControlList --"If Control List Provided" --> UseProvidedCtrlList["/fas:fa-check-circle Use Provided Control List"] CheckControlList --"If No Control List" --> UseSelectedCtrlList["/fas:fa-check-circle Use Selected Control List"] UseProvidedCtrlList --> LoopThroughControls{{"/fas:fa-repeat Loop Through Controls"}} UseSelectedCtrlList --> LoopThroughControls LoopThroughControls --> LoopThroughAttributes{{"/fas:fa-repeat Loop Through Attributes"}} LoopThroughAttributes --> GetSourceValue["/fas:fa-arrow-up Get Source Value"] GetSourceValue --> CheckScaleAttrs{{"/fas:fa-question-circle Check if Scale Attribute"}} CheckScaleAttrs --"Not Scale Attribute" --> TransferSDKValue["/fas:fa-exchange-alt Transfer SDK Value"] CheckScaleAttrs --"Scale Attribute" --> AdjustScaleValue["/fas:fa-compress-arrows-alt Adjust Scale Value"] TransferSDKValue --> ResetSourceAttr["/fas:fa-undo Reset Source Attribute"] AdjustScaleValue --> ResetScaleAttr["/fas:fa-undo Reset Scale Attribute"] ResetSourceAttr --> EndLoopAttributes{{"/fas:fa-circle-notch End Loop Attributes"}} ResetScaleAttr --> EndLoopAttributes EndLoopAttributes --"End of Attributes" --> EndLoopControls{{"/fas:fa-circle-notch End Loop Controls"}} EndLoopControls --"End of Controls" --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckControlList fill:#ffcc00,stroke:#000,stroke-width:2px style UseProvidedCtrlList fill:#99ccff,stroke:#000,stroke-width:2px style UseSelectedCtrlList fill:#cc99ff,stroke:#000,stroke-width:2px style LoopThroughControls fill:#99ff99,stroke:#000,stroke-width:2px style LoopThroughAttributes fill:#ff9999,stroke:#000,stroke-width:2px style GetSourceValue fill:#ffcc00,stroke:#000,stroke-width:2px style CheckScaleAttrs fill:#99ccff,stroke:#000,stroke-width:2px style TransferSDKValue fill:#cc99ff,stroke:#000,stroke-width:2px style AdjustScaleValue fill:#99ff99,stroke:#000,stroke-width:2px style ResetSourceAttr fill:#ff9999,stroke:#000,stroke-width:2px style ResetScaleAttr fill:#ffcc00,stroke:#000,stroke-width:2px style EndLoopAttributes fill:#99ccff,stroke:#000,stroke-width:2px style EndLoopControls fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the move_SDKValues function:

  1. The process starts by checking if a control list is provided. If not, it uses the selected controls.

  2. It then loops through each control in the list.

  3. For each control, the function loops through the attributes defined in sdkDict.

  4. The source value for each attribute is retrieved.

  5. The function checks if the attribute is a scale attribute (sx, sy, sz).

  6. If it’s not a scale attribute, the SDK value is transferred and the source attribute is reset to 0.

  7. If it’s a scale attribute, the value is adjusted accordingly and the scale attribute is reset to 1.

  8. This process repeats for all attributes and all controls in the list.

DeformEasy.old_rivet(self)#
DeformEasy.refreshView(self, num, **shArgs)#

[shArgs : ]

Purpose:

:: Refreshes the Maya view a specified number of times.

  • This function is primarily used to update the Maya viewport.

  • It is useful in scripts where the changes are not immediately visible in the viewport.

  • The function calls the Maya command ‘refresh -cv’ to redraw the viewport.

  • Users can specify the number of times the viewport should be refreshed.

  • It improves the user experience by ensuring that changes made by scripts are reflected in the viewport.

Parameters:

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

Returns:

None # This function only refreshes the view and does not return any value.

Code Examples:

>>> refreshView(3)
# Refreshes the Maya viewport three times.
graph TB Start[("(fa:fa-play Start)")] --> CheckNum{{"/fas:fa-question Check Number"}} CheckNum --"If Number Provided" --> LoopRefresh["/fas:fa-repeat Loop Refresh"] CheckNum --"If No Number Provided" --> End[("fas:fa-stop End")] LoopRefresh --> RefreshCmd["/fas:fa-sync-alt Execute Refresh Command"] RefreshCmd --"Repeat for Specified Number" --> LoopRefresh LoopRefresh --"After Completing Loops" --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckNum fill:#ffcc00,stroke:#000,stroke-width:2px style LoopRefresh fill:#ff9999,stroke:#000,stroke-width:2px style RefreshCmd fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the refreshView function:

  1. The function begins by checking if a number of refresh iterations is provided.

  2. If a number is provided, the function enters a loop to refresh the Maya viewport.

  3. Within the loop, the Maya command ‘refresh -cv’ is executed to redraw the viewport.

  4. The process repeats for the specified number of iterations.

  5. If no number is provided, the function ends without performing any action.

DeformEasy.restrictedZone_DeformEasy(self, **shArgs)#

Purpose:

:: Displays a message indicating restricted access or work-in-progress features in the ‘DeformEasy’ tool in Autodesk Maya.

  • This function serves as a placeholder for future updates or restricted areas within the ‘DeformEasy’ tool.

  • It opens a web page and displays a message to the user regarding the unavailability of certain features.

Returns:

None # This function does not return a value but opens a web page and shows a message to the user.

Code Examples:

>>> restrictedZone_DeformEasy()
# Opens a web page and displays a message about restricted or WIP features in 'DeformEasy'.
graph TB Start[("fa:fa-play Start")] --> OpenWebPage["/fas:fa-globe-americas Open Web Page"] OpenWebPage --> DisplayMessage["/fas:fa-exclamation-triangle Display Restricted Message"] DisplayMessage --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style OpenWebPage fill:#99ccff,stroke:#000,stroke-width:2px style DisplayMessage fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the restrictedZone_DeformEasy function:

  1. The function initiates by opening a specific web page (’http://www.pythonscripting.com/’).

  2. It then displays a message to the user about restricted or work-in-progress features in the ‘DeformEasy’ tool.

  3. The process concludes after showing the message to the user.

DeformEasy.rivet(self, vtx=None, grpLevel=1, name='as_Rivet', showProgress=False, **shArg)#

[shArgs : v=vtx, gl=grpLevel, n=name, sp=showProgress]

Purpose:

:: Creates a rivet at a specified vertex on a mesh and optionally groups it at a specified level.

  • Useful for attaching objects or controls to specific points on a mesh.

  • Allows for dynamic movement of attached objects with the deformation of the mesh.

Parameters:
  • vtx – <str> # Vertex where the rivet is to be created.

  • grpLevel – <int> # Grouping level for the rivet’s locator node.

  • name – <str> # Name for the rivet and its associated nodes.

  • showProgress – <bool> # Whether to show progress during the rivet creation process.

Returns:

<list> # A list containing the locator node, and optionally the group node if grpLevel is specified.

Code Examples:

>>> vertex = "pCube1.vtx[5]"
>>> groupLevel = 2
>>> rivetName = "myRivet"
>>> showProg = True
>>> rivetNodes = rivet(vertex, groupLevel, rivetName, showProg)
# Creates a rivet on the specified vertex of 'pCube1' and returns the locator and group nodes.

Returns:

if grpLevel:
        return [loc, grpNode]   #_ asNodes
else:
        return [loc]                    #_ asNode
graph TB Start[("fa:fa-play Start")] --> CheckVtx{{"/fas:fa-question-circle Check vtx"}} CheckVtx --"If vtx Provided" --> CreateLocator["/fas:fa-map-marker-alt Create Locator"] CheckVtx --"If vtx Not Provided" --> SelectVertex["/fas:fa-mouse-pointer Select Vertex"] SelectVertex --> CreateLocator CreateLocator --> CheckGroupLevel{{"/fas:fa-layer-group Check grpLevel"}} CheckGroupLevel --"If grpLevel" --> GroupLocator["/fas:fa-object-group Group Locator"] CheckGroupLevel --"If No grpLevel" --> SkipGrouping GroupLocator --> ApplyConstraints["/fas:fa-link Apply Constraints"] SkipGrouping --> ApplyConstraints ApplyConstraints --> CheckMayaVersion{{"/fas:fa-code-branch Check Maya Version"}} CheckMayaVersion --"Maya 2018+" --> PointOnPoly2018["/fas:fa-dot-circle PointOnPoly Constraint (2018+)"] CheckMayaVersion --"Pre-2018" --> PointOnPolyPre2018["/fas:fa-dot-circle PointOnPoly Constraint (Pre-2018)"] PointOnPoly2018 --> AttachButtons["/fas:fa-toggle-on Attach Buttons"] PointOnPolyPre2018 --> AttachButtons AttachButtons --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckVtx fill:#ffcc00,stroke:#000,stroke-width:2px style CreateLocator fill:#99ccff,stroke:#000,stroke-width:2px style SelectVertex fill:#99ff99,stroke:#000,stroke-width:2px style CheckGroupLevel fill:#cc99ff,stroke:#000,stroke-width:2px style GroupLocator fill:#99ccff,stroke:#000,stroke-width:2px style SkipGrouping fill:#99ff99,stroke:#000,stroke-width:2px style ApplyConstraints fill:#cc99ff,stroke:#000,stroke-width:2px style CheckMayaVersion fill:#99ccff,stroke:#000,stroke-width:2px style PointOnPoly2018 fill:#99ff99,stroke:#000,stroke-width:2px style PointOnPolyPre2018 fill:#cc99ff,stroke:#000,stroke-width:2px style AttachButtons fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the rivet function:

  1. The process begins by checking if a vertex is provided. If not, the user is prompted to select a vertex.

  2. A locator node is created and named based on the function parameters.

  3. The function checks if a grouping level is specified and groups the locator accordingly.

  4. Constraints are applied to the locator based on the selected vertex’s position.

  5. The Maya version is checked to apply the appropriate PointOnPoly constraint method.

  6. Additional buttons or controls are attached to the locator for user interaction.

  7. The function returns a list containing the locator, and optionally the group node if specified.

DeformEasy.selectCurrentVtx(self, **shArgs)#

[shArgs : ]

Purpose:

:: Selects the current vertex or vertices stored in a global list.

  • This function is used to reselect vertices that have been previously stored in a global list.

  • It is useful in scripts where vertex selections need to be remembered and reselected later.

  • The function relies on a global variable ‘currentVtxList’ that stores the vertex names.

  • It is particularly handy in complex rigging or modeling operations where specific vertices are frequently accessed.

  • The function simplifies the process of reselecting vertices, improving workflow efficiency.

Returns:

None # This function only changes the selection and does not return any value.

Code Examples:

>>> selectCurrentVtx()
# Reselects vertices stored in 'currentVtxList'.
graph TB Start[("(fa:fa-play Start)")] --> CheckGlobalVar{{"/fas:fa-globe-americas Check Global Variable"}} CheckGlobalVar --"currentVtxList Exists" --> SelectVertices["/fas:fa-object-group Select Vertices"] CheckGlobalVar --"currentVtxList Not Exists" --> End[("fas:fa-stop End")] SelectVertices --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckGlobalVar fill:#ffcc00,stroke:#000,stroke-width:2px style SelectVertices fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the selectCurrentVtx function:

  1. The process starts by checking if the global variable currentVtxList exists.

  2. If currentVtxList exists, the function selects the vertices stored in this list.

  3. If currentVtxList does not exist, the function ends without changing the selection.

DeformEasy.selectTrgtVtxList(self, **shArgs)#

[shArgs : ]

Purpose:

:: Selects a target list of vertices based on the current selection and predefined criteria.

  • This function is intended for advanced vertex selection based on specific conditions.

  • It first identifies the target mesh from the current selection.

  • The function then applies custom criteria to select vertices from the target mesh.

  • This might include selecting vertices based on proximity, attributes, or other factors.

  • It’s particularly useful in rigging, modeling, and other scenarios where precise vertex selection is required.

Returns:

None # This function changes the selection but does not return any value.

Code Examples:

>>> selectTrgtVtxList()
# Selects vertices on the target mesh based on predefined criteria.
graph TB Start[("(fa:fa-play Start)")] --> GetTrgtMesh["/fas:fa-cube Get Target Mesh"] GetTrgtMesh --> SelectClusterVertices["/fas:fa-network-wired Select Cluster Vertices"] SelectClusterVertices --> GetNearestVertices["/fas:fa-crosshairs Get Nearest Vertices"] GetNearestVertices --> GrowSelection["/fas:fa-expand-arrows-alt Grow Selection"] GrowSelection --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetTrgtMesh fill:#ff9999,stroke:#000,stroke-width:2px style SelectClusterVertices fill:#99ccff,stroke:#000,stroke-width:2px style GetNearestVertices fill:#cc99ff,stroke:#000,stroke-width:2px style GrowSelection fill:#99ff99,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the selectTrgtVtxList function:

  1. The process begins by obtaining the target mesh from the current selection.

  2. It then selects cluster vertices with a specific proximity threshold.

  3. The function proceeds to find the nearest vertices from the bounding box of the selected cluster.

  4. The selection is then grown using the GrowPolygonSelectionRegion command.

  5. The process concludes once the target vertices are selected.

DeformEasy.select_CtrlsFromTF(self, textFld, btnName=None, multiSelect=1, directSelect=0, **shArgs)#

[shArgs : ]

Purpose:

:: Selects control objects based on names entered in a specified text field.

  • This function aids in selecting Maya control objects (usually part of a rig) using a text field input.

  • It reads the control names from the text field and selects the corresponding controls in Maya.

  • The function supports both single and multiple control selections.

  • It’s particularly useful in animation and rigging scripts where selecting numerous controls can be time-consuming.

  • Additionally, the function can update button states based on the current selection.

Parameters:
  • textFld – <str> # Name of the text field containing control names.

  • btnName – <str, optional> # Name of the button to update its state. Default is None.

  • multiSelect – <bool> # Whether to allow multiple control selections. Default is True.

  • directSelect – <bool> # Whether to select the controls directly. Default is False.

Returns:

None # This function changes the selection but does not return any value.

Code Examples:

>>> select_CtrlsFromTF('controlNameTextField')
# Selects controls based on names in 'controlNameTextField'.
graph TB Start[("(fa:fa-play Start)")] --> ReadTextField["/fas:fa-keyboard Read Text Field"] ReadTextField --> CheckComma["/fas:fa-search-plus Check Comma in Text"] CheckComma --"If Comma Present" --> SplitText["/fas:fa-cut Split Text"] CheckComma --"No Comma" --> SingleCtrl["/fas:fa-mouse-pointer Single Control"] SplitText --> ConvertToNodes["/fas:fa-code Convert to Nodes"] SingleCtrl --> ConvertToNode["/fas:fa-code-branch Convert to Node"] ConvertToNodes --> CheckDirectSelect{{"/fas:fa-question-circle Check Direct Select"}} ConvertToNode --> CheckDirectSelect CheckDirectSelect --"If Direct Select" --> DirectSelectCtrls["/fas:fa-mouse-pointer Direct Select Controls"] CheckDirectSelect --"If Not Direct Select" --> GenerateCtrlList["/fas:fa-list-ul Generate Control List"] DirectSelectCtrls --> End[("fas:fa-stop End")] GenerateCtrlList --> SelectCtrls["/fas:fa-mouse-pointer Select Controls"] SelectCtrls --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style ReadTextField fill:#ff9999,stroke:#000,stroke-width:2px style CheckComma fill:#99ccff,stroke:#000,stroke-width:2px style SplitText fill:#cc99ff,stroke:#000,stroke-width:2px style SingleCtrl fill:#99ff99,stroke:#000,stroke-width:2px style ConvertToNodes fill:#ffcc00,stroke:#000,stroke-width:2px style ConvertToNode fill:#ff9999,stroke:#000,stroke-width:2px style CheckDirectSelect fill:#99ccff,stroke:#000,stroke-width:2px style DirectSelectCtrls fill:#cc99ff,stroke:#000,stroke-width:2px style GenerateCtrlList fill:#99ff99,stroke:#000,stroke-width:2px style SelectCtrls fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the select_CtrlsFromTF function:

  1. The process starts by reading the content of the specified text field.

  2. It checks for the presence of a comma to determine if multiple controls are listed.

  3. If a comma is present, it splits the text into individual control names.

  4. Each control name is then converted to a node.

  5. The function checks if direct selection is enabled.

  6. If direct selection is enabled, it directly selects the controls.

  7. If not, it generates a list of control nodes based on the cluster names.

  8. Finally, it selects the controls in Maya based on the generated list.

DeformEasy.snapPivot(self, src, dest, **shArgs)#

Purpose:

:: Snaps the pivot of a source object to match the position of a destination object in Autodesk Maya.

  • This function is useful for aligning the pivot point of one object to the position of another, aiding in transformations and alignments.

Parameters:
  • src – <str> # The source object whose pivot is to be aligned.

  • dest – <str> # The destination object whose position will be used for alignment.

Returns:

None # This function does not return a value but adjusts the pivot of the source object.

Code Examples:

>>> snapPivot('pCube1', 'pSphere1')
# Aligns the pivot of 'pCube1' to the position of 'pSphere1'.
graph TB Start[("fa:fa-play Start")] --> GetDestPos["/fas:fa-crosshairs Get Dest Position"] GetDestPos --> AlignPivots["/fas:fa-arrows-alt Move to Align Pivots"] AlignPivots --> End[("fas:fa-stop End")] style Start fill:#00cc00,stroke:#000,stroke-width:3px style GetDestPos fill:#99ccff,stroke:#000,stroke-width:2px style AlignPivots fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the snapPivot function:

  1. The process starts by obtaining the position of the destination object (dest).

  2. It then aligns the pivot points of the source object (src) to the position of the destination object.

  3. The function concludes after adjusting the pivot of the source object.

DeformEasy.updateOptions_UI(self, **shArgs)#

Purpose:

:: Manages the UI options for mirroring controls in the ‘as_DeformEasy’ tool in Autodesk Maya.

  • This function is responsible for updating the UI elements related to control mirroring options based on the state of the ‘as_MirrorClust_CB’ checkbox.

  • It dynamically adjusts the ‘optCtrlLoc’ option menu and the ‘as_MirrorBehavior_RGB’ radio button group based on the user’s selection.

Returns:

None # This function does not return a value but updates UI elements in Maya.

Code Examples:

>>> updateOptions_UI()
# Updates the mirroring control options in the 'as_DeformEasy' UI based on user interaction.
graph TB Start[("(fa:fa-play Start)")] --> CheckMirrorCheckbox{{"/fas:fa-question-circle Check Mirror Checkbox"}} CheckMirrorCheckbox --"If Checked" --> EnableOptions["/fas:fa-toggle-on Enable Options"] CheckMirrorCheckbox --"If Not Checked" --> DisableOptions["/fas:fa-toggle-off Disable Options"] EnableOptions --> SetDefaultLeft["/fas:fa-arrow-alt-circle-left Set Default to 'Left'"] EnableOptions --> EnableRadioButtons["/fas:fa-dot-circle Enable Radio Buttons"] DisableOptions --> SetDefaultNone["/fas:fa-circle-notch Set Default to 'None'"] DisableOptions --> DisableRadioButtons["/fas:fa-circle Disable Radio Buttons"] SetDefaultLeft --> End[("fas:fa-stop End")] EnableRadioButtons --> End SetDefaultNone --> End DisableRadioButtons --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckMirrorCheckbox fill:#ffcc00,stroke:#000,stroke-width:2px style EnableOptions fill:#99ccff,stroke:#000,stroke-width:2px style DisableOptions fill:#cc99ff,stroke:#000,stroke-width:2px style SetDefaultLeft fill:#99ff99,stroke:#000,stroke-width:2px style EnableRadioButtons fill:#ff9999,stroke:#000,stroke-width:2px style SetDefaultNone fill:#ffcc00,stroke:#000,stroke-width:2px style DisableRadioButtons fill:#99ccff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the updateOptions_UI function:

  1. The process starts by checking the state of the ‘as_MirrorClust_CB’ checkbox.

  2. If the checkbox is checked, the options menu is set to default ‘Left’, and the radio buttons are enabled.

  3. If the checkbox is not checked, the options menu defaults to ‘None’, and the radio buttons are disabled.

  4. This function ensures that the mirroring options in the ‘as_DeformEasy’ UI are updated dynamically based on user interaction, enhancing usability.

DeformEasy.update_BakeDeformer_FL(self, action=None, **shArgs)#

[shArgs : a=action]

Purpose:

:: Manages the opening and closing of the ‘as_BakeClust_FL’ frame layout in Autodesk Maya, adjusting its height and visibility based on the provided action.

  • This function is essential for dynamically updating the user interface, especially for the bake deformer frame layout in Maya.

  • Additionally, it coordinates the visibility of other UI sections, specifically ‘as_WorkboxPaint_FL’, ensuring a streamlined and uncluttered UI experience.

Parameters:

action – <str, optional> # The action to be performed on the frame layout. Accepts ‘close’ to collapse, ‘open’ to expand, or None to toggle its state.

Returns:

None # This function does not return a value; its purpose is to update the UI elements in Maya.

Code Examples:

>>> update_action = "open"
>>> update_BakeDeformer_FL(update_action)
# Expands and opens the 'as_BakeClust_FL' frame layout.

>>> update_action = "close"
>>> update_BakeDeformer_FL(update_action)
# Collapses and closes the 'as_BakeClust_FL' frame layout.
graph TB Start[("(fa:fa-play Start)")] --> CheckAction{{"/fas:fa-question-circle Check Action"}} CheckAction --"If 'close'" --> CloseBakeDeformerFL["/fas:fa-minus-square Close BakeDeformer FrameLayout"] CheckAction --"If 'open'" --> OpenBakeDeformerFL["/fas:fa-plus-square Open BakeDeformer FrameLayout"] CheckAction --"If None or Other" --> ToggleBakeDeformerFL{{"/fas:fa-exchange-alt Toggle BakeDeformer FrameLayout"}} CloseBakeDeformerFL --> AdjustWindowHeightClose["/fas:fa-compress-arrows-alt Adjust Window Height (Close)"] OpenBakeDeformerFL --> AdjustWindowHeightOpen["/fas:fa-expand-arrows-alt Adjust Window Height (Open)"] ToggleBakeDeformerFL --"If Currently Closed" --> OpenBakeDeformerFL ToggleBakeDeformerFL --"If Currently Open" --> CloseBakeDeformerFL AdjustWindowHeightClose --> End[("fas:fa-stop End")] AdjustWindowHeightOpen --> CheckOtherSections{{"/fas:fa-tasks Check Other Sections"}} CheckOtherSections --> CloseOtherSections["/fas:fa-minus-square Close Other Sections"] CloseOtherSections --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAction fill:#ffcc00,stroke:#000,stroke-width:2px style CloseBakeDeformerFL fill:#99ccff,stroke:#000,stroke-width:2px style OpenBakeDeformerFL fill:#cc99ff,stroke:#000,stroke-width:2px style ToggleBakeDeformerFL fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightClose fill:#ff9999,stroke:#000,stroke-width:2px style AdjustWindowHeightOpen fill:#ffcc00,stroke:#000,stroke-width:2px style CheckOtherSections fill:#99ccff,stroke:#000,stroke-width:2px style CloseOtherSections fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_BakeDeformer_FL function:

  1. The process starts by checking the action (‘close’, ‘open’, or None).

  2. If ‘close’, it collapses the BakeDeformer FrameLayout and adjusts the window height.

  3. If ‘open’, it expands the BakeDeformer FrameLayout and adjusts the window height.

  4. If None or other, it toggles the BakeDeformer FrameLayout’s state and adjusts the window height accordingly.

  5. Additionally, if opening the BakeDeformer FrameLayout, the function checks and closes the WorkboxPaint section.

DeformEasy.update_ClusterInfo_FL(self, action=None, **shArgs)#

[shArgs : a=action]

Purpose:

:: Manages the opening and closing of the ‘as_ClusterInfo_FL’ frame layout in Autodesk Maya, adjusting its height and collapse state based on the action.

  • This function is vital for dynamically updating the user interface, specifically for the cluster information frame layout within Maya.

  • It also coordinates the state of other UI sections such as ‘as_MeshInfo_FL’, ‘as_RigInfo_FL’, and ‘as_CreateClust_FL’ in accordance with the state of ‘as_ClusterInfo_FL’.

Parameters:

action – <str, optional> # The action to be executed on the frame layout. It accepts ‘close’ to collapse, ‘open’ to expand, or None to toggle the state.

Returns:

None # No return value, as the primary function is to update UI elements in Maya.

Code Examples:

>>> update_action = "open"
>>> update_ClusterInfo_FL(update_action)
# Expands and opens the 'as_ClusterInfo_FL' frame layout.

>>> update_action = "close"
>>> update_ClusterInfo_FL(update_action)
# Collapses and closes the 'as_ClusterInfo_FL' frame layout.
graph TB Start[("(fa:fa-play Start)")] --> CheckAction{{"/fas:fa-question-circle Check Action"}} CheckAction --"If 'close'" --> CloseClusterInfoFL["/fas:fa-minus-square Close ClusterInfo FrameLayout"] CheckAction --"If 'open'" --> OpenClusterInfoFL["/fas:fa-plus-square Open ClusterInfo FrameLayout"] CheckAction --"If None or Other" --> ToggleClusterInfoFL{{"/fas:fa-exchange-alt Toggle ClusterInfo FrameLayout"}} CloseClusterInfoFL --> AdjustWindowHeightClose["/fas:fa-compress-arrows-alt Adjust Window Height (Close)"] OpenClusterInfoFL --> AdjustWindowHeightOpen["/fas:fa-expand-arrows-alt Adjust Window Height (Open)"] ToggleClusterInfoFL --"If Currently Closed" --> OpenClusterInfoFL ToggleClusterInfoFL --"If Currently Open" --> CloseClusterInfoFL AdjustWindowHeightClose --> End[("fas:fa-stop End")] AdjustWindowHeightOpen --> CheckOtherSections{{"/fas:fa-tasks Check Other Sections"}} CheckOtherSections --> CloseOtherSections["/fas:fa-minus-square Close Other Sections"] CloseOtherSections --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAction fill:#ffcc00,stroke:#000,stroke-width:2px style CloseClusterInfoFL fill:#99ccff,stroke:#000,stroke-width:2px style OpenClusterInfoFL fill:#cc99ff,stroke:#000,stroke-width:2px style ToggleClusterInfoFL fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightClose fill:#ff9999,stroke:#000,stroke-width:2px style AdjustWindowHeightOpen fill:#ffcc00,stroke:#000,stroke-width:2px style CheckOtherSections fill:#99ccff,stroke:#000,stroke-width:2px style CloseOtherSections fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_ClusterInfo_FL function:

  1. The process begins by determining the action (‘close’, ‘open’, or None).

  2. If ‘close’, it collapses the ClusterInfo FrameLayout and adjusts the window height.

  3. If ‘open’, it expands the ClusterInfo FrameLayout and adjusts the window height.

  4. If None or other, it toggles the ClusterInfo FrameLayout’s state and adjusts the window height accordingly.

  5. Additionally, if opening the ClusterInfo FrameLayout, the function checks and closes other sections like MeshInfo, RigInfo, and CreateClust.

DeformEasy.update_CreateClust_FL(self, action=None, **shArgs)#

[shArgs : a=action]

Purpose:

:: Manages the opening and closing of the ‘as_CreateClust_FL’ frame layout in Autodesk Maya, adjusting its size based on the action parameter.

  • This function is integral to the user interface dynamics in Maya, specifically for handling the create cluster frame layout.

  • It also controls the state of other UI sections like ‘as_ClusterInfo_FL’, ‘as_MeshInfo_FL’, and ‘as_RigInfo_FL’, ensuring a clean and organized workspace.

Parameters:

action – <str, optional> # The action to be executed on the frame layout. It can be ‘close’ to collapse, ‘open’ to expand, or None to toggle its state.

Returns:

None # No return value; the function is designed to manage UI elements in Maya.

Code Examples:

>>> update_action = "open"
>>> update_CreateClust_FL(update_action)
# Expands and opens the 'as_CreateClust_FL' frame layout.

>>> update_action = "close"
>>> update_CreateClust_FL(update_action)
# Collapses and closes the 'as_CreateClust_FL' frame layout.
graph TB Start[("(fa:fa-play Start)")] --> CheckAction{{"/fas:fa-question-circle Check Action"}} CheckAction --"If 'close'" --> CloseCreateClustFL["/fas:fa-minus-square Close CreateClust FrameLayout"] CheckAction --"If 'open'" --> OpenCreateClustFL["/fas:fa-plus-square Open CreateClust FrameLayout"] CheckAction --"If None or Other" --> ToggleCreateClustFL{{"/fas:fa-exchange-alt Toggle CreateClust FrameLayout"}} CloseCreateClustFL --> AdjustWindowHeightClose["/fas:fa-compress-arrows-alt Adjust Window Height (Close)"] OpenCreateClustFL --> AdjustWindowHeightOpen["/fas:fa-expand-arrows-alt Adjust Window Height (Open)"] ToggleCreateClustFL --"If Currently Closed" --> OpenCreateClustFL ToggleCreateClustFL --"If Currently Open" --> CloseCreateClustFL AdjustWindowHeightClose --> End[("fas:fa-stop End")] AdjustWindowHeightOpen --> CheckOtherSections{{"/fas:fa-tasks Check Other Sections"}} CheckOtherSections --> CloseOtherSections["/fas:fa-minus-square Close Other Sections"] CloseOtherSections --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAction fill:#ffcc00,stroke:#000,stroke-width:2px style CloseCreateClustFL fill:#99ccff,stroke:#000,stroke-width:2px style OpenCreateClustFL fill:#cc99ff,stroke:#000,stroke-width:2px style ToggleCreateClustFL fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightClose fill:#ff9999,stroke:#000,stroke-width:2px style AdjustWindowHeightOpen fill:#ffcc00,stroke:#000,stroke-width:2px style CheckOtherSections fill:#99ccff,stroke:#000,stroke-width:2px style CloseOtherSections fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_CreateClust_FL function:

  1. The process starts by checking the action (‘close’, ‘open’, or None).

  2. If ‘close’, it collapses the CreateClust FrameLayout and adjusts the window height.

  3. If ‘open’, it expands the CreateClust FrameLayout and adjusts the window height.

  4. If None or other, it toggles the CreateClust FrameLayout’s state and adjusts the window height accordingly.

  5. Additionally, if opening the CreateClust FrameLayout, the function checks and closes the ClusterInfo, MeshInfo, and RigInfo sections.

DeformEasy.update_EditClust_FL(self, **shArgs)#

Purpose:

:: Toggles the visibility and size of the ‘as_EditClust_FL’ frame layout in Autodesk Maya, based on its current state.

  • This function is essential for managing the user interface in Maya, specifically for the edit cluster frame layout.

  • It dynamically adjusts the height of the frame layout depending on whether it is currently collapsed or expanded.

Returns:

None # No return value, as the primary purpose is to update UI elements in Maya.

Code Examples:

>>> update_EditClust_FL()
# Toggles the state of the 'as_EditClust_FL' frame layout between collapsed and expanded.
graph TB Start[("(fa:fa-play Start)")] --> CheckState{{"/fas:fa-question-circle Check State"}} CheckState --"If Collapsed" --> ExpandEditClustFL["/fas:fa-plus-square Expand EditClust FrameLayout"] CheckState --"If Expanded" --> CollapseEditClustFL["/fas:fa-minus-square Collapse EditClust FrameLayout"] ExpandEditClustFL --> AdjustWindowHeightExpand["/fas:fa-expand-arrows-alt Adjust Window Height (Expand)"] CollapseEditClustFL --> AdjustWindowHeightCollapse["/fas:fa-compress-arrows-alt Adjust Window Height (Collapse)"] AdjustWindowHeightExpand --> End[("fas:fa-stop End")] AdjustWindowHeightCollapse --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckState fill:#ffcc00,stroke:#000,stroke-width:2px style ExpandEditClustFL fill:#99ccff,stroke:#000,stroke-width:2px style CollapseEditClustFL fill:#cc99ff,stroke:#000,stroke-width:2px style AdjustWindowHeightExpand fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightCollapse fill:#ff9999,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_EditClust_FL function:

  1. The process starts by checking the current state of the EditClust FrameLayout.

  2. If the FrameLayout is collapsed, it expands the layout and adjusts the window height accordingly.

  3. If the FrameLayout is already expanded, it collapses the layout and adjusts the window height to reflect the change.

  4. This dynamic adjustment of the EditClust FrameLayout facilitates an efficient and streamlined workflow within the user interface.

DeformEasy.update_RigInfo_FL(self, action=None, **shArgs)#

[shArgs : a=action]

Purpose:

:: Manages the opening and closing of the ‘as_RigInfo_FL’ frame layout in Autodesk Maya, adjusting its height and collapse state based on the provided action.

  • This function plays a key role in dynamically updating the user interface, particularly for the rig information frame layout in Maya.

  • It also ensures proper management of other UI sections like ‘as_ClusterInfo_FL’, ‘as_MeshInfo_FL’, and ‘as_CreateClust_FL’ depending on the state of ‘as_RigInfo_FL’.

Parameters:

action – <str, optional> # The action to be performed on the frame layout. Can be ‘close’ to collapse, ‘open’ to expand, or None to toggle the state.

Returns:

None # This function does not return a value; it updates the UI elements in Maya.

Code Examples:

>>> update_action = "open"
>>> update_RigInfo_FL(update_action)
# Opens and expands the 'as_RigInfo_FL' frame layout.

>>> update_action = "close"
>>> update_RigInfo_FL(update_action)
# Closes and collapses the 'as_RigInfo_FL' frame layout.
graph TB Start[("(fa:fa-play Start)")] --> CheckAction{{"/fas:fa-question-circle Check Action"}} CheckAction --"If 'close'" --> CloseRigInfoFL["/fas:fa-minus-square Close RigInfo FrameLayout"] CheckAction --"If 'open'" --> OpenRigInfoFL["/fas:fa-plus-square Open RigInfo FrameLayout"] CheckAction --"If None or Other" --> ToggleRigInfoFL{{"/fas:fa-exchange-alt Toggle RigInfo FrameLayout"}} CloseRigInfoFL --> AdjustWindowHeightClose["/fas:fa-compress-arrows-alt Adjust Window Height (Close)"] OpenRigInfoFL --> AdjustWindowHeightOpen["/fas:fa-expand-arrows-alt Adjust Window Height (Open)"] ToggleRigInfoFL --"If Currently Closed" --> OpenRigInfoFL ToggleRigInfoFL --"If Currently Open" --> CloseRigInfoFL AdjustWindowHeightClose --> End[("fas:fa-stop End")] AdjustWindowHeightOpen --> CheckOtherSections{{"/fas:fa-tasks Check Other Sections"}} CheckOtherSections --> CloseOtherSections["/fas:fa-minus-square Close Other Sections"] CloseOtherSections --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAction fill:#ffcc00,stroke:#000,stroke-width:2px style CloseRigInfoFL fill:#99ccff,stroke:#000,stroke-width:2px style OpenRigInfoFL fill:#cc99ff,stroke:#000,stroke-width:2px style ToggleRigInfoFL fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightClose fill:#ff9999,stroke:#000,stroke-width:2px style AdjustWindowHeightOpen fill:#ffcc00,stroke:#000,stroke-width:2px style CheckOtherSections fill:#99ccff,stroke:#000,stroke-width:2px style CloseOtherSections fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_RigInfo_FL function:

  1. The process starts by checking the specified action (‘close’, ‘open’, or None).

  2. If ‘close’, it collapses the RigInfo FrameLayout and adjusts the window height.

  3. If ‘open’, it expands the RigInfo FrameLayout and adjusts the window height.

  4. If None or other, it toggles the RigInfo FrameLayout’s state and adjusts the window height accordingly.

  5. Additionally, if opening the RigInfo FrameLayout, the function checks and closes other sections like ClusterInfo, MeshInfo, and CreateClust.

DeformEasy.update_WorkboxPaint_FL(self, action=None, **shArgs)#

[shArgs : a=action]

Purpose:

:: Controls the opening and closing of the ‘as_WorkboxPaint_FL’ frame layout in Autodesk Maya, modifying its height and collapse state based on the action parameter.

  • This function is key in managing the user interface for the Workbox Paint frame layout within Maya.

  • It dynamically adjusts the frame layout, and in addition, it handles the visibility of the ‘as_BakeClust_FL’ frame layout to maintain a clean UI.

Parameters:

action – <str, optional> # The action to be taken on the frame layout. Can be ‘close’ to collapse, ‘open’ to expand, or None to toggle the state.

Returns:

None # The function doesn’t return a value; it’s used for UI element manipulation in Maya.

Code Examples:

>>> update_action = "open"
>>> update_WorkboxPaint_FL(update_action)
# Expands and opens the 'as_WorkboxPaint_FL' frame layout.

>>> update_action = "close"
>>> update_WorkboxPaint_FL(update_action)
# Collapses and closes the 'as_WorkboxPaint_FL' frame layout.
graph TB Start[("(fa:fa-play Start)")] --> CheckState{{"/fas:fa-question-circle Check State"}} CheckState --"If Collapsed" --> ExpandWorkboxPaintFL["/fas:fa-plus-square Expand WorkboxPaint FrameLayout"] CheckState --"If Expanded" --> CollapseWorkboxPaintFL["/fas:fa-minus-square Collapse WorkboxPaint FrameLayout"] ExpandWorkboxPaintFL --> AdjustWindowHeightExpand["/fas:fa-expand-arrows-alt Adjust Window Height (Expand)"] CollapseWorkboxPaintFL --> AdjustWindowHeightCollapse["/fas:fa-compress-arrows-alt Adjust Window Height (Collapse)"] ExpandWorkboxPaintFL --> CloseBakeDeformerFL["/fas:fa-times-circle Close BakeDeformer FrameLayout"] AdjustWindowHeightExpand --> End[("fas:fa-stop End")] AdjustWindowHeightCollapse --> End CloseBakeDeformerFL --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckState fill:#ffcc00,stroke:#000,stroke-width:2px style ExpandWorkboxPaintFL fill:#99ccff,stroke:#000,stroke-width:2px style CollapseWorkboxPaintFL fill:#cc99ff,stroke:#000,stroke-width:2px style AdjustWindowHeightExpand fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightCollapse fill:#ff9999,stroke:#000,stroke-width:2px style CloseBakeDeformerFL fill:#ffcc00,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_WorkboxPaint_FL function:

  1. The process begins by checking the current state of the WorkboxPaint FrameLayout.

  2. If the FrameLayout is collapsed, it expands the layout and adjusts the window height. It also ensures the BakeDeformer FrameLayout is closed for UI cleanliness.

  3. If the FrameLayout is already expanded, it collapses the layout and adjusts the window height to reflect the change.

  4. This dynamic adjustment of the WorkboxPaint FrameLayout allows for an organized and efficient user interface, especially in workflows involving painting or deformation tasks.

DeformEasy.update_meshInfo_FL(self, action=None, **shArgs)#

[shArgs : a=action]

Purpose:

:: Manages the opening and closing of the ‘as_MeshInfo_FL’ frame layout in Autodesk Maya, adjusting its height and collapse state based on the action argument.

  • This function is crucial for dynamically updating the user interface, particularly the visibility and size of the mesh information frame layout.

  • It ensures that other sections like ‘as_ClusterInfo_FL’, ‘as_RigInfo_FL’, and ‘as_CreateClust_FL’ are appropriately managed in response to the state of ‘as_MeshInfo_FL’.

Parameters:

action – <str, optional> # The action to be performed on the frame layout. Accepts ‘close’ to collapse, ‘open’ to expand, or None to toggle its state.

Returns:

None # No return value as it primarily updates UI elements in Maya.

Code Examples:

>>> update_action = "open"
>>> update_meshInfo_FL(update_action)
# Opens and expands the 'as_MeshInfo_FL' frame layout.

>>> update_action = "close"
>>> update_meshInfo_FL(update_action)
# Closes and collapses the 'as_MeshInfo_FL' frame layout.
graph TB Start[("(fa:fa-play Start)")] --> CheckAction{{"/fas:fa-question-circle Check Action"}} CheckAction --"If 'close'" --> CloseMeshInfoFL["/fas:fa-minus-square Close MeshInfo FrameLayout"] CheckAction --"If 'open'" --> OpenMeshInfoFL["/fas:fa-plus-square Open MeshInfo FrameLayout"] CheckAction --"If None or Other" --> ToggleMeshInfoFL{{"/fas:fa-exchange-alt Toggle MeshInfo FrameLayout"}} CloseMeshInfoFL --> AdjustWindowHeightClose["/fas:fa-compress-arrows-alt Adjust Window Height (Close)"] OpenMeshInfoFL --> AdjustWindowHeightOpen["/fas:fa-expand-arrows-alt Adjust Window Height (Open)"] ToggleMeshInfoFL --"If Currently Closed" --> OpenMeshInfoFL ToggleMeshInfoFL --"If Currently Open" --> CloseMeshInfoFL AdjustWindowHeightClose --> End[("fas:fa-stop End")] AdjustWindowHeightOpen --> CheckOtherSections{{"/fas:fa-tasks Check Other Sections"}} CheckOtherSections --> CloseOtherSections["/fas:fa-minus-square Close Other Sections"] CloseOtherSections --> End style Start fill:#00cc00,stroke:#000,stroke-width:3px style CheckAction fill:#ffcc00,stroke:#000,stroke-width:2px style CloseMeshInfoFL fill:#99ccff,stroke:#000,stroke-width:2px style OpenMeshInfoFL fill:#cc99ff,stroke:#000,stroke-width:2px style ToggleMeshInfoFL fill:#99ff99,stroke:#000,stroke-width:2px style AdjustWindowHeightClose fill:#ff9999,stroke:#000,stroke-width:2px style AdjustWindowHeightOpen fill:#ffcc00,stroke:#000,stroke-width:2px style CheckOtherSections fill:#99ccff,stroke:#000,stroke-width:2px style CloseOtherSections fill:#cc99ff,stroke:#000,stroke-width:2px style End fill:#ff6666,stroke:#000,stroke-width:3px
Flow Chart Description:

This flowchart illustrates the update_meshInfo_FL function:

  1. The process starts by checking the specified action (‘close’, ‘open’, or None).

  2. If ‘close’, it collapses the MeshInfo FrameLayout and adjusts the window height.

  3. If ‘open’, it expands the MeshInfo FrameLayout and adjusts the window height.

  4. If None or other, it toggles the MeshInfo FrameLayout’s state and adjusts the window height accordingly.

  5. Additionally, if opening the MeshInfo FrameLayout, the function checks and closes other sections like ClusterInfo, RigInfo, and CreateClust.