Flags are used with commands to modify their execution. Python implements flags as named arguments. Some flags in MEL do not require values. As all named arguments in Python require a value, these flags are given the value True to enable the flag, or False to ignore the flag. When setting multiple named arguments, argument-value pairs are separated by commas within the brackets. Command arguments must appear before named arguments in a command.
cmds.polySphere(radius=1, subdivisionsX=4, name="testSphere")
You can use multiple flags to modify the execution of a command by separating the flag-value pairs with a comma. The radius flag sets the radius of the created sphere. The subdivisionsX flag sets the number of subdivisions in X for the sphere.
The polygonal cube moves relative to its current position. The relative flag must be placed after the command arguments, as in Python, when passing arguments, named arguments must appear after positional arguments. The command arguments must always be the first arguments of the command.
When flags require multiple values, the values must be packed within Python’s tuple or list data types. Tuples are a method of storing multiple items of homogenous data within a single variable, similar to an array in MEL. The list is similar to the tuple, but supports multiple data types within a single variable. The above command packs the RGB values into a tuple. You could also use a list to achieve a similar effect.
Using the Maya command select with the allDagObjects flag selects objects that exist physically in the scene such as geometry, IK chains and measure tools. These appear on an internal Maya representation called the DAG. For more information, see .