|
Collection of module-scoped utilities for combining layers. More...
Go to the source code of this file.
Functions | |
SDF_DECLARE_HANDLES (SdfLayer) | |
USDUTILS_API void | UsdUtilsStitchLayers (const SdfLayerHandle &strongLayer, const SdfLayerHandle &weakLayer) |
Merge all scene description in weakLayer into strongLayer . | |
USDUTILS_API void | UsdUtilsStitchInfo (const SdfSpecHandle &strongObj, const SdfSpecHandle &weakObj) |
Merge the scene description for weakObj into strongObj . | |
Advanced Stitching API | |
enum class | UsdUtilsStitchValueStatus { NoStitchedValue , UseDefaultValue , UseSuppliedValue } |
Status enum returned by UsdUtilsStitchValueFn describing the desired value stitching behavior. More... | |
using | UsdUtilsStitchValueFn = std::function< UsdUtilsStitchValueStatus(const TfToken &field, const SdfPath &path, const SdfLayerHandle &strongLayer, bool fieldInStrongLayer, const SdfLayerHandle &weakLayer, bool fieldInWeakLayer, VtValue *stitchedValue)> |
Callback for customizing how values are stitched together. | |
USDUTILS_API void | UsdUtilsStitchLayers (const SdfLayerHandle &strongLayer, const SdfLayerHandle &weakLayer, const UsdUtilsStitchValueFn &stitchValueFn) |
Advanced version of UsdUtilsStitchLayers that accepts a stitchValueFn callback to customize how fields in strongLayer and weakLayer are stitched together. | |
USDUTILS_API void | UsdUtilsStitchInfo (const SdfSpecHandle &strongObj, const SdfSpecHandle &weakObj, const UsdUtilsStitchValueFn &stitchValueFn) |
Advanced version of UsdUtilsStitchInfo that accepts a stitchValueFn callback to customize how fields in strongObj and weakObj are stitched together. | |
Collection of module-scoped utilities for combining layers.
These utilize the convention of a strong and a weak layer. The strong layer will be the first parameter to the function and will always have precedence in conflicts during the merge.
Definition in file stitch.h.
using UsdUtilsStitchValueFn = std::function< UsdUtilsStitchValueStatus( const TfToken& field, const SdfPath& path, const SdfLayerHandle& strongLayer, bool fieldInStrongLayer, const SdfLayerHandle& weakLayer, bool fieldInWeakLayer, VtValue* stitchedValue)> |
Callback for customizing how values are stitched together.
This callback will be invoked for each field being stitched from the source spec at path
in weakLayer
to the destination spec at path
in strongLayer
. fieldInStrongLayer
and fieldInWeakLayer
indicates whether the field has values in either layer.
The callback should return a UsdUtilsStitchValueStatus to indicate the desired behavior. Note that if the callback returns UseSuppliedValue and supplies an empty VtValue in stitchedValue
, the field will be removed from the destination spec.
|
strong |
USDUTILS_API void UsdUtilsStitchInfo | ( | const SdfSpecHandle & | strongObj, |
const SdfSpecHandle & | weakObj | ||
) |
Merge the scene description for weakObj
into strongObj
.
See documentation on UsdUtilsStitchLayers for a description of the merging behavior.
USDUTILS_API void UsdUtilsStitchInfo | ( | const SdfSpecHandle & | strongObj, |
const SdfSpecHandle & | weakObj, | ||
const UsdUtilsStitchValueFn & | stitchValueFn | ||
) |
Advanced version of UsdUtilsStitchInfo that accepts a stitchValueFn
callback to customize how fields in strongObj
and weakObj
are stitched together.
See documentation on UsdUtilsStitchValueFn for more details.
USDUTILS_API void UsdUtilsStitchLayers | ( | const SdfLayerHandle & | strongLayer, |
const SdfLayerHandle & | weakLayer | ||
) |
Merge all scene description in weakLayer
into strongLayer
.
Prims and properties in weakLayer
that do not exist in strongLayer
will be copied into strongLayer
. Prims and properties that do exist in strongLayer
will be merged with the existing scene description.
Merging prims and properties is done on a field-by-field basis. In general, if a field has a value in strongLayer
, the value from weakLayer
will be ignored. However, certain fields have special rules for merging values together:
USDUTILS_API void UsdUtilsStitchLayers | ( | const SdfLayerHandle & | strongLayer, |
const SdfLayerHandle & | weakLayer, | ||
const UsdUtilsStitchValueFn & | stitchValueFn | ||
) |
Advanced version of UsdUtilsStitchLayers that accepts a stitchValueFn
callback to customize how fields in strongLayer
and weakLayer
are stitched together.
See documentation on UsdUtilsStitchValueFn for more details.