flattenLayerStack.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_USD_UTILS_FLATTEN_LAYER_STACK_H
8 #define PXR_USD_USD_UTILS_FLATTEN_LAYER_STACK_H
9 
13 
14 #include "pxr/pxr.h"
15 #include "pxr/usd/usd/stage.h"
16 #include "pxr/usd/usdUtils/api.h"
19 
20 PXR_NAMESPACE_OPEN_SCOPE
21 
22 SDF_DECLARE_HANDLES(SdfLayer);
23 
48 USDUTILS_API
50 UsdUtilsFlattenLayerStack(const UsdStagePtr &stage,
51  const std::string& tag = std::string());
52 
60 using UsdUtilsResolveAssetPathFn = std::function<std::string(
61  const SdfLayerHandle& sourceLayer,
62  const std::string& assetPath)>;
63 
91 USDUTILS_API
93 UsdUtilsFlattenLayerStack(const UsdStagePtr &stage,
94  const UsdUtilsResolveAssetPathFn& resolveAssetPathFn,
95  const std::string& tag = std::string());
96 
103 USDUTILS_API
104 std::string
106  const SdfLayerHandle& sourceLayer,
107  const std::string& assetPath);
108 
109 
110 PXR_NAMESPACE_CLOSE_SCOPE
111 
112 #endif /* PXR_USD_USD_UTILS_FLATTEN_LAYER_STACK_H */
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:81
USDUTILS_API SdfLayerRefPtr UsdUtilsFlattenLayerStack(const UsdStagePtr &stage, const std::string &tag=std::string())
Flatten the root layer stack of the given stage into a single layer with the given optional tag.
USDUTILS_API std::string UsdUtilsFlattenLayerStackResolveAssetPath(const SdfLayerHandle &sourceLayer, const std::string &assetPath)
The default UsdUtilsResolvePathFn used by UsdUtilsFlattenLayerStack.
std::function< std::string(const SdfLayerHandle &sourceLayer, const std::string &assetPath)> UsdUtilsResolveAssetPathFn
Callback function for overloaded version of UsdUtilsFlattenLayerStack.