Since | 17.5 |
このノードは、
Python Server、
Houdini Server Begin、
Maya Server Begin、
Nuke Server Beginなどの共有サーバーと併せて使用する必要があります。
このノードは、その共有サーバーが対応している内容に応じて、コマンドまたはカスタムコードをサーバーに送信します。 Houdini Server はHOM APIを使用したPythonコードを実行し、 Maya Server はMELまたはPythonを使用し、汎用コマンドサーバーはそのサーバーの実装で定義されているフォーマットを使用します。
Pythonコードを実行すると、work_item
オブジェクトが自動的に利用可能になります。
これを使用することで、PDGからデータを読み書きすることができます。
このwork_item
オブジェクトはpdg.WorkItem APIのサブセットに対応しています。
myattr_value = work_item.stringAttribValue('myattr') file_path = save_my_file(myattr_value) work_item.addResultData(file_path)
By default the command script is evaluated in a context that’s shared between all work items that run in the same service block. This means that module imports and variables that are declared in the script are accessible to all subsequent script evaluations. If you want to avoid modifying the global context, you can set the Evaluation Context parameter to Shared, Discard Changes instead. Any imports or declared variables will only be valid for the duration of the script, but the script will still have access to variables from tasks in other nodes. It’s also.possible to change the behavior of the script so that it runs in its own completely standalone context by setting the Evaluation Context parameter to Standalone.
Note
このノードをMaya Serverと併用すると、そのコマンドスクリプトは、そのスクリプトの1行目が
//mel
でない限りPythonコードであると想定されます。
//mel
だった場合は、そのスクリプトテキストはMELコードとして扱われます。
このMELスクリプトの最後の行は、 Command Send work_item
に追加される値を決定します。
パラメータ ¶
Command ¶
Generate When
このノードがワークアイテムを生成するタイミングを決めます。 このノードがどの生成モードを必須にしているのか、もしくは、ワークアイテムを動的に生成させる必要があるのかどうか分からないのであれば、通常では、これを“Automatic”のままに設定してください。
All Upstream Items are Generated
このノードは、すべての入力ノードが自身のワークアイテムを生成した時にワークアイテムを生成します。
All Upstream Items are Cooked
このノードは、すべての入力ノードが自身のワークアイテムをクックした時にワークアイテムを生成します。
Each Upstream Item is Cooked
このノードは、入力ノード内のワークアイテムがクックされる度にワークアイテムを生成します。
Automatic
入力ノードの生成モードに基づいて生成モードが選択されます。 入力ノードのどれかがその入力のクック時にワークアイテムが生成されている場合、このノードには Each Upstream Item is Cooked が設定されます。 そうでない場合、 All Upstream Items are Generated が設定されます。
Cache Mode
ワークアイテムから目的のファイル結果がレポートされるように、プロセッサノードがそのワークアイテムを制御する方法を決めます。
Automatic
目的の結果ファイルがディスク上に存在すれば、そのワークアイテムはスケジュールに組まれずにクック済みとマークされます。 そのファイルが 存在しなければ 、そのワークアイテムは通常どおりにスケジュールに組まれます。 上流のワークアイテムの依存関係がクック中に新しいファイルを書き出す場合、このノード内のワークアイテムのキャッシュファイルもout-of-date(古い)としてマークされます。
Automatic (Ignore Upstream)
Automatic と同様ですが、上流のファイルの書き込みは、このノード内のワークアイテムのキャッシュファイルを 無効にしません 。 そして、このノードは自身のワークアイテムの出力ファイルのみをチェックします。
Read Files
目的の結果ファイルがディスク上に存在すれば、そのワークアイテムはスケジュールに組まれずにクック済みとマークされます。 そのファイルが存在しなければ、そのワークアイテムは失敗とマークされます。
Write Files
目的の結果ファイルがディスク上に存在していても、ワークアイテムが常にスケジュールに組まれ、その目的の結果ファイルを無視します。
Evaluation Context
This parameter determines which context/namespace the script code should run under. By default the script runs in a shared namespace, so any declared variables or imported modules will be available to subsequent Service Block Send work items. It’s also possible to run the script in its own local context, which is isolated to the work item.
Standalone
The work item’s script runs in its own local context.
It has access to standard modules like pdgjson
, pdgcmd
, and hou
, but otherwise runs independently of any previous or subsequent work tiems.
Copy Spare Parms to Attributes
有効にすると、すべてのSpareパラメータがアトリビュートとして、生成されたワークアイテムにコピーされます。
コピーしたくないパラメータがある場合は、pdg::nocopy
タグを適用してください。
Remote Script
共有サーバーに送信するコードを指定します。
このサーバーが Houdini Server であれば、このパラメータにはHOM APIが利用可能なPythonコードを指定することができます。 このサーバーが Maya Server であれば、このパラメータにはMaya APIが利用可能なPythonコードを指定することができます。
Output ¶
See also |