mrv.maya.automation.qa

Epydoc: mrv.maya.automation.qa

Specialization of workflow to allow checks to be natively implemented in MEL

Classes

Epydoc: mrv.maya.automation.qa

class mrv.maya.automation.qa.Mel

Bases: mrv.util.Singleton

This class is a necessity for calling mel scripts from python. It allows scripts to be called in a cleaner fashion, by automatically formatting python arguments into a string which is executed via maya.mel.eval().

Note:originated from pymel, added customizations
static call(command, *args)

Call a mel script , very simpilar to Mel.myscript( args )

Todo:more docs
static error(*args)
error
static eval(command)
same as maya.mel eval
static info(*args)
print
static mprint(*args)
mel print command in case the python print command doesn’t cut it. i have noticed that python print does not appear in certain output, such as the rush render-queue manager.
static trace(*args)
trace

Epydoc: mrv.maya.automation.qa

class mrv.maya.automation.qa.QACheck(*args, **kwargs)

Bases: mrv.dge.plug

Defines a test suitable to be run and computed by a QAProcessBase It’s nothing more than a convenience class as the actual information is held by the respective QACheckAttribute. All non-plug calls are passed on to the underlying attribute, allowing it to be treated like one

affected()
Returns:tuple containing affected plugs ( plugs that are affected by our value )
affectedBy()
Returns:tuple containing plugs that affect us ( plugs affecting our value )
affects(otherplug)
Set an affects relation ship between this plug and otherplug, saying that this plug affects otherplug.
check_attribute_cls
alias of QACheckAttribute
name()
Returns:name of plug
providesInput()
Returns:True if this is an input plug that will never cause computations
providesOutput()
Returns:True if this is an output plug that can trigger computations
setName(name)
Set the name of this plug - can be set only once

Epydoc: mrv.maya.automation.qa

class mrv.maya.automation.qa.QACheckAttribute(annotation, has_fix=False, flags=4)

Bases: mrv.dge.Attribute

The Test Attribute represents an interface to a specific test as implemented by the parent QAProcessBase. The QA Attribute returns specialized quality assurance results and provides additional information about the respective test

Note:as this class holds meta information about the respective test ( see QACheck ) user interfaces may use it to adjust it’s display
Note:this class depends on unknown mel implementations - on error we abort but do not throw as this would cause class creation to fail and leave the whole qa system unusable
affinity(otherattr)

Compute affinity for otherattr.

Returns:rating from 0 to 255 defining how good the attribtues match each other in general - how good can we store values of otherattr ? Thus this comparison is directed.
Note:for checking connections, use connectionAffinity
compatabilityRate(value)

Compute value’s compatability rate

Returns:value between 0 and 255, 0 means no compatability, 255 a perfect match. if larger than 0, the plug can hold the value ( assumed the flags are set correctly ).
connectionAffinity(destinationattr)

Compute connection affinity for given destination attribute

Returns:rating from 0 to 255 defining the quality of the connection to otherplug. an affinity of 0 mean connection is not possible, 255 mean the connection is perfectly suited. The connection is a directed one from self -> otherplug
default()
Returns:default value stored for this attribute, or raise
Note:handles dynamic defaults, so you should not directly access the default member variable
Raises MissingDefaultValueError:
 if attribute does not have a default value
Raises TypeError:
 if value returned by dynamic attribute has incorrect type

Epydoc: mrv.maya.automation.qa

class mrv.maya.automation.qa.QACheckResult(fixed_items=None, failed_items=None, header='')

Bases: object

Wrapper class declaring test results as a type that provides a simple interface to retrieve the test results

