robot_designer_plugin.core.conditions module

This submodule provides the Condition.

class robot_designer_plugin.core.conditions.Condition[source]

Bases: object

Base Class for conditions.

Classes should implement a check() method which returns a tuple of (bool,str) stating whether the condition’s are met and an (potentially) empty error message.

Using the operators.RDOperator.Preconditions() decorator, the conditions that should be met when executing an operator (i.e., a subclass of operators.RDOperator) are added to the classes’ list of preconditions and check_conditions() is called when Blender executes the operators.RDOperator.poll() method.

Note

Instances of this type should never be created.

For examples see robot_designer_plugin.operators.helpers.ModelSelected.

static call()[source]

Needs to be overridden in sub classes

Raises

NotImplementedError

static check_conditions(*conditions)[source]

Checks whether the arguments are met.

Parameters

conditions (Condition sub classes.) – A an arbitrary number of conditions

Returns

Tuple(bool, str), True and empty string if all conditions are met. False and sting with message of

unmet conditions.