This command is used to manage the membership of a character. Characters are a type of set that gathers together the attributes of a node or nodes that a user wishes to animate as a single entity.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
addElement (add) | PyNode | ||
Adds the list of items to the given character. If some of the items cannot be added to the character because they are in another character, the command will fail. When another character is passed to to -addElement, is is added as a sub character. When a node is passed in, it is expanded into its keyable attributes, which are then added to the character. |
|||
addOffsetObject (aoo) | unicode | ||
|
|||
characterPlug (cp) | bool | ||
|
|||
clear (cl) | PyNode | ||
|
|||
empty (em) | bool | ||
|
|||
excludeDynamic (ed) | bool | ||
|
|||
excludeRotate (er) | bool | ||
|
|||
excludeScale (es) | bool | ||
|
|||
excludeTranslate (et) | bool | ||
When creating the character, exclude translate attributes from transform-type nodes. For example, if your character contains joints only, perhaps you only want to include rotations in the character. |
|||
excludeVisibility (ev) | bool | ||
|
|||
flatten (fl) | PyNode | ||
An operation that flattens the structure of the given character. That is, any characters contained by the given character will be replaced by its members so that the character no longer contains other characters but contains the other characters’ members. |
|||
forceElement (fe) | PyNode | ||
For use in edit mode only. Forces addition of the items to the character. If the items are in another character which is in the character partition, the items will be removed from the other character in order to keep the characters in the character partition mutually exclusive with respect to membership. |
|||
include (include) | PyNode | ||
Adds the list of items to the given character. If some of the items cannot be added to the character, a warning will be issued. This is a less strict version of the -add/addElement operation. |
|||
intersection (int) | PyNode | ||
|
|||
isIntersecting (ii) | PyNode | ||
An operation which tests whether or not the characters in the list have common members. In general, characters should be mutually exclusive, so this should always return false. |
|||
isMember (im) | PyNode | ||
|
|||
library (lib) | bool | ||
|
|||
memberIndex (mi) | int | ||
Returns the memberIndex of the specified character member if used after the query flag. Or if used before the query flag, returns the member that corresponds to the specified index. |
|||
name (n) | unicode | ||
|
|||
noWarnings (nw) | bool | ||
|
|||
nodesOnly (no) | bool | ||
This flag modifies the results of character membership queries. When listing the attributes (e.g. sphere1.tx) contained in the character, list only the nodes. Each node will only be listed once, even if more than one attribute or component of the node exists in the character. |
|||
offsetNode (ofs) | bool | ||
Returns the name of the characterOffset node used to add offsets to the root of the character.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
remove (rm) | PyNode | ||
|
|||
removeOffsetObject (roo) | unicode | ||
|
|||
root (rt) | unicode | ||
Specifies the transform node which will act as the root of the character being created. This creates a characterOffset node in addition to the character node, which can be used to add offsets to the character to change the direction of the character’s animtion without inserting additional nodes in its hierarchy. |
|||
scheduler (sc) | bool | ||
|
|||
split (sp) | PyNode | ||
|
|||
subtract (sub) | PyNode | ||
An operation between two characters which returns the members of the first character that are not in the second character. In general, characters should be mutually exclusive. |
|||
text (t) | unicode | ||
|
|||
union (un) | PyNode | ||
|
|||
userAlias (ua) | PyNode | ||
Returns the user defined alias for the given attribute on the character or and empty string if there is not one. Characters automatically alias the attributes where character animation data is stored. A user alias will exist when the automatic aliases are overridden using the aliasAttr command. |
Derived from mel command maya.cmds.character
Example:
import pymel.core as pm
# create two characters with whatever is currently active
pm.character()
# Result: nt.Character(u'character1') #
pm.character()
# Result: nt.Character(u'character2') #
# create a set which contains two sub characters
pm.character( 'character1', 'character2', n='parentCharacter' )
# Result: nt.Character(u'parentCharacter') #
# Add the keyable attributes of ikHandle1 to a character
pm.character( 'ikHandle1', add='character1' )
# Remove the scale attributes for a transform from a character
pm.character( 'sphere1.sx', 'sphere1.sy', 'sphere1.sz', remove='character1' )
# Query the members of the character
members = pm.character('character1', query=True)
# Query the character plug for a specified member
pm.character( members[0], q=True, cp=True )
# Query the library and scheduler of the character
pm.character( 'character1', q=True, library=True )
pm.character( 'character2', q=True, sc=True )
# Add the sphere as an offset object on the character
pm.character( 'pSphere1', e=True, addOffsetObject = 'character1' )