createConstantPrimvar#

Fully qualified name: usdex::core::createConstantPrimvar

pxr::UsdGeomPrimvar usdex::core::createConstantPrimvar(
pxr::UsdPrim prim,
const std::string &name,
const pxr::GfVec3f &value,
const pxr::SdfValueTypeName &valueTypeName = pxr::SdfValueTypeName(),
)#

Create and author a constant primvar on a prim from a single vector value.

This is an overloaded member function, provided for convenience. It differs from the above function only in what arguments it accepts.

Parameters:
  • prim – The prim on which to create the primvar

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

  • value – The constant primvar value

  • valueTypeName – Optional USD value type for the primvar attribute. When omitted, Float3Array is used. Color3fArray, Normal3fArray, and Point3fArray are also supported. The scalar types Color3f, Normal3f, and Point3f are accepted as aliases and are converted to their corresponding array types internally.

Returns:

The authored UsdGeomPrimvar, or an invalid one if authoring failed.