All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
43USDUTILS_API
45 const std::string& filePath,
46 std::vector<std::string>* subLayers,
47 std::vector<std::string>* references,
48 std::vector<std::string>* payloads);
49
66USDUTILS_API
67bool
69 const SdfAssetPath &assetPath,
70 std::vector<SdfLayerRefPtr> *layers,
71 std::vector<std::string> *assets,
72 std::vector<std::string> *unresolvedPaths,
73 const std::function<UsdUtilsProcessingFunc> &processingFunc =
74 std::function<UsdUtilsProcessingFunc>());
75
80using UsdUtilsModifyAssetPathFn = std::function<std::string(
81 const std::string& assetPath)>;
82
94USDUTILS_API
96 const SdfLayerHandle& layer,
97 const UsdUtilsModifyAssetPathFn& modifyFn,
98 bool keepEmptyPathsInArrays = false);
99
100PXR_NAMESPACE_CLOSE_SCOPE
101
102#endif // PXR_USD_USD_UTILS_DEPENDENCIES_H
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
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 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:81
USDUTILS_API void UsdUtilsExtractExternalReferences(const std::string &filePath, std::vector< std::string > *subLayers, std::vector< std::string > *references, std::vector< std::string > *payloads)
Parses the file at filePath, identifying external references, and sorting them into separate type-bas...