pymel.core.general.partition

partition(*args, **kwargs)

This command is used to create, query or add/remove sets to a partition. If a partition name needs to be specified, it is the first argument, other arguments represent the set names. Without any flags, the command will create a partition with a default name. Any sets which are arguments to the command will be added to the partition. A set can be added to a partition only if none of its members are in any of the other sets in the partition. If the -re/render flag is specified when the partition is created, only ‘renderable’ sets can be added to the partition. Sets can be added and removed from a partition by using the -addSet or -removeSet flags. Note:If a set is already selected, and the partition command is executed, the set will be added to the created partition.

Flags:
Long name (short name) Argument Types Properties
addSet (add) PyNode ../../../_images/create.gif
 
Adds the list of sets to the named partition.
name (n) unicode ../../../_images/create.gif
 
Assigns the given name to new partition. Valid only for create mode.
removeSet (rm) PyNode ../../../_images/create.gif
 
Removes the list of sets from the named partition.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.
render (re) bool ../../../_images/create.gif ../../../_images/query.gif
 
New partition can contain render sets. For use in creation mode only. Default is false. Can also be used with query flag - returns boolean.

Derived from mel command maya.cmds.partition

Example:

import pymel.core as pm

import maya.cmds as cmds

# To create a partition calls p1 which contains set1 and set2 ...
pm.partition( 'set1', 'set2', n='p1' )

# To create an empty render partition ...
pm.partition( render=True )

# To add/remove sets from partition p1 ...
pm.partition( 'set3', add='p1' )
pm.partition( 'set1', rm='p1' )

# To get a list of all sets in a partition ...
pm.partition( 'p1', q=True )

# To check if the partition is a render partition
pm.partition( 'p1', q=True, re=True )

Previous topic

pymel.core.general.parent

Next topic

pymel.core.general.pause

Core

Core Modules

Other Modules

This Page