All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
flattenUtils.h
Go to the documentation of this file.
1//
2// Copyright 2019 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_FLATTEN_UTILS_H
8#define PXR_USD_USD_FLATTEN_UTILS_H
9
13
14#include "pxr/pxr.h"
15#include "pxr/usd/usd/api.h"
16#include "pxr/usd/usd/stage.h"
19
20PXR_NAMESPACE_OPEN_SCOPE
21
22SDF_DECLARE_HANDLES(SdfLayer);
23
50USD_API
52UsdFlattenLayerStack(const PcpLayerStackRefPtr &layerStack,
53 const std::string& tag = std::string());
54
62using UsdFlattenResolveAssetPathFn = std::function<std::string(
63 const SdfLayerHandle& sourceLayer,
64 const std::string& assetPath)>;
65
98USD_API
100UsdFlattenLayerStack(const PcpLayerStackRefPtr &layerStack,
101 const UsdFlattenResolveAssetPathFn& resolveAssetPathFn,
102 const std::string& tag = std::string());
103
108USD_API
109std::string
111 const SdfLayerHandle& sourceLayer,
112 const std::string& assetPath);
113
118{
119public:
121 SdfLayerHandle sourceLayer;
122
124 std::string assetPath;
125
128};
129
138 std::string(const UsdFlattenResolveAssetPathContext&)>;
139
150USD_API
153 const PcpLayerStackRefPtr &layerStack,
154 const UsdFlattenResolveAssetPathAdvancedFn& resolveAssetPathFn,
155 const std::string& tag = std::string());
156
162USD_API
163std::string
165 const UsdFlattenResolveAssetPathContext& context);
166
167PXR_NAMESPACE_CLOSE_SCOPE
168
169#endif /* PXR_USD_USD_FLATTEN_UTILS_H */
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:84
A map with string keys and VtValue values.
Definition: dictionary.h:43
std::function< std::string(const SdfLayerHandle &sourceLayer, const std::string &assetPath)> UsdFlattenResolveAssetPathFn
Callback function for overloaded version of UsdFlattenLayerStack.
Definition: flattenUtils.h:64
USD_API std::string UsdFlattenLayerStackResolveAssetPathAdvanced(const UsdFlattenResolveAssetPathContext &context)
Implements the default asset path flattening behavior for UsdFlattenLayerStack.
std::function< std::string(const UsdFlattenResolveAssetPathContext &)> UsdFlattenResolveAssetPathAdvancedFn
Callback function for UsdFlattenLayerStack.
Definition: flattenUtils.h:138
SdfLayerHandle sourceLayer
Layer where the asset path is authored.
Definition: flattenUtils.h:121
USD_API SdfLayerRefPtr UsdFlattenLayerStack(const PcpLayerStackRefPtr &layerStack, const std::string &tag=std::string())
Flatten layerStack into a single layer with the given optional tag.
std::string assetPath
Authored asset path.
Definition: flattenUtils.h:124
USD_API std::string UsdFlattenLayerStackResolveAssetPath(const SdfLayerHandle &sourceLayer, const std::string &assetPath)
Implements the default asset path flattening behavior for UsdFlattenLayerStack.
VtDictionary expressionVariables
Expression variables from the layer stack.
Definition: flattenUtils.h:127
Context object containing information used when resolving asset paths during layer stack flattening.
Definition: flattenUtils.h:118