All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flattenLayerStack.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_USD_USD_UTILS_FLATTEN_LAYER_STACK_H
25 #define PXR_USD_USD_UTILS_FLATTEN_LAYER_STACK_H
26 
30 
31 #include "pxr/pxr.h"
32 #include "pxr/usd/usd/stage.h"
33 #include "pxr/usd/usdUtils/api.h"
36 
37 PXR_NAMESPACE_OPEN_SCOPE
38 
39 SDF_DECLARE_HANDLES(SdfLayer);
40 
65 USDUTILS_API
67 UsdUtilsFlattenLayerStack(const UsdStagePtr &stage,
68  const std::string& tag = std::string());
69 
77 using UsdUtilsResolveAssetPathFn = std::function<std::string(
78  const SdfLayerHandle& sourceLayer,
79  const std::string& assetPath)>;
80 
108 USDUTILS_API
110 UsdUtilsFlattenLayerStack(const UsdStagePtr &stage,
111  const UsdUtilsResolveAssetPathFn& resolveAssetPathFn,
112  const std::string& tag = std::string());
113 
120 USDUTILS_API
121 std::string
123  const SdfLayerHandle& sourceLayer,
124  const std::string& assetPath);
125 
126 
127 PXR_NAMESPACE_CLOSE_SCOPE
128 
129 #endif /* PXR_USD_USD_UTILS_FLATTEN_LAYER_STACK_H */
A unit of scene description that you combine with other units of scene description to form a shot...
Definition: layer.h:96
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.