qualityAssurance.utils.qa module

class qualityAssurance.utils.qa.QualityAssurance

Bases: object

This is the base class that can be used to generate your own quality assurance checks. Key variables can be overwritten and a _find and _fix function should be implemented to complete the check, otherwise the class will not register as findable or checkable.

categories
Returns:Categories error check should belong too
Return type:list
errors
Returns:Quality assurance error list
Return type:list
find()

Runs the _find method and appends all of the errors found to the error list.

fix()

Loops over each of the errors found and runs the _fix method on each error. The entire function is wrapped in an undo block for easy undoing. Each fix is also wrapped in a try function, meaning that if an error cannot be fixed, it will remain in the error list but it error the application. The _fix method should only take in 1 argument.

information
Returns:Quality assurance information
Return type:list
isFindable()

A quality assurance check becomes findable if a _find method is implemented,

Returns:Findable state of quality assurance check
Return type:bool
isFixable()

A quality assurance check becomes fixable if a _fix method is implemented,

Returns:Fixable state of quality assurance check
Return type:bool
isSelectable()
Returns:If the error list is selectable
Return type:bool
ls(**kwargs)

Subclass of Maya’s ls command. This command should be used to get the nodes in a quality assurance check. This will automatically take into account of the check should only run on selected objects or not.

Returns:Object list
Return type:list
lsApi(nodeType=<sphinx.ext.autodoc._MockObject object>)

Get a OpenMaya.MItSelectionList object. This command should be used to get the nodes in a quality assurance check. This will automatically take into account of the check should only run on selected objects or not.

Returns:Object list
Return type:OpenMaya.MItSelectionList
message

Message informing the user about the state of the check and the number of errors. If not errors are found and empty string is returned.

Returns:Quality assurance message
Return type:str
name
Returns:Quality assurance name
Return type:str
onSelected
Returns:Only run quality assurance check in selection
Return type:bool
select()

Select all current entries of the error list.

state

If no errors can be found the state of the check is neutral which is set to a value of 0. Different levels of urgency can be implemented with increasing values.

Returns:Current state of quality assurance
Return type:int