ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. Python 例.
profiler([addCategory=string], [allCategories=boolean], [bufferSize=int], [categoryIndex=int], [categoryIndexToName=int], [categoryName=string], [categoryNameToIndex=string], [categoryRecording=boolean], [clearAllMelInstrumentation=boolean], [colorIndex=int], [eventCPUId=boolean], [eventCategory=boolean], [eventColor=boolean], [eventCount=boolean], [eventDescription=boolean], [eventDuration=boolean], [eventIndex=int], [eventName=boolean], [eventStartTime=boolean], [eventThreadId=boolean], [instrumentMel=boolean], [load=string], [output=string], [procedureDescription=string], [procedureName=string], [removeCategory=string], [reset=boolean], [sampling=boolean], [signalEvent=boolean], [signalMelEvent=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
profiler は、取り消し不可能、照会可能、および編集不可能です。
プロファイラは、シーン、スクリプト、およびプラグインのパフォーマンスを調整するための補助として、Maya のキー イベントからタイミング情報を記録するために使用されます。ユーザ記述のプラグインと Python スクリプトにより、API の MProfilingScope および MProfiler クラスを使用して、ユーザ独自のコードのためのプロファイリング情報を生成することもできます。
このコマンドには、プロファイリング データのコレクションをコントロールしたり、記録されたイベントに関する情報を照会したりするための機能があります。また、記録された情報は、[プロファイラ]ウィンドウでグラフィカルに表示することができます。
サンプリングがアクティブな場合はバッファ サイズを変更することはできず、エラーが返されます。サンプリングがアクティブな場合はリセット フラグをコールすることはできず、エラーが返されます。バッファ サイズに対するすべての変更は、次の記録の開始時に適用されます。同一のコマンドで保存とロードを行うことはできません。保存が優先されるため、ロードは無視されます。
なし
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
timing, performance, profiling, optimize
dgtimer
addCategory, allCategories, bufferSize, categoryIndex, categoryIndexToName, categoryName, categoryNameToIndex, categoryRecording, clearAllMelInstrumentation, colorIndex, eventCPUId, eventCategory, eventColor, eventCount, eventDescription, eventDuration, eventIndex, eventName, eventStartTime, eventThreadId, instrumentMel, load, output, procedureDescription, procedureName, removeCategory, reset, sampling, signalEvent, signalMelEvent
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
import maya.cmds as cmds
#Start profiling
cmds.profiler(sampling = True)
#Wait for events to be profiled
#Stop profiling
cmds.profiler(sampling = False)
#Output the result to a file
cmds.profiler(output = "test.txt")
#Load a recording from a file to the buffer
cmds.profiler(load = "test.txt")
#Reset the tool
cmds.profiler(reset = True)
#Set the profiler's buffer size to fit 5 megaBytes
cmds.profiler(bufferSize = 5)
#Query the profiler's buffer size
cmds.profiler(query = True, bufferSize = True)
#Add a new category
cmds.profiler(addCategory = "Test Category")
#Remove an existing category
cmds.profiler(removeCategory = "Test Category")
#Query the number of categories
cmds.profiler(query = True, categoryCount = True)
#Query the name of the category at the given index
cmds.profiler(query = True, categoryIndexToName = 5)
#Query the index of the category with the given name
cmds.profiler(query = True, categoryNameToIndex = "Maya Qt")
#Query if it is enabled for the recording of the category at the given index
cmds.profiler(query = True, categoryRecording = True, categoryIndex = 5)
#Query if it is enabled for the recording of the category with the given name
cmds.profiler(query = True, categoryRecording = True, categoryName = "Maya Qt")
#Enable/Disable the recording of the category at the given index
cmds.profiler(categoryRecording = False, categoryIndex = 5)
#Query the number of the events in the buffer
cmds.profiler(query = True, eventCount = True)
#Query the time at which the event at the given index start
cmds.profiler(query = True, eventStartTime = True, eventIndex = 100)
#Query the duration of the event at the given index
cmds.profiler(query = True, eventDuration = True, eventIndex = 100)
#Query the name of the event at the given index
cmds.profiler(query = True, eventName = True, eventIndex = 100)
#Query the description of the event at the given index
cmds.profiler(query = True, eventDescription = True, eventIndex = 100)
#Query the category the the event at the given index belongs to
cmds.profiler(query = True, eventCategory = True, eventIndex = 100)
#Query the color of the event at the given index
cmds.profiler(query = True, eventColor = True, eventIndex = 100)
#Query the thread ID of the event at the given index
cmds.profiler(query = True, eventThreadId = True, eventIndex = 100)
#Query the CPU ID of the event at the given index
cmds.profiler(query = True, eventCPUId = True, eventIndex = 100)
#Query if the event at the given index is a signal event
cmds.profiler(query = True, signalEvent = True, eventIndex = 100)