Loading...
Searching...
No Matches
cache.h
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_PCP_CACHE_H
25#define PXR_USD_PCP_CACHE_H
26
27#include "pxr/pxr.h"
28#include "pxr/usd/pcp/api.h"
29#include "pxr/usd/pcp/dependency.h"
30#include "pxr/usd/pcp/errors.h"
31#include "pxr/usd/pcp/mapFunction.h"
32#include "pxr/usd/pcp/primIndex.h"
33#include "pxr/usd/pcp/propertyIndex.h"
35#include "pxr/usd/sdf/path.h"
36#include "pxr/usd/sdf/pathTable.h"
37
38#include "pxr/usd/ar/ar.h"
41#include "pxr/base/tf/functionRef.h"
42#include "pxr/base/tf/hashset.h"
43
44#include <memory>
45#include <string>
46#include <unordered_set>
47#include <vector>
48
49PXR_NAMESPACE_OPEN_SCOPE
50
51// Forward declarations:
52class PcpChanges;
53class PcpCacheChanges;
54class Pcp_Dependencies;
56class PcpLifeboat;
57class PcpNodeRef;
58class PcpMapFunction;
59
61TF_DECLARE_WEAK_AND_REF_PTRS(Pcp_LayerStackRegistry);
62SDF_DECLARE_HANDLES(SdfSpec);
63
94{
95 PcpCache(PcpCache const &) = delete;
96 PcpCache &operator=(PcpCache const &) = delete;
97public:
108 PCP_API
109 PcpCache(const PcpLayerStackIdentifier & layerStackIdentifier,
110 const std::string& fileFormatTarget = std::string(),
111 bool usd = false);
112 PCP_API ~PcpCache();
113
116
118 PCP_API
120
127 PCP_API
128 PcpLayerStackPtr GetLayerStack() const;
129
134 bool HasRootLayerStack(PcpLayerStackRefPtr const &layerStack) const {
135 return layerStack == _layerStack;
136 }
137
139 PCP_API
140 bool HasRootLayerStack(PcpLayerStackPtr const &layerStack) const;
141
143 PCP_API
144 bool IsUsd() const;
145
147 PCP_API
148 const std::string& GetFileFormatTarget() const;
149
152 PCP_API
154
161 PCP_API
163 PcpChanges* changes = NULL );
164
166 PCP_API
167 bool IsPayloadIncluded(const SdfPath &path) const;
168
170 using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
171 PCP_API
172 PayloadSet const &GetIncludedPayloads() const;
173
185 PCP_API
186 void RequestPayloads( const SdfPathSet & pathsToInclude,
187 const SdfPathSet & pathsToExclude,
188 PcpChanges* changes = NULL );
189
221 PCP_API
222 void RequestLayerMuting(const std::vector<std::string>& layersToMute,
223 const std::vector<std::string>& layersToUnmute,
224 PcpChanges* changes = nullptr,
225 std::vector<std::string>* newLayersMuted = nullptr,
226 std::vector<std::string>* newLayersUnmuted =
227 nullptr);
228
232 PCP_API
233 const std::vector<std::string>& GetMutedLayers() const;
234
240 PCP_API
241 bool IsLayerMuted(const std::string& layerIdentifier) const;
242
250 PCP_API
251 bool IsLayerMuted(const SdfLayerHandle& anchorLayer,
252 const std::string& layerIdentifier,
253 std::string* canonicalMutedLayerIdentifier
254 = nullptr) const;
255
258 PCP_API
260
262
265
271 PCP_API
272 PcpLayerStackRefPtr
274 PcpErrorVector *allErrors);
275
278 PCP_API
279 PcpLayerStackPtr
280 FindLayerStack(const PcpLayerStackIdentifier &identifier) const;
281
284 PCP_API
285 bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const;
286
290 PCP_API
291 const PcpPrimIndex &
292 ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors);
293
316 template <class ChildrenPredicate, class PayloadPredicate>
318 PcpErrorVector *allErrors,
319 const ChildrenPredicate &childrenPred,
320 const PayloadPredicate &payloadPred) {
321 ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
322 childrenPred, payloadPred,
323 "Pcp", "ComputePrimIndexesInParallel");
324 }
325
329 template <class ChildrenPredicate, class PayloadPredicate>
331 PcpErrorVector *allErrors,
332 const ChildrenPredicate &childrenPred,
333 const PayloadPredicate &payloadPred,
334 const char *mallocTag1,
335 const char *mallocTag2) {
336 ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
337 childrenPred, payloadPred,
338 mallocTag1, mallocTag2);
339 }
340
343 template <class ChildrenPredicate, class PayloadPredicate>
344 void ComputePrimIndexesInParallel(const SdfPathVector &paths,
345 PcpErrorVector *allErrors,
346 const ChildrenPredicate &childrenPred,
347 const PayloadPredicate &payloadPred) {
348 _UntypedIndexingChildrenPredicate cp(&childrenPred);
349 _UntypedIndexingPayloadPredicate pp(&payloadPred);
350 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
351 "Pcp", "ComputePrimIndexesInParallel");
352 }
353
357 template <class ChildrenPredicate, class PayloadPredicate>
358 void ComputePrimIndexesInParallel(const SdfPathVector &paths,
359 PcpErrorVector *allErrors,
360 const ChildrenPredicate &childrenPred,
361 const PayloadPredicate &payloadPred,
362 const char *mallocTag1,
363 const char *mallocTag2) {
364 _UntypedIndexingChildrenPredicate cp(&childrenPred);
365 _UntypedIndexingPayloadPredicate pp(&payloadPred);
366 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
367 mallocTag1, mallocTag2);
368 }
369
372 PCP_API
373 const PcpPrimIndex *
374 FindPrimIndex(const SdfPath &primPath) const;
375
378 template <class Callback>
379 void
380 ForEachPrimIndex(const Callback& callback) const
381 {
382 TfFunctionRef<void(const PcpPrimIndex&)> fn(callback);
383 _ForEachPrimIndex(fn);
384 }
385
389 PCP_API
390 const PcpPropertyIndex &
391 ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors);
392
395 PCP_API
396 const PcpPropertyIndex *
397 FindPropertyIndex(const SdfPath &propPath) const;
398
408 PCP_API
409 void
410 ComputeRelationshipTargetPaths(const SdfPath &relationshipPath,
411 SdfPathVector *paths,
412 bool localOnly,
413 const SdfSpecHandle &stopProperty,
414 bool includeStopProperty,
415 SdfPathVector *deletedPaths,
416 PcpErrorVector *allErrors);
417
427 PCP_API
428 void
430 SdfPathVector *paths,
431 bool localOnly,
432 const SdfSpecHandle &stopProperty,
433 bool includeStopProperty,
434 SdfPathVector *deletedPaths,
435 PcpErrorVector *allErrors);
436
440
442 PCP_API
443 SdfLayerHandleSet GetUsedLayers() const;
444
450 PCP_API
451 size_t GetUsedLayersRevision() const;
452
454 PCP_API
455 SdfLayerHandleSet GetUsedRootLayers() const;
456
458 PCP_API
459 const PcpLayerStackPtrVector&
460 FindAllLayerStacksUsingLayer(const SdfLayerHandle& layer) const;
461
465 template <class Callback>
466 void
467 ForEachLayerStack(const Callback& callback) const
468 {
469 TfFunctionRef<void(const PcpLayerStackPtr&)> fn(callback);
470 _ForEachLayerStack(fn);
471 }
472
486 PCP_API
487 PcpDependencyVector
488 FindSiteDependencies(const PcpLayerStackPtr& siteLayerStack,
489 const SdfPath& sitePath,
490 PcpDependencyFlags depMask,
491 bool recurseOnSite,
492 bool recurseOnIndex,
493 bool filterForExistingCachesOnly) const;
494
504 PCP_API
505 PcpDependencyVector
506 FindSiteDependencies(const SdfLayerHandle& siteLayer,
507 const SdfPath& sitePath,
508 PcpDependencyFlags depMask,
509 bool recurseOnSite,
510 bool recurseOnIndex,
511 bool filterForExistingCachesOnly) const;
512
521 PCP_API
522 bool CanHaveOpinionForSite(const SdfPath& localPcpSitePath,
523 const SdfLayerHandle& layer,
524 SdfPath* allowedPathInLayer) const;
525
528 PCP_API
529 std::vector<std::string> GetInvalidSublayerIdentifiers() const;
530
535 PCP_API
536 bool IsInvalidSublayerIdentifier(const std::string& identifier) const;
537
540 PCP_API
541 std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan>
543
548 PCP_API
549 bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
550
553 PCP_API
555
558 PCP_API
560
564 PCP_API
566
570 PCP_API
572 const TfToken &attributeName) const;
573
578 PCP_API
581 const SdfPath &primIndexPath) const;
582
585 PCP_API
587 const PcpLayerStackPtr &layerStack) const;
588
591 PCP_API
592 const std::unordered_set<std::string>&
594 const SdfPath &primIndexPath,
595 const PcpLayerStackPtr &layerStack) const;
596
598
601
621 PCP_API
622 void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
623
630 PCP_API
631 void Reload(PcpChanges* changes);
632
644 PCP_API
645 void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
646
648
651
653 PCP_API
654 void PrintStatistics() const;
655
657
658private:
659 friend class PcpChanges;
660 friend class Pcp_Dependencies;
661 friend class Pcp_Statistics;
662
663 struct _ParallelIndexer;
664
665 // Helper struct to type-erase a children predicate for the duration of
666 // ComputePrimIndexesInParallel.
667 //
668 // This lets us achieve two goals. First, clients may pass any arbitrary
669 // type as a predicate (e.g. they do not have to derive some base class).
670 // Second, it lets us keep the parallel indexing implementation in the .cpp
671 // file, avoiding any large template code instantiation.
672 //
673 // The cost we pay is this very thin indirect call. We instantiate a
674 // function template with the client's predicate type that simply does a
675 // typecast and predicate invocation, and pass that function pointer into
676 // the implementation. There is no heap allocation, no predicate copy, no
677 // argument marshalling, etc.
678 struct _UntypedIndexingChildrenPredicate {
679 _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
680 template <class Pred>
681 explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
682 : pred(pred), invoke(_Invoke<Pred>) {}
683
684 inline bool operator()(const PcpPrimIndex &index,
685 TfTokenVector *childNamesToCompose) const {
686 return invoke(pred, index, childNamesToCompose);
687 }
688 private:
689 template <class Pred>
690 static bool _Invoke(const void *pred, const PcpPrimIndex &index,
691 TfTokenVector *namesToCompose) {
692 return (*static_cast<const Pred *>(pred))(index, namesToCompose);
693 }
694 const void *pred;
695 bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
696 };
697
698 // See doc for _UntypedIndexingChildrenPredicate above. This does the same
699 // for the payload inclusion predicate.
700 struct _UntypedIndexingPayloadPredicate {
701 template <class Pred>
702 explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
703 : pred(pred), invoke(_Invoke<Pred>) {}
704
705 inline bool operator()(const SdfPath &path) const {
706 return invoke(pred, path);
707 }
708 private:
709 template <class Pred>
710 static bool _Invoke(const void *pred, const SdfPath &path) {
711 return (*static_cast<const Pred *>(pred))(path);
712 }
713 const void *pred;
714 bool (*invoke)(const void *, const SdfPath &);
715 };
716
717 // Internal helper for recursive indexing.
718 const PcpPrimIndex &
719 _ComputePrimIndexWithCompatibleInputs(
720 const SdfPath & path, const PcpPrimIndexInputs &inputs,
721 PcpErrorVector *allErrors);
722
723 // Friend to allow low-level indexing code access to the above.
724 friend const PcpPrimIndex &
725 Pcp_ComputePrimIndexWithCompatibleInputs(
726 PcpCache &cache,
727 const SdfPath & path, const PcpPrimIndexInputs &inputs,
728 PcpErrorVector *allErrors);
729
730 // Parallel indexing implementation.
731 PCP_API
732 void _ComputePrimIndexesInParallel(
733 const SdfPathVector &paths,
734 PcpErrorVector *allErrors,
735 _UntypedIndexingChildrenPredicate childrenPred,
736 _UntypedIndexingPayloadPredicate payloadPred,
737 const char *mallocTag1,
738 const char *mallocTag2);
739
740 void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
741 void _RemovePrimAndPropertyCaches(const SdfPath& root,
742 PcpLifeboat* lifeboat);
743 void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
744 void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
745
746 // Returns the prim index for \p path if it exists, NULL otherwise.
747 PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
748 const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
749
750 // Returns the property index for \p path if it exists, NULL otherwise.
751 PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
752 const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
753
754 PCP_API
755 void _ForEachPrimIndex(
756 const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
757
758 PCP_API
759 void _ForEachLayerStack(
760 const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
761
762private:
763 // Fixed evaluation parameters, set when the cache is created. Note that
764 // _rootLayer and _sessionLayer are not const because we want to mutate them
765 // to enable parallel teardown in the destructor.
766 SdfLayerRefPtr _rootLayer;
767 SdfLayerRefPtr _sessionLayer;
768 const PcpLayerStackIdentifier _layerStackIdentifier;
769
770 // Flag that configures PcpCache to use the restricted set of USD features.
771 // Currently it governs whether relocates, inherits, permissions,
772 // symmetry, or payloads are considered, and whether the prim stack
773 // is populated and its depdencies gathered during computation of
774 // prim indices and composition of prim child names.
775 const bool _usd;
776
777 // File format target for all scene description layers this cache will
778 // find or open during prim index computation.
779 const std::string _fileFormatTarget;
780
781 // The layer stack for this cache. Holding this by ref ptr means we
782 // hold all of our local layers by ref ptr (including the root and
783 // session layers, again).
784 PcpLayerStackRefPtr _layerStack;
785
786 // Modifiable evaluation parameters.
787 // Anything that changes these should also yield a PcpChanges
788 // value describing the necessary cache invalidation.
789 PayloadSet _includedPayloads;
790 PcpVariantFallbackMap _variantFallbackMap;
791
792 // Cached computation types.
793 typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
794 typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
795 typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
796
797 // Cached computations.
798 _LayerStackCache _layerStackCache;
799 _PrimIndexCache _primIndexCache;
800 _PropertyIndexCache _propertyIndexCache;
801 std::unique_ptr<Pcp_Dependencies> _primDependencies;
802
803 // Parallel indexer state.
804 std::unique_ptr<_ParallelIndexer> _parallelIndexer;
805};
806
807PXR_NAMESPACE_CLOSE_SCOPE
808
809#endif // PXR_USD_PCP_CACHE_H
Types of changes per cache.
Definition: changes.h:117
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:94
std::unordered_set< SdfPath, SdfPath::Hash > PayloadSet
Returns the payloads requested for inclusion.
Definition: cache.h:170
void ComputePrimIndexesInParallel(const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred, const char *mallocTag1, const char *mallocTag2)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: cache.h:358
PCP_API void ReloadReferences(PcpChanges *changes, const SdfPath &primPath)
Reload every layer used by the prim at primPath that's across a reference or payload.
PCP_API const std::unordered_set< std::string > & GetExpressionVariablesFromLayerStackUsedByPrim(const SdfPath &primIndexPath, const PcpLayerStackPtr &layerStack) const
Returns the set of expression variables in layerStack that are used by the prim index at primIndexPat...
void ForEachPrimIndex(const Callback &callback) const
Run the given callback on every prim index in the cache.
Definition: cache.h:380
PCP_API void Reload(PcpChanges *changes)
Reload the layers of the layer stack, except session layers and sublayers of session layers.
PCP_API void RequestPayloads(const SdfPathSet &pathsToInclude, const SdfPathSet &pathsToExclude, PcpChanges *changes=NULL)
Request payloads to be included or excluded from composition.
PCP_API const PcpPropertyIndex & ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors)
Compute and return a reference to the cached result for the property index for the given path.
PCP_API const PcpLayerStackIdentifier & GetLayerStackIdentifier() const
Get the identifier of the layerStack used for composition.
PCP_API const PcpPrimIndex & ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors)
Compute and return a reference to the cached result for the prim index for the given path.
PCP_API void ComputeAttributeConnectionPaths(const SdfPath &attributePath, SdfPathVector *paths, bool localOnly, const SdfSpecHandle &stopProperty, bool includeStopProperty, SdfPathVector *deletedPaths, PcpErrorVector *allErrors)
Compute the attribute connection paths for the attribute at attributePath into paths.
void ComputePrimIndexesInParallel(const SdfPath &path, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred, const char *mallocTag1, const char *mallocTag2)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: cache.h:330
PCP_API PcpVariantFallbackMap GetVariantFallbacks() const
Get the list of fallbacks to attempt to use when evaluating variant sets that lack an authored select...
PCP_API SdfLayerHandleSet GetUsedRootLayers() const
Returns set of all root layers used by this cache.
PCP_API PcpLayerStackPtr GetLayerStack() const
Get the layer stack for GetLayerStackIdentifier().
PCP_API PcpLayerStackRefPtr ComputeLayerStack(const PcpLayerStackIdentifier &identifier, PcpErrorVector *allErrors)
Returns the layer stack for identifier if it exists, otherwise creates a new layer stack for identifi...
PCP_API void Apply(const PcpCacheChanges &changes, PcpLifeboat *lifeboat)
Apply the changes in changes.
PCP_API void RequestLayerMuting(const std::vector< std::string > &layersToMute, const std::vector< std::string > &layersToUnmute, PcpChanges *changes=nullptr, std::vector< std::string > *newLayersMuted=nullptr, std::vector< std::string > *newLayersUnmuted=nullptr)
Request layers to be muted or unmuted in this cache.
PCP_API const PcpPrimIndex * FindPrimIndex(const SdfPath &primPath) const
Returns a pointer to the cached computed prim index for the given path, or NULL if it has not been co...
PCP_API bool IsPossibleDynamicFileFormatArgumentField(const TfToken &field) const
Returns true if the given field is the name of a field that was composed while generating dynamic fil...
PCP_API const std::vector< std::string > & GetMutedLayers() const
Returns the list of canonical identifiers for muted layers in this cache.
PCP_API bool IsPossibleDynamicFileFormatArgumentAttribute(const TfToken &attributeName) const
Returns true if the given attributeName is the name of an attribute whose default value field was com...
PCP_API const PcpLayerStackPtrVector & FindAllLayerStacksUsingLayer(const SdfLayerHandle &layer) const
Returns every computed & cached layer stack that includes layer.
PCP_API bool IsLayerMuted(const std::string &layerIdentifier) const
Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise.
bool HasRootLayerStack(PcpLayerStackRefPtr const &layerStack) const
Return true if this cache's root layer stack is layerStack, false otherwise.
Definition: cache.h:134
PCP_API void SetVariantFallbacks(const PcpVariantFallbackMap &map, PcpChanges *changes=NULL)
Set the list of fallbacks to attempt to use when evaluating variant sets that lack an authored select...
void ComputePrimIndexesInParallel(const SdfPath &path, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred)
Compute PcpPrimIndexes in the subtree rooted at path in parallel, recursing to children based on the ...
Definition: cache.h:317
PCP_API PcpLayerStackPtr FindLayerStack(const PcpLayerStackIdentifier &identifier) const
Returns the layer stack for identifier if it has been computed and cached, otherwise returns NULL.
PCP_API PcpPrimIndexInputs GetPrimIndexInputs()
Returns parameter object containing all inputs for the prim index computation used by this cache.
PCP_API std::vector< std::string > GetInvalidSublayerIdentifiers() const
Returns a vector of sublayer asset paths used in the layer stack that didn't resolve to valid assets.
PCP_API const PcpPropertyIndex * FindPropertyIndex(const SdfPath &propPath) const
Returns a pointer to the cached computed property index for the given path, or NULL if it has not bee...
PCP_API bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const
Return true if layerStack is used by this cache in its composition, false otherwise.
PCP_API bool IsUsd() const
Return true if the cache is configured in Usd mode.
PCP_API bool HasRootLayerStack(PcpLayerStackPtr const &layerStack) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
PCP_API bool IsInvalidAssetPath(const std::string &resolvedAssetPath) const
Returns true if resolvedAssetPath was used by a prim (e.g.
PCP_API const SdfPathVector & GetPrimsUsingExpressionVariablesFromLayerStack(const PcpLayerStackPtr &layerStack) const
Returns the list of prim index paths that depend on one or more expression variables from layerStack.
PCP_API size_t GetUsedLayersRevision() const
Return a number that can be used to determine whether or not the set of layers used by this cache may...
PCP_API bool CanHaveOpinionForSite(const SdfPath &localPcpSitePath, const SdfLayerHandle &layer, SdfPath *allowedPathInLayer) const
Returns true if an opinion for the site at localPcpSitePath in the cache's layer stack can be provide...
PCP_API const PcpDynamicFileFormatDependencyData & GetDynamicFileFormatArgumentDependencyData(const SdfPath &primIndexPath) const
Returns the dynamic file format dependency data object for the prim index with the given primIndexPat...
PCP_API bool HasAnyDynamicFileFormatArgumentFieldDependencies() const
Returns true if any prim index in this cache has a dependency on a dynamic file format argument field...
PCP_API void ComputeRelationshipTargetPaths(const SdfPath &relationshipPath, SdfPathVector *paths, bool localOnly, const SdfSpecHandle &stopProperty, bool includeStopProperty, SdfPathVector *deletedPaths, PcpErrorVector *allErrors)
Compute the relationship target paths for the relationship at relationshipPath into paths.
void ComputePrimIndexesInParallel(const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred)
Vectorized form of ComputePrimIndexesInParallel().
Definition: cache.h:344
PCP_API PcpDependencyVector FindSiteDependencies(const SdfLayerHandle &siteLayer, const SdfPath &sitePath, PcpDependencyFlags depMask, bool recurseOnSite, bool recurseOnIndex, bool filterForExistingCachesOnly) const
Returns dependencies on the given site of scene description, as discovered by the cached index comput...
PCP_API PcpCache(const PcpLayerStackIdentifier &layerStackIdentifier, const std::string &fileFormatTarget=std::string(), bool usd=false)
Construct a PcpCache to compose results for the layer stack identified by layerStackIdentifier.
PCP_API SdfLayerHandleSet GetUsedLayers() const
Returns set of all layers used by this cache.
PCP_API bool IsPayloadIncluded(const SdfPath &path) const
Return true if the payload is included for the given path.
PCP_API std::map< SdfPath, std::vector< std::string >, SdfPath::FastLessThan > GetInvalidAssetPaths() const
Returns a map of prim paths to asset paths used by that prim (e.g.
PCP_API void PrintStatistics() const
Prints various statistics about the data stored in this cache.
PCP_API bool IsInvalidSublayerIdentifier(const std::string &identifier) const
Returns true if identifier was used as a sublayer path in a layer stack but did not identify a valid ...
PCP_API bool IsLayerMuted(const SdfLayerHandle &anchorLayer, const std::string &layerIdentifier, std::string *canonicalMutedLayerIdentifier=nullptr) const
Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise.
void ForEachLayerStack(const Callback &callback) const
Run the given callbcack on every layer stack used by prim indexes in the cache.
Definition: cache.h:467
PCP_API PcpDependencyVector FindSiteDependencies(const PcpLayerStackPtr &siteLayerStack, const SdfPath &sitePath, PcpDependencyFlags depMask, bool recurseOnSite, bool recurseOnIndex, bool filterForExistingCachesOnly) const
Returns dependencies on the given site of scene description, as discovered by the cached index comput...
PCP_API bool HasAnyDynamicFileFormatArgumentAttributeDependencies() const
Returns true if any prim index in this cache has a dependency on a dynamic file format argument attri...
PCP_API const std::string & GetFileFormatTarget() const
Returns the file format target this cache is configured for.
Describes Pcp changes.
Definition: changes.h:193
Contains the necessary information for storing a prim index's dependency on dynamic file format argum...
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:67
Arguments used to identify a layer stack.
Structure used to temporarily retain layers and layerStacks within a code block.
Definition: changes.h:161
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:82
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:64
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:78
Inputs for the prim indexing procedure.
Definition: primIndex.h:349
PcpPropertyIndex is an index of all sites in scene description that contribute opinions to a specific...
Definition: propertyIndex.h:66
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
A mapping from SdfPath to MappedType, somewhat similar to map<SdfPath, MappedType> and TfHashMap<SdfP...
Definition: pathTable.h:83
Base class for all Sdf spec classes.
Definition: spec.h:50
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:36
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
Definition: types.h:206