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
UsdGeomPrimvardata as a single object without risk of detaching (copying) arrays.
Typedefs#
- usdex::core::FloatPrimvarData
An alias for
PrimvarDatathat holdsVtFloatArrayvalues (e.g widths or scale factors).- usdex::core::Int64PrimvarData
An alias for
PrimvarDatathat holdsVtInt64Arrayvalues (e.g ids that might be very large).- usdex::core::IntPrimvarData
An alias for
PrimvarDatathat holdsVtIntArrayvalues (e.g simple switch values or booleans consumable by shaders).- usdex::core::StringPrimvarData
An alias for
PrimvarDatathat holdsVtStringArrayvalues (e.g human readable descriptors).- usdex::core::TokenPrimvarData
An alias for
PrimvarDatathat holdsVtTokenArrayvalues (e.g more efficient human readable descriptors).- usdex::core::Vec2fPrimvarData
An alias for
PrimvarDatathat holdsVtVec2fArrayvalues (e.g texture coordinates).- usdex::core::Vec3fPrimvarData
An alias for
PrimvarDatathat holdsVtVec3fArrayvalues (e.g normals, colors, or other vectors).
Typedefs#
-
using usdex::core::FloatPrimvarData = PrimvarData<float>#
An alias for
PrimvarDatathat holdsVtFloatArrayvalues (e.g widths or scale factors).
-
using usdex::core::Int64PrimvarData = PrimvarData<int64_t>#
An alias for
PrimvarDatathat holdsVtInt64Arrayvalues (e.g ids that might be very large).
-
using usdex::core::IntPrimvarData = PrimvarData<int>#
An alias for
PrimvarDatathat holdsVtIntArrayvalues (e.g simple switch values or booleans consumable by shaders).
-
using usdex::core::StringPrimvarData = PrimvarData<std::string>#
An alias for
PrimvarDatathat holdsVtStringArrayvalues (e.g human readable descriptors).
-
using usdex::core::TokenPrimvarData = PrimvarData<pxr::TfToken>#
An alias for
PrimvarDatathat holdsVtTokenArrayvalues (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
TfTokenlifetime lasts the entire process. Too many tokens in memory may consume resources somewhat unexpectedly.
-
using usdex::core::Vec2fPrimvarData = PrimvarData<pxr::GfVec2f>#
An alias for
PrimvarDatathat holdsVtVec2fArrayvalues (e.g texture coordinates).
-
using usdex::core::Vec3fPrimvarData = PrimvarData<pxr::GfVec3f>#
An alias for
PrimvarDatathat holdsVtVec3fArrayvalues (e.g normals, colors, or other vectors).