Go to: Synopsis. Return value. Keywords. Related. Flags. MEL examples.

Synopsis

showMetadata [-auto] [-dataType string] [-interpolation boolean] [-isActivated] [-listAllStreams] [-listMembers] [-listValidMethods] [-listVisibleStreams] [-member string] [-method string] [-off] [-range float float] [-rayScale float] [-stream string]

showMetadata is undoable, queryable, and NOT editable.

This command is used to show metadata values which is in the specified channels "vertex", "edge", "face", and "vertexFace" in the viewport. You can view the data by three ways:

  1. "color": draw color on the components.
  2. "ray": draw a ray on the components.
  3. "string": draw 2d strings on the components.
For example, if the metadata of "shape.vtx[1]" is (1, 0, 0), you can turn on the visualization with all three modes. On "color" mode, you can see a red vertex which is on the position of "shape.vtx[1]". On "ray" mode, you can see a ray with the direction (1, 0, 0). On "string" mode, you can see strings "1 0 0" below the vertex in the viewport.

To use "color" or "ray" mode, you should make the member of the data structure with three or less items, such as float[3]. The three items are mapped to "RGB" as a color, or "XYZ" as a vector. The structure with two items works similarly. The only difference is that the third value will always be zero. However, if the structure has only one item, the value is mapped to all three variables. That means if the structure is "int" and its value is 1, the color will be white(1, 1, 1) and the vector will be (1, 1, 1).

You can get the current status of the flags on the query mode (using "-query"). But you can query only the status of one flag in a single command and you cannot set values on the query mode.

You can use the command on some specified objects, or run it with no arguments to make changes on all objects in the scene. The object must be a mesh shape. Components are not allowed as the command arguments.

Return value

stringresult of the operation or the queried status

In query mode, return type is based on queried flag.

Keywords

metadata, component, stream, channel, association

Related

addMetadata, applyMetadata, dataStructure, editMetadata, getMetadata, hasMetadata

Flags

auto, dataType, interpolation, isActivated, listAllStreams, listMembers, listValidMethods, listVisibleStreams, member, method, off, range, rayScale, stream
Long name (short name) Argument types Properties
-auto(-a) createquery
Similar to the flag "-range", but uses the min/max value from the metadata in the same stream and member instead of the specified input value. In query mode, you can use the flag to query if "auto" is on.
-dataType(-dt) string createquery
In create mode, when used with the flags "stream" and "member", specify a member to show. If the flag "off" is used, specify the member to turn off. In query mode, when used with the flags "stream" and "member", query the visualization state of the specified member. Only one member of each shape can be visualized at a time.

In query mode, this flag can accept a value.

-interpolation(-i) boolean createquery
In create mode, enable/disable interpolation for "color" method. When interpolation is on, the components will be displayed in the interpolated color, which is computed by averaging their metadata values. In query mode, query the current state of interpolation flag of the selected objects.
-isActivated(-ia) createquery
Used to check if the given stream is activated. If some shapes are selected, query their states. If no shape is selected, query the states of all shapes in the scene.
-listAllStreams(-las) createquery
Used with object names to list all streams of the specified objects. no matter if they are visible in the viewport. Or you can use the flag individually to list all streams in the scene. Due to the fact that different objects may have the same stream name, the returned list will merge the duplicated stream names automatically.
-listMembers(-lm) createquery
Used with the flag 'stream' to get the member list in the specified stream.
-listValidMethods(-lvm) createquery
List the valid visual methods that can be set for the current stream and member. Some data type cannot be displayed by some methods. For example, if the data type is "string", it cannot be displayed by "color" or by "ray". In other words, only the method "string" will be returned when you list the methods.
-listVisibleStreams(-lvs) createquery
Used with object names to list the name of the current visible streams of the specified object. Or you can use the flag with no object name to list all visible streams in the scene.
-member(-mb) string createquery
In create mode, when used with the flags "stream" and "dataType", specify a member to show. If the flag "off" is on, specify the member to turn off. In query mode, when used with the flags "stream" and "dataType", query the visualization state of the specified member. Only one member of each shape can be visualized at a time.

