プリミティブパターンに関する情報は、プリミティブマッチングパターンを参照してください。
メソッド ¶
__init__(pattern=None)
デフォルト設定でLopSelectionRuleオブジェクトを作成します。
オプションのpatternパラメータは、そこで指定したパターン文字列を選択ルールに入れます。
これは、選択ルールを作成してからhou.LopSelectionRule.setPathPatternをコールすることと同じです。
collectionAwarePaths(lopnode=None, fallback_to_new_paths=False, stage=None, use_last_cook_context_options = True, lop_output_index = -1)
→ tuple
of pxr.Sdf.Path
lopnodeパラメータで指定したLOPノードオブジェクトのシーングラフを使って、シーングラフプリミティブの選択を計算します。
この選択ルールがhou.LopNode.selectionRuleのコールによって作成されていた場合、そのlopnodeパラメータは、作成元ノードと同じと見なされます。
LOPノードを指定せずにstageパラメータを指定した場合、パターンは、そのstageパラメータに渡されたUsd.Stageを評価するようになります。
LOPノードとUsd.Stageの両方を指定した場合、stageパラメータが優先されます。
すべてのシーングラフプリミティブのフルパス、または、選択パターンに合致したコレクションのフルパスを返します。
expandedPathsメソッドとは違って、そのコレクションの内容はプリミティブとして明示的にリストされるように展開されません。
代わりに、コレクションのフルパスそのものが返されます。
その包含コレクションを正確に追跡できないような排他がプリミティブパターンに含まれていた場合、このメソッドの結果はexpandedPathsと同じになります。
fallback_to_new_pathsパラメータをTrueに設定することで、パターンがステージ上のどの既存プリミティブにも該当しない明示的なパスで完全に構成されていた場合に、選択ルールはシーングラフパスを返すことができます。
そのようなパスを使用して、新しいプリミティブの望ましいシーングラフ場所を表現することができます。
既存パスと新しいパスがそのパターンに混在していた場合、このメソッドは常にその既存パスのみを返します。
そのような場合での新しいパスは、hou.LopSelectionRule.newPathsをコールすることでアクセスすることができます。
use_last_cook_context_optionsフラグは、lopnodeをクックする際にこのノードで使用されているコンテキストオプションがグローバルのコンテキストオプションセットに存在しなければ、以前のクックで使用されたコンテキストオプション値を使用するように指定します。
If the HOUDINI_NEW_CONTEXT_OPTION_RULES environment
variable is set, the last cook context options will take priority over any
global options, unless the node being cooked has its display flag set in
which case last cook context options are never used.
The lop_output_index specifies which output of a multi-output LOP to
inspect. The special value -1 in most cases is simply treated as meaning
0 (the first output). However, when use as part of a parameter expression
in a LOP node, it indicates the output that is connected to the input of
the node that owns the parameter being evaluated. This can greatly simplify
the authoring of expressions that need to access data from the connected
input LOP.
expandedPaths(lopnode=None, return_ancestors=False, fallback_to_new_paths=False, stage=None, use_last_cook_context_options = True, lop_output_index = -1)
→ tuple
of pxr.Sdf.Path
lopnodeパラメータで指定したLOPノードオブジェクトのシーングラフを使って、シーングラフプリミティブの選択を計算します。
この選択ルールがhou.LopNode.selectionRuleのコールによって作成されていた場合、そのlopnodeパラメータは、作成元ノードと同じと見なされます。
LOPノードを指定せずにstageパラメータを指定した場合、パターンは、そのstageパラメータに渡されたUsd.Stageを評価するようになります。
LOPノードとUsd.Stageの両方を指定した場合、stageパラメータが優先されます。
選択ルールに合致したシーングラフプリミティブすべてのフルパスを返します。 パスパターン内のすべてのコレクションは、そのコレクションに含まれているプリミティブが明示的にリストされるように展開されます。
return_ancestorsをTrueに設定すると、全セットのPrimsが計算された後に、そのセット内のPrimを直属の子PrimとするPrimが存在すれば、
その親Primがそのセットに追加され、その子Primがそのセットから除外されます。
これによって削減されたセットは、もし変更がScene Graph Tree下に継承される変更(可視性やアクティブ化など)であった場合に、その変更する必要のあるPrimの数を減らすのに役立ちます。
fallback_to_new_pathsパラメータをTrueに設定することで、パターンがステージ上のどの既存プリミティブにも該当しない明示的なパスで完全に構成されていた場合に、選択ルールはシーングラフパスを返すことができます。
そのようなパスを使用して、新しいプリミティブの望ましいシーングラフ場所を表現することができます。
既存パスと新しいパスがそのパターンに混在していた場合、このメソッドは常にその既存パスのみを返します。
そのような場合での新しいパスは、hou.LopSelectionRule.newPathsをコールすることでアクセスすることができます。
use_last_cook_context_optionsフラグは、lopnodeをクックする際にこのノードで使用されているコンテキストオプションがグローバルのコンテキストオプションセットに存在しなければ、以前のクックで使用されたコンテキストオプション値を使用するように指定します。
If the HOUDINI_NEW_CONTEXT_OPTION_RULES environment
variable is set, the last cook context options will take priority over any
global options, unless the node being cooked has its display flag set in
which case last cook context options are never used.
The lop_output_index specifies which output of a multi-output LOP to
inspect. The special value -1 in most cases is simply treated as meaning
0 (the first output). However, when use as part of a parameter expression
in a LOP node, it indicates the output that is connected to the input of
the node that owns the parameter being evaluated. This can greatly simplify
the authoring of expressions that need to access data from the connected
input LOP.
firstPath(lopnode=None, return_ancestors=False, fallback_to_new_paths=False, stage=None, use_last_cook_context_options = True, lop_output_index = -1)
→ pxr.Sdf.Path
hou.LopSelectionRule.expandedPathsとまったく同じ挙動をしますが、これは、すべてのマッチから(アルファベット順で)最初にマッチした単一パスのみ、または、何もマッチしなければ最初の新しいパスを返します。
use_last_cook_context_optionsフラグは、lopnodeをクックする際にこのノードで使用されているコンテキストオプションがグローバルのコンテキストオプションセットに存在しなければ、以前のクックで使用されたコンテキストオプション値を使用するように指定します。
If the HOUDINI_NEW_CONTEXT_OPTION_RULES environment
variable is set, the last cook context options will take priority over any
global options, unless the node being cooked has its display flag set in
which case last cook context options are never used.
The lop_output_index specifies which output of a multi-output LOP to
inspect. The special value -1 in most cases is simply treated as meaning
0 (the first output). However, when use as part of a parameter expression
in a LOP node, it indicates the output that is connected to the input of
the node that owns the parameter being evaluated. This can greatly simplify
the authoring of expressions that need to access data from the connected
input LOP.
newPaths(lopnode=None, stage=None, use_last_cook_context_options = True, lop_output_index = -1)
→ tuple
of pxr.Sdf.Path
lopnodeパラメータで指定したLOPノードオブジェクトのシーングラフを使用して、シーングラフプリミティブ選択を計算します。
hou.LopNode.selectionRuleコールを使ってこの選択ルールを作成した場合、そのlopnodeパラメータは、作成元ノードと同じと見なされます。
LOPノードを指定せずにstageパラメータを指定した場合、パターンは、そのstageパラメータに渡されたUsd.Stageを評価するようになります。
LOPノードとUsd.Stageの両方を指定した場合、stageパラメータが優先されます。
パターンが明示的なパスで完全に構成されていない限り、このメソッドは何も返しません。 このメソッドは、USDステージ上の既存プリミティブを表現したパスを返しません。
use_last_cook_context_optionsフラグは、lopnodeをクックする際にこのノードで使用されているコンテキストオプションがグローバルのコンテキストオプションセットに存在しなければ、以前のクックで使用されたコンテキストオプション値を使用するように指定します。
If the HOUDINI_NEW_CONTEXT_OPTION_RULES environment
variable is set, the last cook context options will take priority over any
global options, unless the node being cooked has its display flag set in
which case last cook context options are never used.
The lop_output_index specifies which output of a multi-output LOP to
inspect. The special value -1 in most cases is simply treated as meaning
0 (the first output). However, when use as part of a parameter expression
in a LOP node, it indicates the output that is connected to the input of
the node that owns the parameter being evaluated. This can greatly simplify
the authoring of expressions that need to access data from the connected
input LOP.
lastError()
→ str
expandedPathsまたはcollectionAwarePathsが最後にコールされた時に生成された状態またはエラーのメッセージ。
通常では、ここには無効なパターン文字列に関する情報が含まれます。
lastErrorSeverity()
→ hou.severityType
expandedPathsまたはcollectionAwarePathsが最後にコールされた時のエラー状態。
この値がhou.severityType.None以外の場合、lastErrorメソッドは、もっと多くの情報を含んだ文字列を返します。
lastMayBeTimeVarying()
→ bool
この選択ルールのメンバーの最新の計算が時間の変化で結果が変わるかどうかを示したブール値。 選択ルールが何かしらのプリミティブのトランスフォームや境界ボックスなどの時間可変アトリビュートに依存している場合に、これが起こる可能性があります。
pathPattern()
→ str
この選択ルールに使用されているパスパターン文字列を返します。
setPathPattern(pattern)
この選択ルールに使用するパスパターン文字列を設定します。
パターン構文に関しては/solaris/pattern.html#syntaxを参照してください。
traversalDemands()
→ int
シーングラフを走査して合致項目を見つけた時のUSDプリミティブ上に作成されているDemandを表現した整数値を返します。
setTraversalDemands(options)
シーングラフを走査する時にプリミティブが満たさなければならないDemandを設定します。 これらのDemandは整数値として表現します。この値は、hou.lopTraversalDemandsの値の組み合わせで表現することができます。
複数のDemandは|演算子を使って組み合わせることができます。
以下のコードは、アクティブ且つ定義されているUSDプリミティブのみを返すルールを構築します:
>>> rule = hou.LopSelectionRule() >>> rule.SetTraversalDemands(hou.lopTraversalDemands.Active | hou.lopTraversalDemands.Defined)
icon()
→ str
Scene Graph TreeペインのCollectionsサブペインに選択ルールを表示した時のこの選択ルールに関連付けられているアイコンを返します。
setIcon(icon)
Scene Graph TreeペインのCollectionsサブペイン内のこの選択ルールに関連付けたいアイコンファイルのパスを設定します。 この文字列には、ディスク上の画像ファイルまたはSVGファイルのパス、または、標準のHoudiniアイコンの名前を指定することができます。
sourceNode()
→ hou.LopNode or None
hou.LopNode.selectionRuleコールによってルールが作成された場合、そのルールの作成に使用されたLOPノードを返します。
それ以外の場合、Noneを返します。
sourceNodeInputIndex()
→ int
hou.LopNode.selectionRuleコールによってルールが作成された場合、そのルールの作成に使用された入力インデックスパラメータを返します。
それ以外の場合、-1を返します。