ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. 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
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
sampling(s) boolean createquery
切り替え: イベント記録の有効/無効を切り替えます。照会: イベントの記録がオンになっている場合に返されます。
output(o) string createquery
記録したイベントを指定のファイルに出力します。
load(l) string createquery
指定のファイルから記録されたイベントを読み込みます。
reset(r) boolean createquery
プロファイラのデータをリセットします(サンプリングがオフになっていることが必要)。
bufferSize(b) int createquery
切り替え: 指定したイベントの数に適合するようにバッファ サイズを変更します(サンプリングがオフになっていることが必要)。照会: 現在のバッファ サイズを返します。新しいバッファ サイズは次のサンプリングが開始されたときに有効になります。バッファが一杯になると、記録が停止します。
addCategory(a) string create
プロファイラに新しいカテゴリを追加します。新しいカテゴリのインデックスを返します。
removeCategory(rc) string create
プロファイラの既存のカテゴリを削除します。除去されたカテゴリのインデックスを返します。
allCategories(ac) boolean query
すべてのカテゴリの名前を照会します。
categoryNameToIndex(cni) string createquery
カテゴリのインデックスを指定した名前で返します。

照会モードでは、このフラグに値が必要になります。

categoryIndexToName(cin) int createquery
カテゴリの名前を指定したインデックスで返します。

照会モードでは、このフラグに値が必要になります。

categoryIndex(ci) int createquery
その他のフラグと一緒に使用し、カテゴリのインデックスを示します。

照会モードでは、このフラグに値が必要になります。

categoryName(cn) string query
その他のフラグと一緒に使用し、カテゴリの名前を示します。

照会モードでは、このフラグに値が必要になります。

categoryRecording(cr) boolean createquery
切り替え: カテゴリ記録の有効/無効を切り替えます。照会: カテゴリの記録がオンになっている場合に返されます。照会するカテゴリを指定するには、-categoryIndex または -categoryName フラグが必要です。
eventCount(ec) boolean query
バッファ内のイベントの数を照会します。
eventIndex(ei) int query
通常はその他のフラグと一緒に使用され、イベントのインデックスを示します。

照会モードでは、このフラグに値が必要になります。

eventStartTime(et) boolean query
指定したインデックスにあるイベントの時間を照会します。時間の単位は「秒」です。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventDuration(edu) boolean query
指定したインデックスにあるイベントの継続期間を照会します。時間の単位は「マイクロ秒」です。シグナル イベントの継続期間は 0 になります。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventName(en) boolean query
指定したインデックスにあるイベントの名前を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventDescription(ed) boolean query
指定したインデックスにあるイベントの説明を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventCategory(eca) boolean query
指定したインデックスに属するイベントのカテゴリ インデックスを照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventColor(eco) boolean query
指定したインデックスにあるイベントのカラーを照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventThreadId(eti) boolean query
指定したインデックスにあるイベントのスレッド ID を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
eventCPUId(eci) boolean query
指定したインデックスにあるイベントの CPU ID を照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。
signalEvent(sig) boolean query
指定したインデックスにあるイベントがシグナル イベントかどうかを照会します。照会するイベントを指定するには、-eventIndex フラグが必要です。シグナル イベントは開始モーメントのみを記憶し、継続期間については記憶しません。このため、このイベントが発生するのが重要で、継続期間は重要ではない場合にのみ使用できます。
instrumentMel(instrumentMel) boolean create
MEL コマンドまたはプロシージャの計測の有効/無効を切り替えます。計測が有効になっている場合、実行された MEL コマンドまたはプロシージャが[プロファイラ]ウィンドウにプロファイルされて表示されます。計測を有効にするには、-procedureName、-colorIndex、および -categoryIndex フラグが必要です。計測を無効にするには、-procedureName フラグが必要です。
colorIndex(coi) int create
"-instrumentMel true" と共に使用して、プロファイリング結果に表示するカラー インデックスを指定します。
procedureName(pn) string create
-instrumentMel と共に使用して、計測を有効化/無効化するプロシージャの名前を指定します。
procedureDescription(pd) string create
"-instrumentMel true" と共に使用して、計測される MEL コマンドまたはプロシージャの説明を提供します。この説明は、[プロファイラ ツール]ウィンドウに表示されます。
signalMelEvent(sim) boolean create
"-instrumentMel true" と共に使用して、計測された MEL コマンドまたはプロシージャがプロファイリング中にシグナル イベントとして使われることをプロファイラに伝えます。シグナル イベントは開始モーメントのみを記憶し、継続期間については記憶しません。このため、このイベントが発生するのが重要で、継続期間は重要ではない場合にのみ使用できます。
clearAllMelInstrumentation(cam) boolean create
MEL コマンドまたはプロシージャの計測をすべてクリアします。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。

Python 例

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)