.order
Control the order of execution.
Introduction
Plug-ins are sorted by this attribute. By altering the order of a subclass, you effectively have control over the order in which a particular plug-in is set to execute.
Sorting is performed via the sort function and works similar to this.
Usage
By incrementing the order, you can offset how they are sorted and executed.
As the default order for a Validator is 1
, setting it to 1.5
means that this particular subclass will run once all validators still at the default order have finished.
To protect yourself against changes to the inherited order, it is recommended that you offset the order as opposed to setting it to an absolute value.
Example
Here's an example of three plug-ins of the same superclass, set to run one after the other.
Behavior
Each order have a special meaning to Pyblish.
0-1
Implies Collector. It is run first, sometimes automatically, such as when launching the Pyblish QML graphical user interface.
1-2
Implies Validation.
2-3
Implies Extraction. It does not run if any plug-in within range 1-2
has produced an error.
3+
Implies Integration. Like Extraction, it only runs if validation was successful.
Caution
Keep in mind that if you offset an order too far, you effectively alter it's role in the Pyblish ecosystem which may cause undefined behaviour.
If you find yourself working with a large number of interdependent plug-ins, it is recommended that you subclass the super-classes and make ordering explicit.
pipeline/pyblish.py
You can then replace the provided classes with your with your own.
/my_plugins/validate_something.py
Last updated