Loading...
Searching...
No Matches
dependencies.h
Go to the documentation of this file.
1//
2// Copyright 2016 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_DEPENDENCIES_H
8#define PXR_USD_USD_UTILS_DEPENDENCIES_H
9
20
21#include "pxr/pxr.h"
22#include "pxr/usd/usdUtils/api.h"
25
26#include <string>
27#include <vector>
28
29PXR_NAMESPACE_OPEN_SCOPE
30
34public:
40 inline void SetResolveUdimPaths(bool resolveUdimPaths) {
41 _resolveUdimPaths = resolveUdimPaths;
42 }
43
44
45 inline bool GetResolveUdimPaths() const { return _resolveUdimPaths; }
46
47private:
48 bool _resolveUdimPaths = false;
49};
50
66USDUTILS_API
68 const std::string& filePath,
69 std::vector<std::string>* subLayers,
70 std::vector<std::string>* references,
71 std::vector<std::string>* payloads,
73
90USDUTILS_API
91bool
93 const SdfAssetPath &assetPath,
94 std::vector<SdfLayerRefPtr> *layers,
95 std::vector<std::string> *assets,
96 std::vector<std::string> *unresolvedPaths,
97 const std::function<UsdUtilsProcessingFunc> &processingFunc =
98 std::function<UsdUtilsProcessingFunc>());
99
104using UsdUtilsModifyAssetPathFn = std::function<std::string(
105 const std::string& assetPath)>;
106
118USDUTILS_API
120 const SdfLayerHandle& layer,
121 const UsdUtilsModifyAssetPathFn& modifyFn,
122 bool keepEmptyPathsInArrays = false);
123
124PXR_NAMESPACE_CLOSE_SCOPE
125
126#endif // PXR_USD_USD_UTILS_DEPENDENCIES_H
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
Structure which controls aspects of the UsdUtilsExtractExternalReferences function.
Definition: dependencies.h:33
void SetResolveUdimPaths(bool resolveUdimPaths)
Specifies whether UDIM template paths should be resolved when extracting references.
Definition: dependencies.h:40
USDUTILS_API void UsdUtilsModifyAssetPaths(const SdfLayerHandle &layer, const UsdUtilsModifyAssetPathFn &modifyFn, bool keepEmptyPathsInArrays=false)
Helper function that visits every asset path in layer, calls modifyFn and replaces the value with the...
USDUTILS_API void UsdUtilsExtractExternalReferences(const std::string &filePath, std::vector< std::string > *subLayers, std::vector< std::string > *references, std::vector< std::string > *payloads, const UsdUtilsExtractExternalReferencesParams &params={})
Parses the file at filePath, identifying external references, and sorting them into separate type-bas...
USDUTILS_API bool UsdUtilsComputeAllDependencies(const SdfAssetPath &assetPath, std::vector< SdfLayerRefPtr > *layers, std::vector< std::string > *assets, std::vector< std::string > *unresolvedPaths, const std::function< UsdUtilsProcessingFunc > &processingFunc=std::function< UsdUtilsProcessingFunc >())
Recursively computes all the dependencies of the given asset and populates layers with all the depend...
std::function< std::string(const std::string &assetPath)> UsdUtilsModifyAssetPathFn
Callback that is used to modify asset paths in a layer.
Definition: dependencies.h:105