Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

componentTag( [objects] , [create=boolean], [delete=boolean], [injectionLocation=string], [modify=string], [newTagName=string], [queryEdit=boolean], [rename=boolean], [tagName=string])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

componentTag is undoable, NOT queryable, and NOT editable.

This command allows you to create, delete and modify component tags

Return value

AnyThe name of the created componentTag, or whether the command succeeded or the information about what can be edited

Related

deformableShape, geometryAttrInfo

Flags

create, delete, injectionLocation, modify, newTagName, queryEdit, rename, tagName
Long name (short name) Argument types Properties
create(cr) boolean create
This creates a componentTag on the geometry. The name can be specified with the -newTagName option. If no new name is specified one will be generated. The name of the created tag is returned
delete(d) boolean create
This deletes the componentTags specified with the -tagName option.
injectionLocation(il) string create
The name of the injection node at which the componentTag will be edited. This is only necessary in the rare case where a particular componentTag can be altered at multiple injection locations.
modify(m) string create
This modifies the componentTag specified with the -tagName option. The mode determines whether components are, replaced, cleared, added or removed.
newTagName(ntn) string create
The name of the new componentTag to be created or the new name of the componentTag that is being renamed.
queryEdit(qe) boolean create
This returns what edits are allowed with the given parameters. When the command is issued in Python a dictionary object containing what is allowed is returned.
rename(rn) boolean create
This renames the componentTag specified with the -tagName option to the name specified with the -newTagName option
tagName(tn) string createmultiuse
The name(s) of the componentTags to be edited. THis can be a single name or a list of names. The names can contain wildcard like '*' to match multiple existing componentTags.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

    # Make a geometry
    import maya.cmds as cmds
    cmds.polyCylinder(ch=True, o=True, r=3.0, h=8.0, sc=1, sx=6, sy=9, cuv=3, name='cyl')

    # Create some tags
    cmds.componentTag(['cyl.f[0:17]'], cr=True, ntn='bottomSection')
    cmds.componentTag(['cyl.f[36:53]'], cr=True, ntn='topSection')

    # Edit a tag
    cmds.componentTag(['cyl.f[18:35]'], tn='bottomSection', m='add')

    # Rename the tag
    cmds.componentTag('cyl', rn=True, tn='bottomSection', ntn='lowerSection')

    # Delete tags (using a wild card)
    cmds.componentTag('cyl', d=True, tn='*Section')