Go to: Synopsis. Return value. Keywords.
Related. Flags.
MEL examples.
addMetadata [-channelType string] [-indexType string] [-streamName string] [-structure string]
addMetadata is undoable, queryable, and NOT editable.
Defines the attachment of a metadata structure to one or more
selected objects. This creates a placeholder with an empty metadata
Stream for later population through the editMetadata
command. It's similar in concept to the addAttr command for
nodes - an attribute is added but no data is actually set. When
assigning a metadata structure you must specify these flags -
channelType is the metadata channel type (e.g. "vertex"),
streamName is the name of the metadata stream to be created,
and structure is the name of the structure type defining the
contents of the metadata. The indexType flag is optional. If
it is not present then the index will be presumed to be a standard
numerical value. You can query metadata information at a variety of
levels. See the table below for a full list of the queryable
arguments. In each case the specification of any of the non-queried
arguments filters the list of metadata to be examined during the
query. For all queries a single object must be selected for
querying. For example querying the channelType flag with no
other arguments will return the list of all Channel types on the
selected object that contain any metadata. Querying the
channelType flag with the indexType flag specified
will return only those channel types containing metadata streams
that use that particular type of index.
- Query the channelType flag to return the list of any
channel types that have metadata.
- Specify the channelType and streamName flags and
query the structure flag to return the name of the structure
assigned to the given stream (if any).
- Specify a channelType and query the streamName to
return the list of all streams assigned to that particular channel
type.
- If you query the streamName without a specific
channelType then it returns a list of pairs of (channelType,
streamName) for all metadata streams.
Flag Combinations:
ChannelType IndexType StreamName Structure Create Can Query
0 0 0 0 X ChannelType, StreamName, Structure
0 0 0 1 X ChannelType, StreamName, IndexType
0 0 1 0 X ChannelType, Structure, IndexType
0 0 1 1 X ChannelType, IndexType
0 1 0 0 X ChannelType, StreamName, Structure
0 1 0 1 X ChannelType, StreamName
0 1 1 0 X ChannelType, Structure
0 1 1 1 X ChannelType
1 0 0 0 X StreamName, Structure, IndexType
1 0 0 1 X StreamName, IndexType
1 0 1 0 X Structure, IndexType
1 0 1 1 (a) IndexType
1 1 0 0 X StreamName, Structure
1 1 0 1 X StreamName
1 1 1 0 X Structure
1 1 1 1 (b) X
(a) Assign an empty metadata stream with default index type
(b) Assign an empty metadata stream with the named index type
string[] |
List of nodes to which a new Stream was successfully added
(create mode) |
string[] |
List of channel types containing metadata on an object when
querying the channelType flag |
string[] |
List of stream names on an object when querying the streamName
flag |
string[] |
List of structures used by an object's metadata Streams when
querying the structure flag |
string[] |
List of index types used by an object when querying the
indexType flag |
In query mode, return type is based on queried flag.
metadata, component, stream, channel, association
applyMetadata, dataStructure, editMetadata, getMetadata
channelType, indexType, streamName, structure
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 be used more than once in a
command. |
polyPlane -n p -ch off;
select -r "pShape";
dataStructure -format "raw" -asString "name=IdStruct:int32=ID";
dataStructure -format "raw" -asString "name=OffStruct:float=Offset";
dataStructure -format "raw" -asString "name=OrgStruct:float[3]=Origin Point";
addMetadata -streamName "IdStream" -channelType "vertex" -structure "IdStruct";
addMetadata -streamName "OffStream" -channelType "vertex" -structure "OffStruct";
addMetadata -streamName "OrgStream" -channelType "edge" -structure "OrgStruct";
addMetadata -streamName "VFStream" -channelType "vertexFace" -indexType "pair" -structure "OrgStruct";
// Query for the list of all channel types possessing metadata
addMetadata -query -channelType;
// Return: edge vertex vertexFace //
// Query for the structure assigned to a specific stream
addMetadata -channelType "vertex" -streamName "OffStream" -query -structure;
// Return: OffStruct //
// Query for the list of all streams on a specific channel type
addMetadata -channelType "vertex" -query -streamName;
// Return: IdStream OffStream //
// Query for the list of all streams
addMetadata -query -streamName;
// Return: IdStream OffStream OrgStream VFStream //
// You can combine queries to answer more general questions about the
// metadata on an object. For example suppose you wanted to know the
// index type used by all Streams on the "vertex" Channel.
// First extract the list of Streams on the Channel
string $streams[] = `addMetadata -channelType "vertex" -query -streamName`;
int $i;
// Loop through each Stream, querying the IndexType only for that Stream
for( $i=0; $i < size( $streams ); ++$i )
{
string $indexType = `addMetadata -channelType "vertex" -streamName $streams[$i] -query -indexType`;
print ( "Index type on " + $streams[$i] + " is " + $indexType + "\n" );
}