All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
authoring.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_AUTHORING_H
8#define PXR_USD_USD_UTILS_AUTHORING_H
9
14
15#include "pxr/pxr.h"
16
17#include "pxr/base/tf/hashset.h"
18
20#include "pxr/usd/usd/stage.h"
21#include "pxr/usd/usdUtils/api.h"
23
24PXR_NAMESPACE_OPEN_SCOPE
25
26SDF_DECLARE_HANDLES(SdfLayer);
27
44USDUTILS_API
45bool UsdUtilsCopyLayerMetadata(const SdfLayerHandle &source,
46 const SdfLayerHandle &destination,
47 bool skipSublayers = false,
48 bool bakeUnauthoredFallbacks = false);
49
50using UsdUtilsPathHashSet = TfHashSet<SdfPath, SdfPath::Hash>;
51
55
101USDUTILS_API
103 const SdfPathSet &includedRootPaths,
104 const UsdStageWeakPtr &usdStage,
105 SdfPathVector *pathsToInclude,
106 SdfPathVector *pathsToExclude,
107 double minInclusionRatio=0.75,
108 const unsigned int maxNumExcludesBelowInclude=5u,
109 const unsigned int minIncludeExcludeCollectionSize=3u,
110 const UsdUtilsPathHashSet &pathsToIgnore=UsdUtilsPathHashSet());
111
119USDUTILS_API
121 const TfToken &collectionName,
122 const UsdPrim &usdPrim,
123 const SdfPathVector &pathsToInclude,
124 const SdfPathVector &pathsToExclude=SdfPathVector());
125
167USDUTILS_API
168std::vector<UsdCollectionAPI> UsdUtilsCreateCollections(
169 const std::vector<std::pair<TfToken, SdfPathSet>> &assignments,
170 const UsdPrim &usdPrim,
171 const double minInclusionRatio=0.75,
172 const unsigned int maxNumExcludesBelowInclude=5u,
173 const unsigned int minIncludeExcludeCollectionSize=3u);
174
176
178USDUTILS_API
179SdfLayerHandleVector UsdUtilsGetDirtyLayers(UsdStagePtr stage,
180 bool includeClipLayers = true);
181
182PXR_NAMESPACE_CLOSE_SCOPE
183
184#endif /* PXR_USD_USD_UTILS_AUTHORING_H */
USDUTILS_API std::vector< UsdCollectionAPI > UsdUtilsCreateCollections(const std::vector< std::pair< TfToken, SdfPathSet > > &assignments, const UsdPrim &usdPrim, const double minInclusionRatio=0.75, const unsigned int maxNumExcludesBelowInclude=5u, const unsigned int minIncludeExcludeCollectionSize=3u)
Given a vector of (collection-name, path-set) pairs, assignments, creates and returns a vector of col...
USDUTILS_API UsdCollectionAPI UsdUtilsAuthorCollection(const TfToken &collectionName, const UsdPrim &usdPrim, const SdfPathVector &pathsToInclude, const SdfPathVector &pathsToExclude=SdfPathVector())
Authors a collection named collectionName on the given prim, usdPrim with the given set of included p...
USDUTILS_API bool UsdUtilsCopyLayerMetadata(const SdfLayerHandle &source, const SdfLayerHandle &destination, bool skipSublayers=false, bool bakeUnauthoredFallbacks=false)
Given two layers source and destination, copy the authored metadata from one to the other.
USDUTILS_API bool UsdUtilsComputeCollectionIncludesAndExcludes(const SdfPathSet &includedRootPaths, const UsdStageWeakPtr &usdStage, SdfPathVector *pathsToInclude, SdfPathVector *pathsToExclude, double minInclusionRatio=0.75, const unsigned int maxNumExcludesBelowInclude=5u, const unsigned int minIncludeExcludeCollectionSize=3u, const UsdUtilsPathHashSet &pathsToIgnore=UsdUtilsPathHashSet())
Computes the optimal set of paths to include and the set of paths to exclude below includes paths,...
USDUTILS_API SdfLayerHandleVector UsdUtilsGetDirtyLayers(UsdStagePtr stage, bool includeClipLayers=true)
Retrieve a list of all dirty layers from the stage's UsedLayers.
A scene description container that can combine with other such containers to form simple component as...
Definition: layer.h:84
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
A general purpose API schema used to describe a collection of prims and properties within a scene.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117