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 
49 PXR_NAMESPACE_OPEN_SCOPE
50 
51 // Forward declarations:
52 class PcpChanges;
53 class PcpCacheChanges;
54 class Pcp_Dependencies;
56 class PcpLifeboat;
57 class PcpNodeRef;
58 class PcpMapFunction;
59 
61 TF_DECLARE_WEAK_AND_REF_PTRS(Pcp_LayerStackRegistry);
62 SDF_DECLARE_HANDLES(SdfSpec);
63 
93 class PcpCache
94 {
95  PcpCache(PcpCache const &) = delete;
96  PcpCache &operator=(PcpCache const &) = delete;
97 public:
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 
131  PCP_API
132  bool IsUsd() const;
133 
135  PCP_API
136  const std::string& GetFileFormatTarget() const;
137 
140  PCP_API
142 
149  PCP_API
150  void SetVariantFallbacks( const PcpVariantFallbackMap & map,
151  PcpChanges* changes = NULL );
152 
154  PCP_API
155  bool IsPayloadIncluded(const SdfPath &path) const;
156 
158  using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
159  PCP_API
160  PayloadSet const &GetIncludedPayloads() const;
161 
173  PCP_API
174  void RequestPayloads( const SdfPathSet & pathsToInclude,
175  const SdfPathSet & pathsToExclude,
176  PcpChanges* changes = NULL );
177 
206  PCP_API
207  void RequestLayerMuting(const std::vector<std::string>& layersToMute,
208  const std::vector<std::string>& layersToUnmute,
209  PcpChanges* changes = nullptr,
210  std::vector<std::string>* newLayersMuted = nullptr,
211  std::vector<std::string>* newLayersUnmuted =
212  nullptr);
213 
217  PCP_API
218  const std::vector<std::string>& GetMutedLayers() const;
219 
225  PCP_API
226  bool IsLayerMuted(const std::string& layerIdentifier) const;
227 
235  PCP_API
236  bool IsLayerMuted(const SdfLayerHandle& anchorLayer,
237  const std::string& layerIdentifier,
238  std::string* canonicalMutedLayerIdentifier
239  = nullptr) const;
240 
243  PCP_API
245 
247 
250 
256  PCP_API
257  PcpLayerStackRefPtr
258  ComputeLayerStack(const PcpLayerStackIdentifier &identifier,
259  PcpErrorVector *allErrors);
260 
263  PCP_API
264  PcpLayerStackPtr
265  FindLayerStack(const PcpLayerStackIdentifier &identifier) const;
266 
269  PCP_API
270  bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const;
271 
275  PCP_API
276  const PcpPrimIndex &
277  ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors);
278 
301  template <class ChildrenPredicate, class PayloadPredicate>
303  PcpErrorVector *allErrors,
304  const ChildrenPredicate &childrenPred,
305  const PayloadPredicate &payloadPred) {
306  ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
307  childrenPred, payloadPred,
308  "Pcp", "ComputePrimIndexesInParallel");
309  }
310 
314  template <class ChildrenPredicate, class PayloadPredicate>
316  PcpErrorVector *allErrors,
317  const ChildrenPredicate &childrenPred,
318  const PayloadPredicate &payloadPred,
319  const char *mallocTag1,
320  const char *mallocTag2) {
321  ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
322  childrenPred, payloadPred,
323  mallocTag1, mallocTag2);
324  }
325 
328  template <class ChildrenPredicate, class PayloadPredicate>
329  void ComputePrimIndexesInParallel(const SdfPathVector &paths,
330  PcpErrorVector *allErrors,
331  const ChildrenPredicate &childrenPred,
332  const PayloadPredicate &payloadPred) {
333  _UntypedIndexingChildrenPredicate cp(&childrenPred);
334  _UntypedIndexingPayloadPredicate pp(&payloadPred);
335  _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
336  "Pcp", "ComputePrimIndexesInParallel");
337  }
338 
342  template <class ChildrenPredicate, class PayloadPredicate>
343  void ComputePrimIndexesInParallel(const SdfPathVector &paths,
344  PcpErrorVector *allErrors,
345  const ChildrenPredicate &childrenPred,
346  const PayloadPredicate &payloadPred,
347  const char *mallocTag1,
348  const char *mallocTag2) {
349  _UntypedIndexingChildrenPredicate cp(&childrenPred);
350  _UntypedIndexingPayloadPredicate pp(&payloadPred);
351  _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
352  mallocTag1, mallocTag2);
353  }
354 
357  PCP_API
358  const PcpPrimIndex *
359  FindPrimIndex(const SdfPath &primPath) const;
360 
363  template <class Callback>
364  void
365  ForEachPrimIndex(const Callback& callback) const
366  {
367  TfFunctionRef<void(const PcpPrimIndex&)> fn(callback);
368  _ForEachPrimIndex(fn);
369  }
370 
374  PCP_API
375  const PcpPropertyIndex &
376  ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors);
377 
380  PCP_API
381  const PcpPropertyIndex *
382  FindPropertyIndex(const SdfPath &propPath) const;
383 
393  PCP_API
394  void
395  ComputeRelationshipTargetPaths(const SdfPath &relationshipPath,
396  SdfPathVector *paths,
397  bool localOnly,
398  const SdfSpecHandle &stopProperty,
399  bool includeStopProperty,
400  SdfPathVector *deletedPaths,
401  PcpErrorVector *allErrors);
402 
412  PCP_API
413  void
414  ComputeAttributeConnectionPaths(const SdfPath &attributePath,
415  SdfPathVector *paths,
416  bool localOnly,
417  const SdfSpecHandle &stopProperty,
418  bool includeStopProperty,
419  SdfPathVector *deletedPaths,
420  PcpErrorVector *allErrors);
421 
425 
427  PCP_API
428  SdfLayerHandleSet GetUsedLayers() const;
429 
435  PCP_API
436  size_t GetUsedLayersRevision() const;
437 
439  PCP_API
440  SdfLayerHandleSet GetUsedRootLayers() const;
441 
443  PCP_API
444  const PcpLayerStackPtrVector&
445  FindAllLayerStacksUsingLayer(const SdfLayerHandle& layer) const;
446 
450  template <class Callback>
451  void
452  ForEachLayerStack(const Callback& callback) const
453  {
454  TfFunctionRef<void(const PcpLayerStackPtr&)> fn(callback);
455  _ForEachLayerStack(fn);
456  }
457 
471  PCP_API
472  PcpDependencyVector
473  FindSiteDependencies(const PcpLayerStackPtr& siteLayerStack,
474  const SdfPath& sitePath,
475  PcpDependencyFlags depMask,
476  bool recurseOnSite,
477  bool recurseOnIndex,
478  bool filterForExistingCachesOnly) const;
479 
489  PCP_API
490  PcpDependencyVector
491  FindSiteDependencies(const SdfLayerHandle& siteLayer,
492  const SdfPath& sitePath,
493  PcpDependencyFlags depMask,
494  bool recurseOnSite,
495  bool recurseOnIndex,
496  bool filterForExistingCachesOnly) const;
497 
506  PCP_API
507  bool CanHaveOpinionForSite(const SdfPath& localPcpSitePath,
508  const SdfLayerHandle& layer,
509  SdfPath* allowedPathInLayer) const;
510 
513  PCP_API
514  std::vector<std::string> GetInvalidSublayerIdentifiers() const;
515 
520  PCP_API
521  bool IsInvalidSublayerIdentifier(const std::string& identifier) const;
522 
525  PCP_API
526  std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan>
527  GetInvalidAssetPaths() const;
528 
533  PCP_API
534  bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
535 
538  PCP_API
540 
544  PCP_API
545  bool IsPossibleDynamicFileFormatArgumentField(const TfToken &field) const;
546 
551  PCP_API
554  const SdfPath &primIndexPath) const;
555 
557 
560 
580  PCP_API
581  void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
582 
589  PCP_API
590  void Reload(PcpChanges* changes);
591 
603  PCP_API
604  void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
605 
607 
610 
612  PCP_API
613  void PrintStatistics() const;
614 
616 
617 private:
618  friend class PcpChanges;
619  friend class Pcp_Dependencies;
620  friend class Pcp_Statistics;
621 
622  struct _ParallelIndexer;
623 
624  // Helper struct to type-erase a children predicate for the duration of
625  // ComputePrimIndexesInParallel.
626  //
627  // This lets us achieve two goals. First, clients may pass any arbitrary
628  // type as a predicate (e.g. they do not have to derive some base class).
629  // Second, it lets us keep the parallel indexing implementation in the .cpp
630  // file, avoiding any large template code instantiation.
631  //
632  // The cost we pay is this very thin indirect call. We instantiate a
633  // function template with the client's predicate type that simply does a
634  // typecast and predicate invocation, and pass that function pointer into
635  // the implementation. There is no heap allocation, no predicate copy, no
636  // argument marshalling, etc.
637  struct _UntypedIndexingChildrenPredicate {
638  _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
639  template <class Pred>
640  explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
641  : pred(pred), invoke(_Invoke<Pred>) {}
642 
643  inline bool operator()(const PcpPrimIndex &index,
644  TfTokenVector *childNamesToCompose) const {
645  return invoke(pred, index, childNamesToCompose);
646  }
647  private:
648  template <class Pred>
649  static bool _Invoke(const void *pred, const PcpPrimIndex &index,
650  TfTokenVector *namesToCompose) {
651  return (*static_cast<const Pred *>(pred))(index, namesToCompose);
652  }
653  const void *pred;
654  bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
655  };
656 
657  // See doc for _UntypedIndexingChildrenPredicate above. This does the same
658  // for the payload inclusion predicate.
659  struct _UntypedIndexingPayloadPredicate {
660  template <class Pred>
661  explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
662  : pred(pred), invoke(_Invoke<Pred>) {}
663 
664  inline bool operator()(const SdfPath &path) const {
665  return invoke(pred, path);
666  }
667  private:
668  template <class Pred>
669  static bool _Invoke(const void *pred, const SdfPath &path) {
670  return (*static_cast<const Pred *>(pred))(path);
671  }
672  const void *pred;
673  bool (*invoke)(const void *, const SdfPath &);
674  };
675 
676  // Internal helper for recursive indexing.
677  const PcpPrimIndex &
678  _ComputePrimIndexWithCompatibleInputs(
679  const SdfPath & path, const PcpPrimIndexInputs &inputs,
680  PcpErrorVector *allErrors);
681 
682  // Friend to allow low-level indexing code access to the above.
683  friend const PcpPrimIndex &
684  Pcp_ComputePrimIndexWithCompatibleInputs(
685  PcpCache &cache,
686  const SdfPath & path, const PcpPrimIndexInputs &inputs,
687  PcpErrorVector *allErrors);
688 
689  // Parallel indexing implementation.
690  PCP_API
691  void _ComputePrimIndexesInParallel(
692  const SdfPathVector &paths,
693  PcpErrorVector *allErrors,
694  _UntypedIndexingChildrenPredicate childrenPred,
695  _UntypedIndexingPayloadPredicate payloadPred,
696  const char *mallocTag1,
697  const char *mallocTag2);
698 
699  void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
700  void _RemovePrimAndPropertyCaches(const SdfPath& root,
701  PcpLifeboat* lifeboat);
702  void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
703  void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
704 
705  // Returns the prim index for \p path if it exists, NULL otherwise.
706  PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
707  const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
708 
709  // Returns the property index for \p path if it exists, NULL otherwise.
710  PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
711  const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
712 
713  PCP_API
714  void _ForEachPrimIndex(
715  const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
716 
717  PCP_API
718  void _ForEachLayerStack(
719  const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
720 
721 private:
722  // Fixed evaluation parameters, set when the cache is created. Note that
723  // _rootLayer and _sessionLayer are not const because we want to mutate them
724  // to enable parallel teardown in the destructor.
725  SdfLayerRefPtr _rootLayer;
726  SdfLayerRefPtr _sessionLayer;
727  const PcpLayerStackIdentifier _layerStackIdentifier;
728 
729  // Flag that configures PcpCache to use the restricted set of USD features.
730  // Currently it governs whether relocates, inherits, permissions,
731  // symmetry, or payloads are considered, and whether the prim stack
732  // is populated and its depdencies gathered during computation of
733  // prim indices and composition of prim child names.
734  const bool _usd;
735 
736  // File format target for all scene description layers this cache will
737  // find or open during prim index computation.
738  const std::string _fileFormatTarget;
739 
740  // The layer stack for this cache. Holding this by ref ptr means we
741  // hold all of our local layers by ref ptr (including the root and
742  // session layers, again).
743  PcpLayerStackRefPtr _layerStack;
744 
745  // Modifiable evaluation parameters.
746  // Anything that changes these should also yield a PcpChanges
747  // value describing the necessary cache invalidation.
748  PayloadSet _includedPayloads;
749  PcpVariantFallbackMap _variantFallbackMap;
750 
751  // Cached computation types.
752  typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
753  typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
754  typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
755 
756  // Cached computations.
757  _LayerStackCache _layerStackCache;
758  _PrimIndexCache _primIndexCache;
759  _PropertyIndexCache _propertyIndexCache;
760  std::unique_ptr<Pcp_Dependencies> _primDependencies;
761 
762  // Parallel indexer state.
763  std::unique_ptr<_ParallelIndexer> _parallelIndexer;
764 };
765 
766 PXR_NAMESPACE_CLOSE_SCOPE
767 
768 #endif // PXR_USD_PCP_CACHE_H
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:302
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 bool IsInvalidAssetPath(const std::string &resolvedAssetPath) const
Returns true if resolvedAssetPath was used by a prim (e.g.
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:76
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.
Standard pointer typedefs.
PCP_API PcpPrimIndexInputs GetPrimIndexInputs()
Returns parameter object containing all inputs for the prim index computation used by this cache.
Represents a stack of layers that contribute opinions to composition.
Definition: layerStack.h:65
void ForEachLayerStack(const Callback &callback) const
Run the given callbcack on every layer stack used by prim indexes in the cache.
Definition: cache.h:452
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:343
Describes Pcp changes.
Definition: changes.h:173
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...
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:67
PCP_API void Apply(const PcpCacheChanges &changes, PcpLifeboat *lifeboat)
Apply the changes in changes.
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:93
Base class for all Sdf spec classes.
Definition: spec.h:51
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 bool IsLayerMuted(const std::string &layerIdentifier) const
Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise.
PCP_API PcpLayerStackPtr GetLayerStack() const
Get the layer stack for GetLayerStackIdentifier().
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
PCP_API bool HasAnyDynamicFileFormatArgumentDependencies() const
Returns true if any prim index in this cache has a dependency on a dynamic file format argument field...
PCP_API SdfLayerHandleSet GetUsedRootLayers() const
Returns set of all root layers used by this cache.
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:36
void ForEachPrimIndex(const Callback &callback) const
Run the given callback on every prim index in the cache.
Definition: cache.h:365
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 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 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.
void ComputePrimIndexesInParallel(const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred)
Vectorized form of ComputePrimIndexesInParallel().
Definition: cache.h:329
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...
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:87
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.
Inputs for the prim indexing procedure.
Definition: primIndex.h:335
PCP_API SdfLayerHandleSet GetUsedLayers() const
Returns set of all layers used by this cache.
PCP_API PcpLayerStackPtr FindLayerStack(const PcpLayerStackIdentifier &identifier) const
Returns the layer stack for identifier if it has been computed and cached, otherwise returns NULL.
std::unordered_set< SdfPath, SdfPath::Hash > PayloadSet
Returns the payloads requested for inclusion.
Definition: cache.h:158
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.
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 ...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
PCP_API bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const
Return true if layerStack is used by this cache in its composition, false otherwise.
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:80
PCP_API const std::string & GetFileFormatTarget() const
Returns the file format target this cache is configured for.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
PCP_API const PcpLayerStackPtrVector & FindAllLayerStacksUsingLayer(const SdfLayerHandle &layer) const
Returns every computed & cached layer stack that includes layer.
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 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.
Types of changes per cache.
Definition: changes.h:97
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 bool IsPayloadIncluded(const SdfPath &path) const
Return true if the payload is included for the given path.
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 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 PcpVariantFallbackMap GetVariantFallbacks() const
Get the list of fallbacks to attempt to use when evaluating variant sets that lack an authored select...
PCP_API void PrintStatistics() const
Prints various statistics about the data stored in this cache.
PCP_API const PcpLayerStackIdentifier & GetLayerStackIdentifier() const
Get the identifier of the layerStack used for composition.
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 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.
PcpPropertyIndex is an index of all sites in scene description that contribute opinions to a specific...
Definition: propertyIndex.h:65
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:315
PCP_API const std::vector< std::string > & GetMutedLayers() const
Returns the list of canonical identifiers for muted layers in this cache.
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...
Structure used to temporarily retain layers and layerStacks within a code block.
Definition: changes.h:141
PCP_API bool IsUsd() const
Return true if the cache is configured in Usd mode.
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
Definition: types.h:188
Contains the necessary information for storing a prim index's dependency on dynamic file format argum...
Arguments used to identify a layer stack.