Note:test results are only reqtrieved by QACheckAttribute plugs
failedItems()
Returns:( list( Item, ... ) list of failed items being items that could not be fixed and are not yet in the desired state
fixedItems()
Returns:list( Item , ... ) list of items ( the exact type may differ depending on the actual test ) which have been fixed so they represent the desired state
isNull()
Returns:True if the test result is empty, and thus resembles a null value
isSuccessful()
Returns:True if the check is successful, and False if there are at least some failed objects

Epydoc: mrv.maya.automation.qa.QAMELCheck

class mrv.maya.automation.qa.QAMELCheck(*args, **kwargs)

Bases: mrv.automation.qa.QACheck

Specialized version of the QACheck allowing to use our own MEL attribute contianiing more information

affected()
Returns:tuple containing affected plugs ( plugs that are affected by our value )
affectedBy()
Returns:tuple containing plugs that affect us ( plugs affecting our value )
affects(otherplug)
Set an affects relation ship between this plug and otherplug, saying that this plug affects otherplug.
check_attribute_cls
alias of QAMELCheckAttribute
name()
Returns:name of plug
providesInput()
Returns:True if this is an input plug that will never cause computations
providesOutput()
Returns:True if this is an output plug that can trigger computations
setName(name)
Set the name of this plug - can be set only once

Epydoc: mrv.maya.automation.qa.QAMELCheckAttribute

class mrv.maya.automation.qa.QAMELCheckAttribute(annotation, has_fix=False, flags=4)

Bases: mrv.automation.qa.QACheckAttribute

Attribute identifying a MEL check carrying additional mel specific attributes

affinity(otherattr)

Compute affinity for otherattr.

Returns:rating from 0 to 255 defining how good the attribtues match each other in general - how good can we store values of otherattr ? Thus this comparison is directed.
Note:for checking connections, use connectionAffinity
compatabilityRate(value)

Compute value’s compatability rate

Returns:value between 0 and 255, 0 means no compatability, 255 a perfect match. if larger than 0, the plug can hold the value ( assumed the flags are set correctly ).
connectionAffinity(destinationattr)

Compute connection affinity for given destination attribute

Returns:rating from 0 to 255 defining the quality of the connection to otherplug. an affinity of 0 mean connection is not possible, 255 mean the connection is perfectly suited. The connection is a directed one from self -> otherplug
default()
Returns:default value stored for this attribute, or raise
Note:handles dynamic defaults, so you should not directly access the default member variable
Raises MissingDefaultValueError:
 if attribute does not have a default value
Raises TypeError:
 if value returned by dynamic attribute has incorrect type

Epydoc: mrv.maya.automation.qa.QAMELMixin

class mrv.maya.automation.qa.QAMELMixin

Bases: object

Base class allowing to process MEL baesd plugs as created by our metaclass

Note:this class assumes it is used on a process
Configuration:

The following variables MUST be used to setup this class once you have derived from it:

  • mel_index_proc:
    produdure name with signature func( ) returning string array in following format:

    [n*3+0] = checkname : the name of the check, use CamelCase names or names_with_underscore The checkname is also used as id to identify the check lateron [n*3+1] = description: Single sentence desciption of the check targeted at the end user [n*3+2] = can_fix: Boolean value indicating whether the check can also fix the issue

  • mel_check_proc:
    procedure called to actually process the given check, signature is:

    func( check_name, should_fix ) returning list of strings as follows:

    [0] = x number of fixed items [1] = header [1:1+x] = x fixed items [2+x:n] = n invalid items

    items are either objects or in general anything you check for. The check is considered to be failed if there is at least one invalid item.

    If you fixed items, all previously failed items should now be returned as valid items

static_mel_plugs:
Please note that your class must implemnent plugs and extend the super class result by the result of listMELChecks to dynamically retrieve the available checks
check_plug_cls
Specialized version of the QACheck allowing to use our own MEL attribute contianiing more information
check_result_cls
alias of QACheckResult
handleMELCheck(check, mode)

Called to handle the given check in the given mode

Raises RuntimeError:
 If MEL throws an error
Returns:QACheckResult of the result generated by MEL
isMELCheck(check)
Returns:True if the given check plug is implemented in MEL and can be handled there accordingly
listMELChecks()
Returns:list all checks ( Plugs ) available on this class that are implemented in MEL
classmethod melChecks(predicate=<function <lambda> at 0x5c602a8>)
Returns:list of MEL checks ( plugs ) representing checks defined by MEL
Parameter:predicate – only return plug if predicate( item ) yield True

Epydoc: mrv.maya.automation.qa.QAMetaMel

class mrv.maya.automation.qa.QAMetaMel

Bases: mrv.dge._NodeBaseCheckMeta

Metaclass allowing to create plugs based on a MEL implementation, allowing to decide whether checks are Python or MEL implemented, but still running natively in python

mro
mro() -> list return a type’s method resolution order

Epydoc: mrv.maya.automation.qa

class mrv.maya.automation.qa._NodeBaseCheckMeta

Bases: type

Class checking the consistency of the nodebase class before it is being created

mro
mro() -> list return a type’s method resolution order

Table Of Contents

Previous topic

mrv.maya.env

Next topic

mrv.maya.ui.layout

This Page