All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
authoring.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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 USDUTILS_AUTHORING_H_
25 #define USDUTILS_AUTHORING_H_
26 
31 
32 #include "pxr/pxr.h"
33 
34 #include "pxr/base/tf/hashset.h"
35 
36 #include "pxr/usd/usd/collectionAPI.h"
37 #include "pxr/usd/usd/stage.h"
38 #include "pxr/usd/usdUtils/api.h"
39 #include "pxr/usd/sdf/declareHandles.h"
40 
41 PXR_NAMESPACE_OPEN_SCOPE
42 
43 SDF_DECLARE_HANDLES(SdfLayer);
44 
61 USDUTILS_API
62 bool UsdUtilsCopyLayerMetadata(const SdfLayerHandle &source,
63  const SdfLayerHandle &destination,
64  bool skipSublayers = false,
65  bool bakeUnauthoredFallbacks = false);
66 
67 using UsdUtilsPathHashSet = TfHashSet<SdfPath, SdfPath::Hash>;
68 
72 
118 USDUTILS_API
120  const SdfPathSet &includedRootPaths,
121  const UsdStageWeakPtr &usdStage,
122  SdfPathVector *pathsToInclude,
123  SdfPathVector *pathsToExclude,
124  double minInclusionRatio=0.75,
125  const unsigned int maxNumExcludesBelowInclude=5u,
126  const unsigned int minIncludeExcludeCollectionSize=3u,
127  const UsdUtilsPathHashSet &pathsToIgnore=UsdUtilsPathHashSet());
128 
136 USDUTILS_API
138  const TfToken &collectionName,
139  const UsdPrim &usdPrim,
140  const SdfPathVector &pathsToInclude,
141  const SdfPathVector &pathsToExclude=SdfPathVector());
142 
184 USDUTILS_API
185 std::vector<UsdCollectionAPI> UsdUtilsCreateCollections(
186  const std::vector<std::pair<TfToken, SdfPathSet>> &assignments,
187  const UsdPrim &usdPrim,
188  const double minInclusionRatio=0.75,
189  const unsigned int maxNumExcludesBelowInclude=5u,
190  const unsigned int minIncludeExcludeCollectionSize=3u);
191 
193 
195 USDUTILS_API
196 SdfLayerHandleVector UsdUtilsGetDirtyLayers(UsdStagePtr stage,
197  bool includeClipLayers = true);
198 
199 PXR_NAMESPACE_CLOSE_SCOPE
200 
201 #endif /* USDUTILS_AUTHORING_H_ */
A unit of scene description that you combine with other units of scene description to form a shot...
Definition: layer.h:93
USDUTILS_API SdfLayerHandleVector UsdUtilsGetDirtyLayers(UsdStagePtr stage, bool includeClipLayers=true)
Retrieve a list of all dirty layers from the stage&#39;s UsedLayers.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:89
This is a general purpose API schema, used to describe a collection of heterogeneous objects within t...
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...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a &quot;Prim&quot; as ...
Definition: prim.h:131
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 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...