Primvar Data Management#
Utilities to author and inspect UsdGeomPrimvars
UsdGeomPrimvars
are often used when authoring UsdGeomPointBased
prims (e.g meshes, curves, and point clouds) to describe surface varying properties that can affect how a prim is rendered, or to drive a surface deformation.
However, UsdGeomPrimvar
data can be quite intricate to use, especially with respect to indexed vs non-indexed primvars, element size, the complexities of VtArray
detach (copy-on-write) semantics, and the ambiguity of “native” attributes vs primvar attributes (e.g. mesh normals).
These classes aim to provide simpler entry points to avoid common mistakes with respect to UsdGeomPrimvar
data handling.
Classes#
- usdex::core::PrimvarData
A templated read-only class to manage the components of
UsdGeomPrimvar
data as a single object without risk of detaching (copying) arrays.
Typedefs#
- usdex::core::FloatPrimvarData
An alias for
PrimvarData
that holdsVtFloatArray
values (e.g widths or scale factors).- usdex::core::Int64PrimvarData
An alias for
PrimvarData
that holdsVtInt64Array
values (e.g ids that might be very large).- usdex::core::IntPrimvarData
An alias for
PrimvarData
that holdsVtIntArray
values (e.g simple switch values or booleans consumable by shaders).- usdex::core::StringPrimvarData
An alias for
PrimvarData
that holdsVtStringArray
values (e.g human readable descriptors).- usdex::core::TokenPrimvarData
An alias for
PrimvarData
that holdsVtTokenArray
values (e.g more efficient human readable descriptors).- usdex::core::Vec2fPrimvarData
An alias for
PrimvarData
that holdsVtVec2fArray
values (e.g texture coordinates).- usdex::core::Vec3fPrimvarData
An alias for
PrimvarData
that holdsVtVec3fArray
values (e.g normals, colors, or other vectors).
Typedefs#
-
using usdex::core::FloatPrimvarData = PrimvarData<float>#
An alias for
PrimvarData
that holdsVtFloatArray
values (e.g widths or scale factors).
-
using usdex::core::Int64PrimvarData = PrimvarData<int64_t>#
An alias for
PrimvarData
that holdsVtInt64Array
values (e.g ids that might be very large).
-
using usdex::core::IntPrimvarData = PrimvarData<int>#
An alias for
PrimvarData
that holdsVtIntArray
values (e.g simple switch values or booleans consumable by shaders).
-
using usdex::core::StringPrimvarData = PrimvarData<std::string>#
An alias for
PrimvarData
that holdsVtStringArray
values (e.g human readable descriptors).
-
using usdex::core::TokenPrimvarData = PrimvarData<pxr::TfToken>#
An alias for
PrimvarData
that holdsVtTokenArray
values (e.g more efficient human readable descriptors).This is a more efficient format than raw strings if you have many repeated values across different prims.
Note
TfToken
lifetime lasts the entire process. Too many tokens in memory may consume resources somewhat unexpectedly.
-
using usdex::core::Vec2fPrimvarData = PrimvarData<pxr::GfVec2f>#
An alias for
PrimvarData
that holdsVtVec2fArray
values (e.g texture coordinates).
-
using usdex::core::Vec3fPrimvarData = PrimvarData<pxr::GfVec3f>#
An alias for
PrimvarData
that holdsVtVec3fArray
values (e.g normals, colors, or other vectors).