Since | 19.0 |
int usd_iprimvarsize(<stage>stage, string primpath, string name)
This function returns the tuple size of a primvar found directly on the given primitive or inherited from primitive’s ancestor. If the primvar is an array, it returns the tuple size of the array element. E.g., for vector types, this is the number of components.
<stage>
ノードのコンテキスト内(例えば、Wrangle LOP)で実行する時、ステージの読み込み先となる(0から始まる)入力番号を表現した整数をこの引数に指定することができます。 この整数は、特定の入力を参照する文字列形式(例えば、“opinput:0”)と等価です。
primpath
Primのパス。
name
Primvar name (without namespace).
Returns
The tuple size of the primvar.
-
For a vector type, this is the number of components.
-
For an integer, float, or string, this returns
1
. -
For an array primvar, this returns the tuple size of the elements.
If the primvar does not exist, returns 0
.
Use usd_iprimvarlen if you want to obtain the array primvar length.
Examples
// Get the tuple size of a primvar on the cube primitive or its ancestor. int tuple_size = usd_iprimvarsize(0, "/geo/cube", "primvar_name");
See also | |
usd | |
usd_primvar |
|