|
HDK
|
#include <sparseValueWriter.h>
Public Member Functions | |
| USDUTILS_API bool | SetAttribute (const UsdAttribute &attr, const VtValue &value, const UsdTimeCode time=UsdTimeCode::Default()) |
| USDUTILS_API bool | SetAttribute (const UsdAttribute &attr, VtValue *value, const UsdTimeCode time=UsdTimeCode::Default()) |
| template<typename T > | |
| bool | SetAttribute (const UsdAttribute &attr, T &value, const UsdTimeCode time=UsdTimeCode::Default()) |
| USDUTILS_API void | Clear () |
| USDUTILS_API std::vector < UsdUtilsSparseAttrValueWriter > | GetSparseAttrValueWriters () const |
Utility class that manages sparse authoring of a set of UsdAttributes. It does this by maintaining a map of UsdAttributes to their corresponding UsdUtilsSparseAttrValueWriter objects.
To use this class, simply instantiate an instance of it and invoke the SetAttribute() method with various attributes and their associated time-samples.
Example c++ usage:
Equivalent python code:
In the above example,
Definition at line 212 of file sparseValueWriter.h.
|
inline |
Clears the internal map, thereby releasing all the memory used by the sparse value-writers.
Definition at line 247 of file sparseValueWriter.h.
| USDUTILS_API std::vector<UsdUtilsSparseAttrValueWriter> UsdUtilsSparseValueWriter::GetSparseAttrValueWriters | ( | ) | const |
Returns a new vector of UsdUtilsSparseAttrValueWriter populated from the attrValueWriter map.
| USDUTILS_API bool UsdUtilsSparseValueWriter::SetAttribute | ( | const UsdAttribute & | attr, |
| const VtValue & | value, | ||
| const UsdTimeCode | time = UsdTimeCode::Default() |
||
| ) |
Sets the value of attr to value at time time. The value is written sparsely, i.e., the default value is authored only if it is different from the fallback value or the existing default value, and any redundant time-samples are skipped when the attribute value does not change significantly between consecutive time-samples.
| USDUTILS_API bool UsdUtilsSparseValueWriter::SetAttribute | ( | const UsdAttribute & | attr, |
| VtValue * | value, | ||
| const UsdTimeCode | time = UsdTimeCode::Default() |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. For efficiency, this function swaps out the given value, leaving it empty. The value will be held in memory at least until the next time-sample is written or until the SparseAttrValueWriter instance is destroyed.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 236 of file sparseValueWriter.h.