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 
186 #if AR_VERSION == 1
187 #else
194 #endif
199  PCP_API
216  void RequestLayerMuting(const std::vector<std::string>& layersToMute,
217  const std::vector<std::string>& layersToUnmute,
218  PcpChanges* changes = nullptr,
219  std::vector<std::string>* newLayersMuted = nullptr,
220  std::vector<std::string>* newLayersUnmuted =
221  nullptr);
222 
226  PCP_API
227  const std::vector<std::string>& GetMutedLayers() const;
228 
234  PCP_API
235  bool IsLayerMuted(const std::string& layerIdentifier) const;
236 
244  PCP_API
245  bool IsLayerMuted(const SdfLayerHandle& anchorLayer,
246  const std::string& layerIdentifier,
247  std::string* canonicalMutedLayerIdentifier
248  = nullptr) const;
249 
252  PCP_API
254 
256 
259 
265  PCP_API
266  PcpLayerStackRefPtr
267  ComputeLayerStack(const PcpLayerStackIdentifier &identifier,
268  PcpErrorVector *allErrors);
269 
272  PCP_API
273  PcpLayerStackPtr
274  FindLayerStack(const PcpLayerStackIdentifier &identifier) const;
275 
278  PCP_API
279  bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const;
280 
284  PCP_API
285  const PcpPrimIndex &
286  ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors);
287 
310  template <class ChildrenPredicate, class PayloadPredicate>
312  PcpErrorVector *allErrors,
313  const ChildrenPredicate &childrenPred,
314  const PayloadPredicate &payloadPred) {
315  ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
316  childrenPred, payloadPred,
317  "Pcp", "ComputePrimIndexesInParallel");
318  }
319 
323  template <class ChildrenPredicate, class PayloadPredicate>
325  PcpErrorVector *allErrors,
326  const ChildrenPredicate &childrenPred,
327  const PayloadPredicate &payloadPred,
328  const char *mallocTag1,
329  const char *mallocTag2) {
330  ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
331  childrenPred, payloadPred,
332  mallocTag1, mallocTag2);
333  }
334 
337  template <class ChildrenPredicate, class PayloadPredicate>
338  void ComputePrimIndexesInParallel(const SdfPathVector &paths,
339  PcpErrorVector *allErrors,
340  const ChildrenPredicate &childrenPred,
341  const PayloadPredicate &payloadPred) {
342  _UntypedIndexingChildrenPredicate cp(&childrenPred);
343  _UntypedIndexingPayloadPredicate pp(&payloadPred);
344  _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
345  "Pcp", "ComputePrimIndexesInParallel");
346  }
347 
351  template <class ChildrenPredicate, class PayloadPredicate>
352  void ComputePrimIndexesInParallel(const SdfPathVector &paths,
353  PcpErrorVector *allErrors,
354  const ChildrenPredicate &childrenPred,
355  const PayloadPredicate &payloadPred,
356  const char *mallocTag1,
357  const char *mallocTag2) {
358  _UntypedIndexingChildrenPredicate cp(&childrenPred);
359  _UntypedIndexingPayloadPredicate pp(&payloadPred);
360  _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
361  mallocTag1, mallocTag2);
362  }
363 
366  PCP_API
367  const PcpPrimIndex *
368  FindPrimIndex(const SdfPath &primPath) const;
369 
372  template <class Callback>
373  void
374  ForEachPrimIndex(const Callback& callback) const
375  {
376  TfFunctionRef<void(const PcpPrimIndex&)> fn(callback);
377  _ForEachPrimIndex(fn);
378  }
379 
383  PCP_API
384  const PcpPropertyIndex &
385  ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors);
386 
389  PCP_API
390  const PcpPropertyIndex *
391  FindPropertyIndex(const SdfPath &propPath) const;
392 
402  PCP_API
403  void
404  ComputeRelationshipTargetPaths(const SdfPath &relationshipPath,
405  SdfPathVector *paths,
406  bool localOnly,
407  const SdfSpecHandle &stopProperty,
408  bool includeStopProperty,
409  SdfPathVector *deletedPaths,
410  PcpErrorVector *allErrors);
411 
421  PCP_API
422  void
423  ComputeAttributeConnectionPaths(const SdfPath &attributePath,
424  SdfPathVector *paths,
425  bool localOnly,
426  const SdfSpecHandle &stopProperty,
427  bool includeStopProperty,
428  SdfPathVector *deletedPaths,
429  PcpErrorVector *allErrors);
430 
434 
436  PCP_API
437  SdfLayerHandleSet GetUsedLayers() const;
438 
444  PCP_API
445  size_t GetUsedLayersRevision() const;
446 
448  PCP_API
449  SdfLayerHandleSet GetUsedRootLayers() const;
450 
452  PCP_API
453  const PcpLayerStackPtrVector&
454  FindAllLayerStacksUsingLayer(const SdfLayerHandle& layer) const;
455 
459  template <class Callback>
460  void
461  ForEachLayerStack(const Callback& callback) const
462  {
463  TfFunctionRef<void(const PcpLayerStackPtr&)> fn(callback);
464  _ForEachLayerStack(fn);
465  }
466 
480  PCP_API
481  PcpDependencyVector
482  FindSiteDependencies(const PcpLayerStackPtr& siteLayerStack,
483  const SdfPath& sitePath,
484  PcpDependencyFlags depMask,
485  bool recurseOnSite,
486  bool recurseOnIndex,
487  bool filterForExistingCachesOnly) const;
488 
498  PCP_API
499  PcpDependencyVector
500  FindSiteDependencies(const SdfLayerHandle& siteLayer,
501  const SdfPath& sitePath,
502  PcpDependencyFlags depMask,
503  bool recurseOnSite,
504  bool recurseOnIndex,
505  bool filterForExistingCachesOnly) const;
506 
515  PCP_API
516  bool CanHaveOpinionForSite(const SdfPath& localPcpSitePath,
517  const SdfLayerHandle& layer,
518  SdfPath* allowedPathInLayer) const;
519 
522  PCP_API
523  std::vector<std::string> GetInvalidSublayerIdentifiers() const;
524 
529  PCP_API
530  bool IsInvalidSublayerIdentifier(const std::string& identifier) const;
531 
534  PCP_API
535  std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan>
536  GetInvalidAssetPaths() const;
537 
542  PCP_API
543  bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
544 
547  PCP_API
549 
553  PCP_API
554  bool IsPossibleDynamicFileFormatArgumentField(const TfToken &field) const;
555 
560  PCP_API
563  const SdfPath &primIndexPath) const;
564 
566 
569 
589  PCP_API
590  void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
591 
598  PCP_API
599  void Reload(PcpChanges* changes);
600 
612  PCP_API
613  void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
614 
616 
619 
621  PCP_API
622  void PrintStatistics() const;
623 
625 
626 private:
627  friend class PcpChanges;
628  friend class Pcp_Statistics;
629 
630  struct _ParallelIndexer;
631 
632  // Helper struct to type-erase a children predicate for the duration of
633  // ComputePrimIndexesInParallel.
634  //
635  // This lets us achieve two goals. First, clients may pass any arbitrary
636  // type as a predicate (e.g. they do not have to derive some base class).
637  // Second, it lets us keep the parallel indexing implementation in the .cpp
638  // file, avoiding any large template code instantiation.
639  //
640  // The cost we pay is this very thin indirect call. We instantiate a
641  // function template with the client's predicate type that simply does a
642  // typecast and predicate invocation, and pass that function pointer into
643  // the implementation. There is no heap allocation, no predicate copy, no
644  // argument marshalling, etc.
645  struct _UntypedIndexingChildrenPredicate {
646  _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
647  template <class Pred>
648  explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
649  : pred(pred), invoke(_Invoke<Pred>) {}
650 
651  inline bool operator()(const PcpPrimIndex &index,
652  TfTokenVector *childNamesToCompose) const {
653  return invoke(pred, index, childNamesToCompose);
654  }
655  private:
656  template <class Pred>
657  static bool _Invoke(const void *pred, const PcpPrimIndex &index,
658  TfTokenVector *namesToCompose) {
659  return (*static_cast<const Pred *>(pred))(index, namesToCompose);
660  }
661  const void *pred;
662  bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
663  };
664 
665  // See doc for _UntypedIndexingChildrenPredicate above. This does the same
666  // for the payload inclusion predicate.
667  struct _UntypedIndexingPayloadPredicate {
668  template <class Pred>
669  explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
670  : pred(pred), invoke(_Invoke<Pred>) {}
671 
672  inline bool operator()(const SdfPath &path) const {
673  return invoke(pred, path);
674  }
675  private:
676  template <class Pred>
677  static bool _Invoke(const void *pred, const SdfPath &path) {
678  return (*static_cast<const Pred *>(pred))(path);
679  }
680  const void *pred;
681  bool (*invoke)(const void *, const SdfPath &);
682  };
683 
684  // Internal helper for recursive indexing.
685  const PcpPrimIndex &
686  _ComputePrimIndexWithCompatibleInputs(
687  const SdfPath & path, const PcpPrimIndexInputs &inputs,
688  PcpErrorVector *allErrors);
689 
690  // Friend to allow low-level indexing code access to the above.
691  friend const PcpPrimIndex &
692  Pcp_ComputePrimIndexWithCompatibleInputs(
693  PcpCache &cache,
694  const SdfPath & path, const PcpPrimIndexInputs &inputs,
695  PcpErrorVector *allErrors);
696 
697  // Parallel indexing implementation.
698  PCP_API
699  void _ComputePrimIndexesInParallel(
700  const SdfPathVector &paths,
701  PcpErrorVector *allErrors,
702  _UntypedIndexingChildrenPredicate childrenPred,
703  _UntypedIndexingPayloadPredicate payloadPred,
704  const char *mallocTag1,
705  const char *mallocTag2);
706 
707  void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
708  void _RemovePrimAndPropertyCaches(const SdfPath& root,
709  PcpLifeboat* lifeboat);
710  void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
711  void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
712 
713  // Returns the prim index for \p path if it exists, NULL otherwise.
714  PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
715  const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
716 
717  // Returns the property index for \p path if it exists, NULL otherwise.
718  PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
719  const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
720 
721  PCP_API
722  void _ForEachPrimIndex(
723  const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
724 
725  PCP_API
726  void _ForEachLayerStack(
727  const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
728 
729 private:
730  // Fixed evaluation parameters, set when the cache is created. Note that
731  // _rootLayer and _sessionLayer are not const because we want to mutate them
732  // to enable parallel teardown in the destructor.
733  SdfLayerRefPtr _rootLayer;
734  SdfLayerRefPtr _sessionLayer;
735  const PcpLayerStackIdentifier _layerStackIdentifier;
736 
737  // Flag that configures PcpCache to use the restricted set of USD features.
738  // Currently it governs whether relocates, inherits, permissions,
739  // symmetry, or payloads are considered, and whether the prim stack
740  // is populated and its depdencies gathered during computation of
741  // prim indices and composition of prim child names.
742  const bool _usd;
743 
744  // File format target for all scene description layers this cache will
745  // find or open during prim index computation.
746  const std::string _fileFormatTarget;
747 
748  // The layer stack for this cache. Holding this by ref ptr means we
749  // hold all of our local layers by ref ptr (including the root and
750  // session layers, again).
751  PcpLayerStackRefPtr _layerStack;
752 
753  // Modifiable evaluation parameters.
754  // Anything that changes these should also yield a PcpChanges
755  // value describing the necessary cache invalidation.
756  PayloadSet _includedPayloads;
757  PcpVariantFallbackMap _variantFallbackMap;
758 
759  // Cached computation types.
760  typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
761  typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
762  typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
763 
764  // Cached computations.
765  _LayerStackCache _layerStackCache;
766  _PrimIndexCache _primIndexCache;
767  _PropertyIndexCache _propertyIndexCache;
768  std::unique_ptr<Pcp_Dependencies> _primDependencies;
769 
770  // Parallel indexer state.
771  std::unique_ptr<_ParallelIndexer> _parallelIndexer;
772 };
773 
774 PXR_NAMESPACE_CLOSE_SCOPE
775 
776 #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:311
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:75
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:461
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:352
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:374
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:338
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:330
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:324
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.