Loading...
Searching...
No Matches
flattenUtils.h
Go to the documentation of this file.
1//
2// Copyright 2019 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_FLATTEN_UTILS_H
25#define PXR_USD_USD_FLATTEN_UTILS_H
26
30
31#include "pxr/pxr.h"
32#include "pxr/usd/usd/api.h"
33#include "pxr/usd/usd/stage.h"
36
37PXR_NAMESPACE_OPEN_SCOPE
38
39SDF_DECLARE_HANDLES(SdfLayer);
40
67USD_API
69UsdFlattenLayerStack(const PcpLayerStackRefPtr &layerStack,
70 const std::string& tag = std::string());
71
79using UsdFlattenResolveAssetPathFn = std::function<std::string(
80 const SdfLayerHandle& sourceLayer,
81 const std::string& assetPath)>;
82
115USD_API
117UsdFlattenLayerStack(const PcpLayerStackRefPtr &layerStack,
118 const UsdFlattenResolveAssetPathFn& resolveAssetPathFn,
119 const std::string& tag = std::string());
120
125USD_API
126std::string
128 const SdfLayerHandle& sourceLayer,
129 const std::string& assetPath);
130
135{
136public:
138 SdfLayerHandle sourceLayer;
139
141 std::string assetPath;
142
145};
146
155 std::string(const UsdFlattenResolveAssetPathContext&)>;
156
167USD_API
170 const PcpLayerStackRefPtr &layerStack,
171 const UsdFlattenResolveAssetPathAdvancedFn& resolveAssetPathFn,
172 const std::string& tag = std::string());
173
179USD_API
180std::string
182 const UsdFlattenResolveAssetPathContext& context);
183
184PXR_NAMESPACE_CLOSE_SCOPE
185
186#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:100
A map with string keys and VtValue values.
Definition: dictionary.h:60
std::function< std::string(const SdfLayerHandle &sourceLayer, const std::string &assetPath)> UsdFlattenResolveAssetPathFn
Callback function for overloaded version of UsdFlattenLayerStack.
Definition: flattenUtils.h:81
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:155
SdfLayerHandle sourceLayer
Layer where the asset path is authored.
Definition: flattenUtils.h:138
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:141
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:144
Context object containing information used when resolving asset paths during layer stack flattening.
Definition: flattenUtils.h:135