Loading...
Searching...
No Matches
cache.h
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_PCP_CACHE_H
8#define PXR_USD_PCP_CACHE_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/pcp/api.h"
12#include "pxr/usd/pcp/dependency.h"
13#include "pxr/usd/pcp/errors.h"
14#include "pxr/usd/pcp/mapFunction.h"
15#include "pxr/usd/pcp/primIndex.h"
16#include "pxr/usd/pcp/propertyIndex.h"
18#include "pxr/usd/sdf/path.h"
19#include "pxr/usd/sdf/pathTable.h"
20
21#include "pxr/usd/ar/ar.h"
24#include "pxr/base/tf/functionRef.h"
25#include "pxr/base/tf/hashset.h"
26
27#include <memory>
28#include <string>
29#include <unordered_set>
30#include <vector>
31
32PXR_NAMESPACE_OPEN_SCOPE
33
34// Forward declarations:
35class PcpChanges;
36class PcpCacheChanges;
37class Pcp_Dependencies;
39class PcpLifeboat;
40class PcpNodeRef;
41class PcpMapFunction;
42
44TF_DECLARE_WEAK_AND_REF_PTRS(Pcp_LayerStackRegistry);
45SDF_DECLARE_HANDLES(SdfSpec);
46
77{
78 PcpCache(PcpCache const &) = delete;
79 PcpCache &operator=(PcpCache const &) = delete;
80public:
91 PCP_API
92 PcpCache(const PcpLayerStackIdentifier & layerStackIdentifier,
93 const std::string& fileFormatTarget = std::string(),
94 bool usd = false);
95 PCP_API ~PcpCache();
96
99
101 PCP_API
103
110 PCP_API
111 PcpLayerStackPtr GetLayerStack() const;
112
117 bool HasRootLayerStack(PcpLayerStackRefPtr const &layerStack) const {
118 return layerStack == _layerStack;
119 }
120
122 PCP_API
123 bool HasRootLayerStack(PcpLayerStackPtr const &layerStack) const;
124
126 PCP_API
127 bool IsUsd() const;
128
130 PCP_API
131 const std::string& GetFileFormatTarget() const;
132
135 PCP_API
137
144 PCP_API
146 PcpChanges* changes = NULL );
147
149 PCP_API
150 bool IsPayloadIncluded(const SdfPath &path) const;
151
153 using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
154 PCP_API
155 PayloadSet const &GetIncludedPayloads() const;
156
168 PCP_API
169 void RequestPayloads( const SdfPathSet & pathsToInclude,
170 const SdfPathSet & pathsToExclude,
171 PcpChanges* changes = NULL );
172
204 PCP_API
205 void RequestLayerMuting(const std::vector<std::string>& layersToMute,
206 const std::vector<std::string>& layersToUnmute,
207 PcpChanges* changes = nullptr,
208 std::vector<std::string>* newLayersMuted = nullptr,
209 std::vector<std::string>* newLayersUnmuted =
210 nullptr);
211
215 PCP_API
216 const std::vector<std::string>& GetMutedLayers() const;
217
223 PCP_API
224 bool IsLayerMuted(const std::string& layerIdentifier) const;
225
233 PCP_API
234 bool IsLayerMuted(const SdfLayerHandle& anchorLayer,
235 const std::string& layerIdentifier,
236 std::string* canonicalMutedLayerIdentifier
237 = nullptr) const;
238
246 PCP_API
248
250
253
259 PCP_API
260 PcpLayerStackRefPtr
262 PcpErrorVector *allErrors);
263
266 PCP_API
267 PcpLayerStackPtr
268 FindLayerStack(const PcpLayerStackIdentifier &identifier) const;
269
272 PCP_API
273 bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const;
274
278 PCP_API
279 const PcpPrimIndex &
280 ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors);
281
304 template <class ChildrenPredicate, class PayloadPredicate>
306 PcpErrorVector *allErrors,
307 const ChildrenPredicate &childrenPred,
308 const PayloadPredicate &payloadPred) {
309 ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
310 childrenPred, payloadPred,
311 "Pcp", "ComputePrimIndexesInParallel");
312 }
313
317 template <class ChildrenPredicate, class PayloadPredicate>
319 PcpErrorVector *allErrors,
320 const ChildrenPredicate &childrenPred,
321 const PayloadPredicate &payloadPred,
322 const char *mallocTag1,
323 const char *mallocTag2) {
324 ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
325 childrenPred, payloadPred,
326 mallocTag1, mallocTag2);
327 }
328
331 template <class ChildrenPredicate, class PayloadPredicate>
332 void ComputePrimIndexesInParallel(const SdfPathVector &paths,
333 PcpErrorVector *allErrors,
334 const ChildrenPredicate &childrenPred,
335 const PayloadPredicate &payloadPred) {
336 _UntypedIndexingChildrenPredicate cp(&childrenPred);
337 _UntypedIndexingPayloadPredicate pp(&payloadPred);
338 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
339 "Pcp", "ComputePrimIndexesInParallel");
340 }
341
345 template <class ChildrenPredicate, class PayloadPredicate>
346 void ComputePrimIndexesInParallel(const SdfPathVector &paths,
347 PcpErrorVector *allErrors,
348 const ChildrenPredicate &childrenPred,
349 const PayloadPredicate &payloadPred,
350 const char *mallocTag1,
351 const char *mallocTag2) {
352 _UntypedIndexingChildrenPredicate cp(&childrenPred);
353 _UntypedIndexingPayloadPredicate pp(&payloadPred);
354 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
355 mallocTag1, mallocTag2);
356 }
357
360 PCP_API
361 const PcpPrimIndex *
362 FindPrimIndex(const SdfPath &primPath) const;
363
366 template <class Callback>
367 void
368 ForEachPrimIndex(const Callback& callback) const
369 {
370 TfFunctionRef<void(const PcpPrimIndex&)> fn(callback);
371 _ForEachPrimIndex(fn);
372 }
373
377 PCP_API
378 const PcpPropertyIndex &
379 ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors);
380
383 PCP_API
384 const PcpPropertyIndex *
385 FindPropertyIndex(const SdfPath &propPath) const;
386
396 PCP_API
397 void
398 ComputeRelationshipTargetPaths(const SdfPath &relationshipPath,
399 SdfPathVector *paths,
400 bool localOnly,
401 const SdfSpecHandle &stopProperty,
402 bool includeStopProperty,
403 SdfPathVector *deletedPaths,
404 PcpErrorVector *allErrors);
405
415 PCP_API
416 void
418 SdfPathVector *paths,
419 bool localOnly,
420 const SdfSpecHandle &stopProperty,
421 bool includeStopProperty,
422 SdfPathVector *deletedPaths,
423 PcpErrorVector *allErrors);
424
428
430 PCP_API
431 SdfLayerHandleSet GetUsedLayers() const;
432
438 PCP_API
439 size_t GetUsedLayersRevision() const;
440
442 PCP_API
443 SdfLayerHandleSet GetUsedRootLayers() const;
444
446 PCP_API
447 const PcpLayerStackPtrVector&
448 FindAllLayerStacksUsingLayer(const SdfLayerHandle& layer) const;
449
453 template <class Callback>
454 void
455 ForEachLayerStack(const Callback& callback) const
456 {
457 TfFunctionRef<void(const PcpLayerStackPtr&)> fn(callback);
458 _ForEachLayerStack(fn);
459 }
460
474 PCP_API
475 PcpDependencyVector
476 FindSiteDependencies(const PcpLayerStackPtr& siteLayerStack,
477 const SdfPath& sitePath,
478 PcpDependencyFlags depMask,
479 bool recurseOnSite,
480 bool recurseOnIndex,
481 bool filterForExistingCachesOnly) const;
482
492 PCP_API
493 PcpDependencyVector
494 FindSiteDependencies(const SdfLayerHandle& siteLayer,
495 const SdfPath& sitePath,
496 PcpDependencyFlags depMask,
497 bool recurseOnSite,
498 bool recurseOnIndex,
499 bool filterForExistingCachesOnly) const;
500
509 PCP_API
510 bool CanHaveOpinionForSite(const SdfPath& localPcpSitePath,
511 const SdfLayerHandle& layer,
512 SdfPath* allowedPathInLayer) const;
513
516 PCP_API
517 std::vector<std::string> GetInvalidSublayerIdentifiers() const;
518
523 PCP_API
524 bool IsInvalidSublayerIdentifier(const std::string& identifier) const;
525
528 PCP_API
529 std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan>
531
536 PCP_API
537 bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
538
541 PCP_API
543
546 PCP_API
548
552 PCP_API
554
558 PCP_API
560 const TfToken &attributeName) const;
561
566 PCP_API
569 const SdfPath &primIndexPath) const;
570
573 PCP_API
575 const PcpLayerStackPtr &layerStack) const;
576
579 PCP_API
580 const std::unordered_set<std::string>&
582 const SdfPath &primIndexPath,
583 const PcpLayerStackPtr &layerStack) const;
584
586
589
609 PCP_API
610 void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
611
618 PCP_API
619 void Reload(PcpChanges* changes);
620
632 PCP_API
633 void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
634
636
639
641 PCP_API
642 void PrintStatistics() const;
643
645
646private:
647 friend class PcpChanges;
648 friend class Pcp_Dependencies;
649 friend class Pcp_Statistics;
650
651 struct _ParallelIndexer;
652
653 // Helper struct to type-erase a children predicate for the duration of
654 // ComputePrimIndexesInParallel.
655 //
656 // This lets us achieve two goals. First, clients may pass any arbitrary
657 // type as a predicate (e.g. they do not have to derive some base class).
658 // Second, it lets us keep the parallel indexing implementation in the .cpp
659 // file, avoiding any large template code instantiation.
660 //
661 // The cost we pay is this very thin indirect call. We instantiate a
662 // function template with the client's predicate type that simply does a
663 // typecast and predicate invocation, and pass that function pointer into
664 // the implementation. There is no heap allocation, no predicate copy, no
665 // argument marshalling, etc.
666 struct _UntypedIndexingChildrenPredicate {
667 _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
668 template <class Pred>
669 explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
670 : pred(pred), invoke(_Invoke<Pred>) {}
671
672 inline bool operator()(const PcpPrimIndex &index,
673 TfTokenVector *childNamesToCompose) const {
674 return invoke(pred, index, childNamesToCompose);
675 }
676 private:
677 template <class Pred>
678 static bool _Invoke(const void *pred, const PcpPrimIndex &index,
679 TfTokenVector *namesToCompose) {
680 return (*static_cast<const Pred *>(pred))(index, namesToCompose);
681 }
682 const void *pred;
683 bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
684 };
685
686 // See doc for _UntypedIndexingChildrenPredicate above. This does the same
687 // for the payload inclusion predicate.
688 struct _UntypedIndexingPayloadPredicate {
689 template <class Pred>
690 explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
691 : pred(pred), invoke(_Invoke<Pred>) {}
692
693 inline bool operator()(const SdfPath &path) const {
694 return invoke(pred, path);
695 }
696 private:
697 template <class Pred>
698 static bool _Invoke(const void *pred, const SdfPath &path) {
699 return (*static_cast<const Pred *>(pred))(path);
700 }
701 const void *pred;
702 bool (*invoke)(const void *, const SdfPath &);
703 };
704
705 // Internal helper for recursive indexing.
706 const PcpPrimIndex &
707 _ComputePrimIndexWithCompatibleInputs(
708 const SdfPath & path, const PcpPrimIndexInputs &inputs,
709 PcpErrorVector *allErrors);
710
711 // Friend to allow low-level indexing code access to the above.
712 friend const PcpPrimIndex &
713 Pcp_ComputePrimIndexWithCompatibleInputs(
714 PcpCache &cache,
715 const SdfPath & path, const PcpPrimIndexInputs &inputs,
716 PcpErrorVector *allErrors);
717
718 // Parallel indexing implementation.
719 PCP_API
720 void _ComputePrimIndexesInParallel(
721 const SdfPathVector &paths,
722 PcpErrorVector *allErrors,
723 _UntypedIndexingChildrenPredicate childrenPred,
724 _UntypedIndexingPayloadPredicate payloadPred,
725 const char *mallocTag1,
726 const char *mallocTag2);
727
728 void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
729 void _RemovePrimAndPropertyCaches(const SdfPath& root,
730 PcpLifeboat* lifeboat);
731 void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
732 void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
733
734 // Returns the prim index for \p path if it exists, NULL otherwise.
735 PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
736 const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
737
738 // Returns the property index for \p path if it exists, NULL otherwise.
739 PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
740 const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
741
742 PCP_API
743 void _ForEachPrimIndex(
744 const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
745
746 PCP_API
747 void _ForEachLayerStack(
748 const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
749
750private:
751 // Fixed evaluation parameters, set when the cache is created. Note that
752 // _rootLayer and _sessionLayer are not const because we want to mutate them
753 // to enable parallel teardown in the destructor.
754 SdfLayerRefPtr _rootLayer;
755 SdfLayerRefPtr _sessionLayer;
756 const PcpLayerStackIdentifier _layerStackIdentifier;
757
758 // Flag that configures PcpCache to use the restricted set of USD features.
759 // Currently it governs whether relocates, inherits, permissions,
760 // symmetry, or payloads are considered, and whether the prim stack
761 // is populated and its depdencies gathered during computation of
762 // prim indices and composition of prim child names.
763 const bool _usd;
764
765 // File format target for all scene description layers this cache will
766 // find or open during prim index computation.
767 const std::string _fileFormatTarget;
768
769 // The layer stack for this cache. Holding this by ref ptr means we
770 // hold all of our local layers by ref ptr (including the root and
771 // session layers, again).
772 PcpLayerStackRefPtr _layerStack;
773
774 // Modifiable evaluation parameters.
775 // Anything that changes these should also yield a PcpChanges
776 // value describing the necessary cache invalidation.
777 PayloadSet _includedPayloads;
778 PcpVariantFallbackMap _variantFallbackMap;
779
780 // The default prim index inputs used when computing a prim index within
781 // this cache.
782 PcpPrimIndexInputs _primIndexInputs;
783
784 // Cached computation types.
785 typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
786 typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
787 typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
788
789 // Cached computations.
790 _LayerStackCache _layerStackCache;
791 _PrimIndexCache _primIndexCache;
792 _PropertyIndexCache _propertyIndexCache;
793 std::unique_ptr<Pcp_Dependencies> _primDependencies;
794
795 // Parallel indexer state.
796 std::unique_ptr<_ParallelIndexer> _parallelIndexer;
797};
798
799PXR_NAMESPACE_CLOSE_SCOPE
800
801#endif // PXR_USD_PCP_CACHE_H
Types of changes per cache.
Definition: changes.h:102
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:77
std::unordered_set< SdfPath, SdfPath::Hash > PayloadSet
Returns the payloads requested for inclusion.
Definition: cache.h:153
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:346
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:368
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:318
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 const PcpPrimIndexInputs & GetPrimIndexInputs() const
Returns parameter object containing all inputs for the prim index computation used by 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:117
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:305
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 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:332
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:455
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:219
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:50
Arguments used to identify a layer stack.
Structure used to temporarily retain layers and layerStacks within a code block.
Definition: changes.h:187
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:65
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:47
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:62
Inputs for the prim indexing procedure.
Definition: primIndex.h:355
PcpPropertyIndex is an index of all sites in scene description that contribute opinions to a specific...
Definition: propertyIndex.h:49
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
A mapping from SdfPath to MappedType, somewhat similar to map<SdfPath, MappedType> and TfHashMap<SdfP...
Definition: pathTable.h:66
Base class for all Sdf spec classes.
Definition: spec.h:33
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:19
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
Definition: types.h:189