In query mode, this flag can accept a value.

-method(-m) string createquery
Determine the method of visualization: "color" convert metadata to a color value and draw the components with the color "ray" convert metadata to a vector and draw this vector line which starts from the center of the component "string" display the metadata through 2d string beside the component in the viewport The argument must be a string and must be one of the three words. The default method is "color". If the data type is string, you can only show it with "string" method. In query mode, you can use the flag with no arguments to query the method of a specified stream and member.
-off(-) createquery
In create mode, turn off the member which is specified by the flags "stream", "member" and "dataType".
-range(-r) float float createquery
Specify the range of data to use. The value which is out of the range will be clamped to the min/max value. If the method of visualization is "color", the range will be mapped to the color. That means the min value will be displayed in black while the max value will be in white. In query mode, you can use the flag individually to query the current range.
-rayScale(-rs) float createquery
Specify the scale of the ray to display it with a proper length.
-stream(-s) string createquery
In create mode, when used with the flags "member" and "dataType", specify a member to show. If the flag "off" is used, specify the member to turn off. In query mode, when used with the flags "member" and "dataType", query the visualization state of the specified member. When used with the flag "listMembers", query the members in the specified stream. Only one member of each shape can be visualized at a time.

In query mode, this flag can accept a value.


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.

MEL examples

//Create a scene
file -force -new ;
dataStructure -format "raw" -asString "name=StructOne:int32=MemberOne";
polyPlane -constructionHistory false -name "mesh";
//Add Metadata
addMetadata -streamName "StreamOne" -channelName "vertex" -structure "StructOne" meshShape ;
editMetadata -streamName "StreamOne" -channelName "vertex" -memberName "MemberOne" -value 1 meshShape.vtx[1];
select -clear;
showMetadata -stream "StreamOne" -member "MemberOne" -dataType "int32" meshShape;
//Show metadata for which the member is "MemberOne" and the stream is "StreamOne"
showMetadata -stream "StreamOne" -member "MemberOne" -dataType "int32" -method "color" meshShape;
//StreamOne will be visualized by Component Color method. The other two visualization methods are
//"string" and "ray". If "-method" flag is not defined, "color" will be used by default
showMetadata -off;
//Deactivate all streams to turn off metadata visualization
showMetadata -stream "StreamOne" -member "MemberOne" -dataType "int32" -method "color" -interpolation true meshShape;
//Enable interpolation on "color" mode. Interpolation must be used with "color" method
showMetadata -range 0 10 -stream "StreamOne" -member "MemberOne" -dataType "int32" meshShape;
//Show metadata between a specified range from 0 to 10. If the method is "color",
// the value 0 will be displayed in black, while the value 10 will be displayed
// in white. The value beyond the range will be clamped to 0 or 10.
showMetadata -auto -stream "StreamOne" -member "MemberOne" -dataType "int32" meshShape;
//Show metadata between the dynamic range, which is computed by the current min/max value.
showMetadata -query -listAllStreams;
//Return all streams in the scene, no matter if they are activated
showMetadata -query -listAllStreams meshShape;
//Return all streams of meshShape, no matter if they are activated
showMetadata -query -listVisibleStreams;
//Return the stream name(s) being visualized in the scene
showMetadata -query -listVisibleStreams meshShape;
//Return the stream name being visualized that is attached to meshShape
showMetadata -query -stream "StreamOne" -listMembers;
//Return the member names and types in the specified stream and member
//The names and types are returned in pair, such as "MemberOne int32 MemberTwo float"
showMetadata -query -stream "StreamOne" -member "MemberOne" -dataType "int32" -method;
//Return the visualization method of the visualized StreamOne and MemberOne
showMetadata -query -stream "StreamOne" -member "MemberOne" -dataType "int32" -listValidMethods;
//Return the valid visual methods of the activated stream and member that can be set
showMetadata -query -stream "StreamOne" -member "MemberOne" -dataType "int32" -range;
//Return the current range of visible metadata
showMetadata -query -stream "StreamOne" -member "MemberOne" -dataType "int32" -auto;
//Return the current state of the auto flag