Go to: Synopsis. Return value. Keywords.
Related. Flags.
Python examples.
containerView(string, [itemInfo=string], [itemList=boolean], [viewDescription=boolean],
[viewLabel=boolean], [viewList=boolean], [viewName=boolean])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
containerView is NOT undoable, queryable, and
editable.
A container view defines the layout information for the published
attributes of a particular container. Container views can be
selected from a set of built-in views or may be defined on an
associated container template. This command queries the
view-related information for a container node. The information
returned from this command will be based on the view-related
settings in force on the container node at the time of the query
(i.e. the container's view mode, template name, view name
attributes).
None
In query mode, return type is based on queried flag.
container, view
container, containerTemplate
itemInfo, itemList, viewDescription, viewLabel, viewList, viewName
Long name (short name) |
Argument types |
Properties |
viewList(vl) |
boolean |
|
|
Used in query mode, command will return a list of all views
defined for this container. |
|
itemList(il) |
boolean |
|
|
Used in query mode, the command will return a list of
information for each item in the view. The viewName flag is used to
select the view to query. The information returned about each item
is determined by the itemInfo argument value. For efficiency, it is
best to query all necessary item information at one time (to avoid
recomputing the view information on each call). |
|
itemInfo(ii) |
string |
|
|
Used in query mode in conjunction with the itemList flag. The
command will return a list of information for each item in the
view, the information fields returned for each item are determined
by this argument value. The information fields will be listed in
the string array returned. The order in which the keyword is
specified will determine the order in which the data will be
returned by the command. One or more of the following keywords,
separated by colons ':' are used to specify the argument value.
- itemIndex : sequential item number (0-based)
- itemName : item name (string)
- itemLabel : item display label (string)
- itemDescription : item description field (string)
- itemLevel : item hierarchy level (0-n)
- itemIsGroup : (boolean 0 or 1) indicates whether or not this
item is a group
- itemIsAttribute : (boolean 0 or 1) indicates whether or not
this item is an attribute
- itemNumChildren: number of immediate children (groups or
attributes) of this item
- itemAttrType : item attribute type (string)
In query mode, this flag needs a value.
|
|
viewName(vn) |
boolean |
|
|
Used in query mode, returns name of the currently active view
associated with the container. This value may be empty if the
current view is not a valid template view or is generated by one of
the built-in view modes. For this reason, the view label is
generally more suitable for display purposes. |
|
viewLabel(vb) |
boolean |
|
|
Used in query mode, returns the display label associated with
the view. An appropriate label suitable for the user interface will
be returned based on the current container settings. Use of the
view label is usually more suitable than the view name for display
purposes. |
|
viewDescription(vd) |
boolean |
|
|
Used in query mode, returns the description field associated
with the currently active view. If no description was defined for
this view, the value will be empty. |
|
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. |
import maya.cmds as cmds
# Obtain a list of all available views for container1
#
cmds.containerView ( 'container1', query=True, viewList=True);
# Result: [u'Animation', u'Rendering'] #
#
# Get a list of view items in the current view for container1
# In this example the list returned will include only the name for
# each item in the view.
cmds.containerView ( 'container1', itemList=True, itemInfo="itemName", query=True)
# Result: [u'RenderSetup', u'color', u'intensity', u'Transform', u'rotateY'] #
#
# Get a list of view items.
# In this query the list returned will include the group boolean and label
# for each item in the view.
cmds.containerView ( 'container1', itemList=True, itemInfo="itemIsGroup:itemLabel", query=True)
# Result: [u'1', u'RenderSetup', u'0', u'Color', u'0', u'Intensity', u'1', u'Transform', u'0', u'Rotate Y'] #