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

Synopsis

profilerTool([categoryView=boolean], [collapseSelectedEvents=boolean], [collapseSelectedEventsRepetition=boolean], [cpuView=boolean], [destroy=boolean], [eventTypes=boolean], [exists=boolean], [expandSelectedEvents=boolean], [expandSelectedEventsRepetition=boolean], [findNext=boolean], [findPrevious=boolean], [frameAll=boolean], [frameSelected=boolean], [isolateSegment=int], [make=boolean], [matchWholeWord=boolean], [searchEvent=string], [segmentCount=boolean], [showAllEvent=boolean], [showCriticalPath=boolean], [showHotspot=boolean], [showSelectedEvents=boolean], [showSelectedEventsRepetition=boolean], [threadView=boolean], [unisolateSegment=boolean])

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

profilerTool is NOT undoable, queryable, and editable.

This script is intended to be used by the profilerPanel to interact with the profiler tool's view (draw region). It can be used to control some behaviors about the profiler Tool.

Return value

None

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

Keywords

profiler, tool, profilerTool, timing, performance, profiling

Flags

categoryView, collapseSelectedEvents, collapseSelectedEventsRepetition, cpuView, destroy, eventTypes, exists, expandSelectedEvents, expandSelectedEventsRepetition, findNext, findPrevious, frameAll, frameSelected, isolateSegment, make, matchWholeWord, searchEvent, segmentCount, showAllEvent, showCriticalPath, showHotspot, showSelectedEvents, showSelectedEventsRepetition, threadView, unisolateSegment
Long name (short name) Argument types Properties
categoryView(cat) boolean edit
Change view mode to category view
collapseSelectedEvents(cs) boolean edit
Hide all sub-events of selected events so that only top-level events show
collapseSelectedEventsRepetition(csr) boolean edit
Hide all sub-events repetition of selected events based on their comment
cpuView(cpu) boolean edit
Change view mode to cpu view
destroy(dtr) boolean create
Destroy the profiler tool Internal flag. Should not be used by user.
eventTypes(et) boolean query
Return JSON data containing the list of event types on currently existing events. If the value of the flag is true then show only event types for selected events, otherwise show them for all events. The JSON return string will contain the event type information in the following format:
{
    "eventSummary" : [
        { "type"        : EVENT_TYPE_NAME,
        , "description" : EVENT_TYPE_DESCRIPTION,
        , "color"       : [ RED_AS_FLOAT, GREEN_AS_FLOAT, BLUE_AS_FLOAT ]
        , "category"    : CATEGORY_NAME
        , "count"       : EVENT_TYPE_COUNT
        }
    ]
}
"type" and "description" may be omitted, indicating that the results correspond to anonymous events.
exists(ex) boolean query
Query if the profiler tool view exists. Profiler tool can only exist after "profilerTool -make" is called.
expandSelectedEvents(es) boolean edit
Show all sub-events of selected events
expandSelectedEventsRepetition(esr) boolean edit
Show all sub-events repetition of selected events based on their comment
findNext(fn) boolean query
This flag is used along with flag -searchEvent.
findPrevious(fp) boolean query
This flag is used along with flag -searchEvent.
frameAll(fa) boolean edit
Frame on all events in the profilerToolView
frameSelected(fs) boolean edit
Frame on all selected events in the profilerToolView
isolateSegment(isolateSegment) int edit
Isolate a specified segment. A segment is a set of events that happened in one animation frame. You can use flag -segmentCount to query the number of segments in the event buffer. The segment index starts from 0. If the specified segment does not exist, an error will be thrown.
make(mk) boolean create
Make the profiler tool and parent it to the most recent layout created Internal flag. Should not be used by user.
matchWholeWord(mww) boolean edit
Tells profiler tool if it should match whole word when searching event(s). The default value is false.
searchEvent(se) string query
Search event(s). You can set -matchWholeWord before you use -searchEvent. If -matchWholeWord has been set to true, the profiler tool will search event(s) whose name exactly matches with the string. If -matchWholeWord has been set to false, the profiler tool will search event(s) whose name contains the string. If -findNext is also used along with this flag, the profiler tool will find the first event next to the current selected event. If -findPrevious is also used along with this flag, the profiler tool will find the first event previous to the current selected event. If currently don't have a selected event or there are multiple selected events, the search will start at the first event in profiler buffer. If -findNext and -findPrevious are not used along with this flag, the profiler tool will find all events.

In query mode, this flag needs a value.

segmentCount(sc) boolean query
Returns the number of segments in the event buffer.
showAllEvent(sa) boolean edit
Show all events (if events were hidden by filtering) (true) or Hide all events (false)
showCriticalPath(scp) boolean edit
Show critical path of selected frame
showHotspot(sh) boolean edit
Show hotspot of selected frame
showSelectedEvents(ss) boolean edit
Show only the selected events (true) or hide all selected events (false)
showSelectedEventsRepetition(ssr) boolean edit
Show only the selected events repetition based on their comment (true) or Hide all selected events repetition based on their comment (false)
threadView(thd) boolean edit
Change view mode to thread view
unisolateSegment(uis) boolean edit
Unisolate current isolated segment. If no segment is currently isolated, nothing will happen.

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


#First record/load a profile
#Frame the tool's view on all recorded events.
cmds.profilerTool( edit = True, frameAll = True )

#Frame selected events
cmds.profilerTool( edit = True, frameSelected = True )

#Change to cpu view
cmds.profilerTool( edit = True, cpuView = True )

#Show only selected events
cmds.profilerTool( edit = True, showSelectedEvents = True )

#Show all events
cmds.profilerTool( edit = True, showAllEvent = True )

#Hide all events that have same comment as selected events
cmds.profilerTool( edit = True, showSelectedEventsRepetition = False )

#Show hotspot
cmds.profilerTool( edit = True, showHotspot = True )

#Find all events whose name contains "abc"
cmds.profilerTool( query = True, searchEvent = "abc" )

#Find the first event, whose name exactly matches with "def", next to current selected event
cmds.profilerTool( edit = True, matchWholeWord = True )
cmds.profilerTool( query = True, searchEvent = "def", findNext = True )

#Query the active event types
cmds.profilerTool( query = True, eventTypes = True )

#Query segment count in buffer
cmds.profilerTool( query = True, segmentCount = True )

#Isolate the first segment
cmds.profilerTool( edit = True, isolateSegment = 0 )

#Unisolate segment
cmds.profilerTool( edit = True, unisolateSegment = True )