setConstantPrimvar#

Fully qualified name: usdex::core::setConstantPrimvar

bool usdex::core::setConstantPrimvar(
pxr::UsdPrim prim,
const std::string &name,
float value,
pxr::UsdTimeCode time = pxr::UsdTimeCode::Default(),
)#

Set data on an existing constant primvar from a single scalar value.

This is a convenience wrapper around constructing PrimvarData with UsdGeomTokens->constant interpolation and a single-element values array, then calling setPrimvar() on the existing primvar. On failure a warning is emitted.

Parameters:
  • prim – The prim that owns the primvar

  • name – The primvar name (not including the primvars: prefix)

  • value – The constant primvar value

  • time – The time at which the value is written

Returns:

Whether the primvar was successfully set.