Loading...
Searching...
No Matches
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 PXR_USD_USD_UTILS_AUTHORING_H
25#define PXR_USD_USD_UTILS_AUTHORING_H
26
31
32#include "pxr/pxr.h"
33
34#include "pxr/base/tf/hashset.h"
35
37#include "pxr/usd/usd/stage.h"
38#include "pxr/usd/usdUtils/api.h"
40
41PXR_NAMESPACE_OPEN_SCOPE
42
43SDF_DECLARE_HANDLES(SdfLayer);
44
61USDUTILS_API
62bool UsdUtilsCopyLayerMetadata(const SdfLayerHandle &source,
63 const SdfLayerHandle &destination,
64 bool skipSublayers = false,
65 bool bakeUnauthoredFallbacks = false);
66
67using UsdUtilsPathHashSet = TfHashSet<SdfPath, SdfPath::Hash>;
68
72
118USDUTILS_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
136USDUTILS_API
138 const TfToken &collectionName,
139 const UsdPrim &usdPrim,
140 const SdfPathVector &pathsToInclude,
141 const SdfPathVector &pathsToExclude=SdfPathVector());
142
184USDUTILS_API
185std::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
195USDUTILS_API
196SdfLayerHandleVector UsdUtilsGetDirtyLayers(UsdStagePtr stage,
197 bool includeClipLayers = true);
198
199PXR_NAMESPACE_CLOSE_SCOPE
200
201#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:100
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
This is a general purpose API schema, used to describe a collection of heterogeneous objects within t...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:134