Houdini 19.0 VEX VEX Functions usd_flattenediprimvar

usd_flattenediprimvar VEX function

Reads the value of a flattened primvar directly from the USD primitive or from USD primitive’s ancestor.

Since 19.0

<type>[] usd_flattenediprimvar(<stage>stage, string primpath, string name)

<type>[] usd_flattenediprimvar(<stage>stage, string primpath, string name, float timecode)

This function returns a value of a flattened primvar on a given primitive or inherited from primitive’s ancestor.

Some primvars can be indexed, where the primvar is a compacted array of unique values, and there is an index array to map an entity to the value element. This function expands the compacted array by using the index array, and returns the expanded array of values.

<stage>

When running in the context of a node (such as a wrangle LOP), this argument can be an integer representing the input number (starting at 0) to read the stage from. The integer is equivalent to the string form referencing a particular input, e.g., “opinput:0”.

primpath

The path to the primitive.

name

Primvar name (without namespace).

timecode

The USD time code at which to evaluate the attribute. A USD time code roughly corresponds to a frame in Houdini. If not given, the time code corresponding to the current frame is used.

Returns

The flattened value of an existing primvar, or zero/empty value if the primvar does not exist. Use usd_isiprimvar if you want to check whether the primvar exists.

Examples

// Get the value of a flattened primvar on the cube primitive or cube's ancestor.
float flat_values[] = usd_flattenediprimvar(0, "/geo/cube", "primvar_name");

f[]@flat_primvar_at_current_frame = usd_flattenediprimvar(0, "/geo/sphere", "bar");
f[]@flat_primvar_at_frame_7       = usd_flattenediprimvar(0, "/geo/sphere", "bar", 7.0);
See also
usd

usd_addattrib

usd_addcollectionexclude

usd_addcollectioninclude

usd_addinversetotransformorder

usd_addorient

usd_addprim

usd_addprimvar

usd_addrelationshiptarget

usd_addrotate

usd_addscale

usd_addtotransformorder

usd_addtransform

usd_addtranslate

usd_attrib

usd_attribelement

usd_attriblen

usd_attribnames

usd_attribsize

usd_attribtimesamples

usd_attribtypename

usd_blockattrib

usd_blockprimvar

usd_blockprimvarindices

usd_blockrelationship

usd_boundmaterialpath

usd_clearmetadata

usd_cleartransformorder

usd_collectioncomputedpaths

usd_collectioncontains

usd_collectionexcludes

usd_collectionexpansionrule

usd_collectionincludes

usd_drawmode

usd_findtransformname

usd_flattenediprimvar

usd_flattenediprimvarelement

usd_flattenedprimvar

usd_flattenedprimvarelement

usd_getbbox

usd_getbbox_center

usd_getbbox_max

usd_getbbox_min

usd_getbbox_size

usd_getbounds

usd_getpointinstancebounds

usd_hasapi

usd_haspayload

usd_iprimvar

usd_iprimvarelement

usd_iprimvarelementsize

usd_iprimvarindices

usd_iprimvarinterpolation

usd_iprimvarlen

usd_iprimvarnames

usd_iprimvarsize

usd_iprimvartimesamples

usd_iprimvartypename

usd_isabstract

usd_isactive

usd_isarray

usd_isarrayiprimvar

usd_isarraymetadata

usd_isarrayprimvar

usd_isattrib

usd_iscollection

usd_iscollectionpath

usd_isindexediprimvar

usd_isindexedprimvar

usd_isinstance

usd_isiprimvar

usd_iskind

usd_ismetadata

usd_ismodel

usd_isprim

usd_isprimvar

usd_isrelationship

usd_isstage

usd_istransformreset

usd_istype

usd_isvisible

usd_kind

usd_localtransform

usd_makeattribpath

usd_makecollectionpath

usd_makepropertypath

usd_makerelationshippath

usd_makevalidprimname

usd_makevalidprimpath

usd_metadata

usd_metadataelement

usd_metadatalen

usd_metadatanames

usd_name

usd_parentpath

usd_pointinstance_getbbox

usd_pointinstance_getbbox_center

usd_pointinstance_getbbox_max

usd_pointinstance_getbbox_min

usd_pointinstance_getbbox_size

usd_pointinstance_relbbox

usd_pointinstancetransform

usd_primvar

usd_primvarattribname

usd_primvarelement

usd_primvarelementsize

usd_primvarindices

usd_primvarinterpolation

usd_primvarlen

usd_primvarnames

usd_primvarsize

usd_primvartimesamples

usd_primvartypename

usd_purpose

usd_relationshipforwardedtargets

usd_relationshipnames

usd_relationshiptargets

usd_relbbox

usd_removerelationshiptarget

usd_setactive

usd_setattrib

usd_setattribelement

usd_setcollectionexcludes

usd_setcollectionexpansionrule

usd_setcollectionincludes

usd_setdrawmode

usd_setkind

usd_setmetadata

usd_setmetadataelement

usd_setprimvar

usd_setprimvarelement

usd_setprimvarelementsize

usd_setprimvarindices

usd_setprimvarinterpolation

usd_setpurpose

usd_setrelationshiptargets

usd_settransformorder

usd_settransformreset

usd_setvariantselection

usd_setvisibility

usd_setvisible

usd_specifier

usd_transformname

usd_transformorder

usd_transformsuffix

usd_transformtype

usd_typename

usd_uniquetransformname

usd_variants

usd_variantselection

usd_variantsets

usd_worldtransform

usd_primvar

usd_flattenediprimvar