pymel.core.general.condition

condition(*args, **kwargs)

This command creates a new named condition object whose true/false value is calculated by running a mel script. This new condition can then be used for dimming, or controlling other scripts, or whatever. In query mode, return type is based on queried flag.

Flags:
  • delete : delete (bool) [create]

    Deletes the condition.

  • dependency : d (unicode) [create]

    Each -dependency flag specifies another condition that the new condition will be dependent on. When any of these conditions change, the new-state-script will run, and the state of this condition will be set accordingly. It is possible to define infinite loops, but they will be caught and handled correctly at run-time.

  • initialize : i (bool) [create]

    Initializes the condition, by forcing it to run its script as soon as it is created. If this flag is not specified, the script will not run until one of the dependencies is triggered.

  • script : s (unicode) [create]

    The script that determines the new state of the condition.

  • state : st (bool) [create,query,edit]

    Sets the state of the condition. This can be used to create a manually triggered condition: you could create a condition without any dependencies and without a new-state-script. This condition would only change state in response to the -st/state flag. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.condition

Previous topic

pymel.core.general.commandPort

Next topic

pymel.core.general.connectAttr

Core

Core Modules

Other Modules

This Page