All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
241 PCP_API
243
245
248
254 PCP_API
255 PcpLayerStackRefPtr
257 PcpErrorVector *allErrors);
258
261 PCP_API
262 PcpLayerStackPtr
263 FindLayerStack(const PcpLayerStackIdentifier &identifier) const;
264
267 PCP_API
268 bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const;
269
273 PCP_API
274 const PcpPrimIndex &
275 ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors);
276
299 template <class ChildrenPredicate, class PayloadPredicate>
301 PcpErrorVector *allErrors,
302 const ChildrenPredicate &childrenPred,
303 const PayloadPredicate &payloadPred) {
304 ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
305 childrenPred, payloadPred,
306 "Pcp", "ComputePrimIndexesInParallel");
307 }
308
312 template <class ChildrenPredicate, class PayloadPredicate>
314 PcpErrorVector *allErrors,
315 const ChildrenPredicate &childrenPred,
316 const PayloadPredicate &payloadPred,
317 const char *mallocTag1,
318 const char *mallocTag2) {
319 ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
320 childrenPred, payloadPred,
321 mallocTag1, mallocTag2);
322 }
323
326 template <class ChildrenPredicate, class PayloadPredicate>
327 void ComputePrimIndexesInParallel(const SdfPathVector &paths,
328 PcpErrorVector *allErrors,
329 const ChildrenPredicate &childrenPred,
330 const PayloadPredicate &payloadPred) {
331 _UntypedIndexingChildrenPredicate cp(&childrenPred);
332 _UntypedIndexingPayloadPredicate pp(&payloadPred);
333 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
334 "Pcp", "ComputePrimIndexesInParallel");
335 }
336
340 template <class ChildrenPredicate, class PayloadPredicate>
341 void ComputePrimIndexesInParallel(const SdfPathVector &paths,
342 PcpErrorVector *allErrors,
343 const ChildrenPredicate &childrenPred,
344 const PayloadPredicate &payloadPred,
345 const char *mallocTag1,
346 const char *mallocTag2) {
347 _UntypedIndexingChildrenPredicate cp(&childrenPred);
348 _UntypedIndexingPayloadPredicate pp(&payloadPred);
349 _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
350 mallocTag1, mallocTag2);
351 }
352
355 PCP_API
356 const PcpPrimIndex *
357 FindPrimIndex(const SdfPath &primPath) const;
358
361 template <class Callback>
362 void
363 ForEachPrimIndex(const Callback& callback) const
364 {
365 TfFunctionRef<void(const PcpPrimIndex&)> fn(callback);
366 _ForEachPrimIndex(fn);
367 }
368
372 PCP_API
373 const PcpPropertyIndex &
374 ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors);
375
378 PCP_API
379 const PcpPropertyIndex *
380 FindPropertyIndex(const SdfPath &propPath) const;
381
391 PCP_API
392 void
393 ComputeRelationshipTargetPaths(const SdfPath &relationshipPath,
394 SdfPathVector *paths,
395 bool localOnly,
396 const SdfSpecHandle &stopProperty,
397 bool includeStopProperty,
398 SdfPathVector *deletedPaths,
399 PcpErrorVector *allErrors);
400
410 PCP_API
411 void
413 SdfPathVector *paths,
414 bool localOnly,
415 const SdfSpecHandle &stopProperty,
416 bool includeStopProperty,
417 SdfPathVector *deletedPaths,
418 PcpErrorVector *allErrors);
419
423
425 PCP_API
426 SdfLayerHandleSet GetUsedLayers() const;
427
433 PCP_API
434 size_t GetUsedLayersRevision() const;
435
437 PCP_API
438 SdfLayerHandleSet GetUsedRootLayers() const;
439
441 PCP_API
442 const PcpLayerStackPtrVector&
443 FindAllLayerStacksUsingLayer(const SdfLayerHandle& layer) const;
444
448 template <class Callback>
449 void
450 ForEachLayerStack(const Callback& callback) const
451 {
452 TfFunctionRef<void(const PcpLayerStackPtr&)> fn(callback);
453 _ForEachLayerStack(fn);
454 }
455
469 PCP_API
470 PcpDependencyVector
471 FindSiteDependencies(const PcpLayerStackPtr& siteLayerStack,
472 const SdfPath& sitePath,
473 PcpDependencyFlags depMask,
474 bool recurseOnSite,
475 bool recurseOnIndex,
476 bool filterForExistingCachesOnly) const;
477
487 PCP_API
488 PcpDependencyVector
489 FindSiteDependencies(const SdfLayerHandle& siteLayer,
490 const SdfPath& sitePath,
491 PcpDependencyFlags depMask,
492 bool recurseOnSite,
493 bool recurseOnIndex,
494 bool filterForExistingCachesOnly) const;
495
504 PCP_API
505 bool CanHaveOpinionForSite(const SdfPath& localPcpSitePath,
506 const SdfLayerHandle& layer,
507 SdfPath* allowedPathInLayer) const;
508
511 PCP_API
512 std::vector<std::string> GetInvalidSublayerIdentifiers() const;
513
518 PCP_API
519 bool IsInvalidSublayerIdentifier(const std::string& identifier) const;
520
523 PCP_API
524 std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan>
526
531 PCP_API
532 bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
533
536 PCP_API
538
541 PCP_API
543
547 PCP_API
549
553 PCP_API
555 const TfToken &attributeName) const;
556
561 PCP_API
564 const SdfPath &primIndexPath) const;
565
568 PCP_API
570 const PcpLayerStackPtr &layerStack) const;
571
574 PCP_API
575 const std::unordered_set<std::string>&
577 const SdfPath &primIndexPath,
578 const PcpLayerStackPtr &layerStack) const;
579
581
584
604 PCP_API
605 void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
606
613 PCP_API
614 void Reload(PcpChanges* changes);
615
627 PCP_API
628 void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
629
631
634
636 PCP_API
637 void PrintStatistics() const;
638
640
641private:
642 friend class PcpChanges;
643 friend class Pcp_Dependencies;
644 friend class Pcp_Statistics;
645
646 struct _ParallelIndexer;
647
648 // Helper struct to type-erase a children predicate for the duration of
649 // ComputePrimIndexesInParallel.
650 //
651 // This lets us achieve two goals. First, clients may pass any arbitrary
652 // type as a predicate (e.g. they do not have to derive some base class).
653 // Second, it lets us keep the parallel indexing implementation in the .cpp
654 // file, avoiding any large template code instantiation.
655 //
656 // The cost we pay is this very thin indirect call. We instantiate a
657 // function template with the client's predicate type that simply does a
658 // typecast and predicate invocation, and pass that function pointer into
659 // the implementation. There is no heap allocation, no predicate copy, no
660 // argument marshalling, etc.
661 struct _UntypedIndexingChildrenPredicate {
662 _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
663 template <class Pred>
664 explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
665 : pred(pred), invoke(_Invoke<Pred>) {}
666
667 inline bool operator()(const PcpPrimIndex &index,
668 TfTokenVector *childNamesToCompose) const {
669 return invoke(pred, index, childNamesToCompose);
670 }
671 private:
672 template <class Pred>
673 static bool _Invoke(const void *pred, const PcpPrimIndex &index,
674 TfTokenVector *namesToCompose) {
675 return (*static_cast<const Pred *>(pred))(index, namesToCompose);
676 }
677 const void *pred;
678 bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
679 };
680
681 // See doc for _UntypedIndexingChildrenPredicate above. This does the same
682 // for the payload inclusion predicate.
683 struct _UntypedIndexingPayloadPredicate {
684 template <class Pred>
685 explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
686 : pred(pred), invoke(_Invoke<Pred>) {}
687
688 inline bool operator()(const SdfPath &path) const {
689 return invoke(pred, path);
690 }
691 private:
692 template <class Pred>
693 static bool _Invoke(const void *pred, const SdfPath &path) {
694 return (*static_cast<const Pred *>(pred))(path);
695 }
696 const void *pred;
697 bool (*invoke)(const void *, const SdfPath &);
698 };
699
700 // Internal helper for recursive indexing.
701 const PcpPrimIndex &
702 _ComputePrimIndexWithCompatibleInputs(
703 const SdfPath & path, const PcpPrimIndexInputs &inputs,
704 PcpErrorVector *allErrors);
705
706 // Friend to allow low-level indexing code access to the above.
707 friend const PcpPrimIndex &
708 Pcp_ComputePrimIndexWithCompatibleInputs(
709 PcpCache &cache,
710 const SdfPath & path, const PcpPrimIndexInputs &inputs,
711 PcpErrorVector *allErrors);
712
713 // Parallel indexing implementation.
714 PCP_API
715 void _ComputePrimIndexesInParallel(
716 const SdfPathVector &paths,
717 PcpErrorVector *allErrors,
718 _UntypedIndexingChildrenPredicate childrenPred,
719 _UntypedIndexingPayloadPredicate payloadPred,
720 const char *mallocTag1,
721 const char *mallocTag2);
722
723 void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
724 void _RemovePrimAndPropertyCaches(const SdfPath& root,
725 PcpLifeboat* lifeboat);
726 void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
727 void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
728
729 // Returns the prim index for \p path if it exists, NULL otherwise.
730 PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
731 const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
732
733 // Returns the property index for \p path if it exists, NULL otherwise.
734 PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
735 const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
736
737 PCP_API
738 void _ForEachPrimIndex(
739 const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
740
741 PCP_API
742 void _ForEachLayerStack(
743 const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
744
745private:
746 // Fixed evaluation parameters, set when the cache is created. Note that
747 // _rootLayer and _sessionLayer are not const because we want to mutate them
748 // to enable parallel teardown in the destructor.
749 SdfLayerRefPtr _rootLayer;
750 SdfLayerRefPtr _sessionLayer;
751 const PcpLayerStackIdentifier _layerStackIdentifier;
752
753 // Flag that configures PcpCache to use the restricted set of USD features.
754 // Currently it governs whether relocates, inherits, permissions,
755 // symmetry, or payloads are considered, and whether the prim stack
756 // is populated and its depdencies gathered during computation of
757 // prim indices and composition of prim child names.
758 const bool _usd;
759
760 // File format target for all scene description layers this cache will
761 // find or open during prim index computation.
762 const std::string _fileFormatTarget;
763
764 // The layer stack for this cache. Holding this by ref ptr means we
765 // hold all of our local layers by ref ptr (including the root and
766 // session layers, again).
767 PcpLayerStackRefPtr _layerStack;
768
769 // Modifiable evaluation parameters.
770 // Anything that changes these should also yield a PcpChanges
771 // value describing the necessary cache invalidation.
772 PayloadSet _includedPayloads;
773 PcpVariantFallbackMap _variantFallbackMap;
774
775 // Cached computation types.
776 typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
777 typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
778 typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
779
780 // Cached computations.
781 _LayerStackCache _layerStackCache;
782 _PrimIndexCache _primIndexCache;
783 _PropertyIndexCache _propertyIndexCache;
784 std::unique_ptr<Pcp_Dependencies> _primDependencies;
785
786 // Parallel indexer state.
787 std::unique_ptr<_ParallelIndexer> _parallelIndexer;
788};
789
790PXR_NAMESPACE_CLOSE_SCOPE
791
792#endif // PXR_USD_PCP_CACHE_H
Types of changes per cache.
Definition: changes.h:101
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:341
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:363
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:313
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: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:300
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:327
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:450
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:198
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:166
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:356
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