You can tag nodes so that they appear in the Profiler with a color and name you can identify, for example "arm", "face", and so on, for a more convenient way to locate performance bottlenecks. The tags are created by adding two sets of metadata: one for the node name and one to assign a color. See also Add metadata to Maya nodes and Visualizing metadata for more information about using metadata to identify Maya nodes as well as components (vertices, faces, and edges, and vertex faces) of Maya mesh objects.
To tag objects so they appear in the Profiler
global proc addProfilerTag(string $tagValue, int $r, int $g, int $b) { // Add the profile tag data structures we need dataStructure -format "raw" -asString "name=NodeProfileStruct:string=NodeProfileTag:int32=NodeProfileTagColor"; // set the channels addMetadata -streamName "ProfileTagStream" -channelName "ProfileTag" -structure "NodeProfileStruct"; addMetadata -streamName "ProfileTagColorStream" -channelName "ProfileTagColor" -structure "NodeProfileStruct"; // set the actual data editMetadata -streamName "ProfileTagStream" -memberName "NodeProfileTag" -channelName "ProfileTag" -stringValue $tagValue -index 0; editMetadata -streamName "ProfileTagColorStream" -memberName "NodeProfileTagColor" -channelName "ProfileTagColor" -value $r -index 0; editMetadata -streamName "ProfileTagColorStream" -memberName "NodeProfileTagColor" -channelName "ProfileTagColor" -value $g -index 1; editMetadata -streamName "ProfileTagColorStream" -memberName "NodeProfileTagColor" -channelName "ProfileTagColor" -value $b -index 2;
select -r <elementname>;
Where <elementname> is what the element is called in the scene. For example, for an object named secondBlendShape use:
select -r secondBlendShape;addProfilerTag("Blendshape2", 255, 0, 200); getMetadata -streamName "ProfileTagStream" -memberName "NodeProfileTag" -channelName "ProfileTag" -index "0";