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 
134  bool HasRootLayerStack(PcpLayerStackRefPtr const &layerStack) const {
135  return layerStack == _layerStack;
136  }
137 
139  PCP_API
140  bool HasRootLayerStack(PcpLayerStackPtr const &layerStack) const;
141 
143  PCP_API
144  bool IsUsd() const;
145 
147  PCP_API
148  const std::string& GetFileFormatTarget() const;
149 
152  PCP_API
154 
161  PCP_API
162  void SetVariantFallbacks( const PcpVariantFallbackMap & map,
163  PcpChanges* changes = NULL );
164 
166  PCP_API
167  bool IsPayloadIncluded(const SdfPath &path) const;
168 
170  using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>;
171  PCP_API
172  PayloadSet const &GetIncludedPayloads() const;
173 
185  PCP_API
186  void RequestPayloads( const SdfPathSet & pathsToInclude,
187  const SdfPathSet & pathsToExclude,
188  PcpChanges* changes = NULL );
189 
218  PCP_API
219  void RequestLayerMuting(const std::vector<std::string>& layersToMute,
220  const std::vector<std::string>& layersToUnmute,
221  PcpChanges* changes = nullptr,
222  std::vector<std::string>* newLayersMuted = nullptr,
223  std::vector<std::string>* newLayersUnmuted =
224  nullptr);
225 
229  PCP_API
230  const std::vector<std::string>& GetMutedLayers() const;
231 
237  PCP_API
238  bool IsLayerMuted(const std::string& layerIdentifier) const;
239 
247  PCP_API
248  bool IsLayerMuted(const SdfLayerHandle& anchorLayer,
249  const std::string& layerIdentifier,
250  std::string* canonicalMutedLayerIdentifier
251  = nullptr) const;
252 
255  PCP_API
257 
259 
262 
268  PCP_API
269  PcpLayerStackRefPtr
270  ComputeLayerStack(const PcpLayerStackIdentifier &identifier,
271  PcpErrorVector *allErrors);
272 
275  PCP_API
276  PcpLayerStackPtr
277  FindLayerStack(const PcpLayerStackIdentifier &identifier) const;
278 
281  PCP_API
282  bool UsesLayerStack(const PcpLayerStackPtr &layerStack) const;
283 
287  PCP_API
288  const PcpPrimIndex &
289  ComputePrimIndex(const SdfPath &primPath, PcpErrorVector *allErrors);
290 
313  template <class ChildrenPredicate, class PayloadPredicate>
315  PcpErrorVector *allErrors,
316  const ChildrenPredicate &childrenPred,
317  const PayloadPredicate &payloadPred) {
318  ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
319  childrenPred, payloadPred,
320  "Pcp", "ComputePrimIndexesInParallel");
321  }
322 
326  template <class ChildrenPredicate, class PayloadPredicate>
328  PcpErrorVector *allErrors,
329  const ChildrenPredicate &childrenPred,
330  const PayloadPredicate &payloadPred,
331  const char *mallocTag1,
332  const char *mallocTag2) {
333  ComputePrimIndexesInParallel(SdfPathVector(1, path), allErrors,
334  childrenPred, payloadPred,
335  mallocTag1, mallocTag2);
336  }
337 
340  template <class ChildrenPredicate, class PayloadPredicate>
341  void ComputePrimIndexesInParallel(const SdfPathVector &paths,
342  PcpErrorVector *allErrors,
343  const ChildrenPredicate &childrenPred,
344  const PayloadPredicate &payloadPred) {
345  _UntypedIndexingChildrenPredicate cp(&childrenPred);
346  _UntypedIndexingPayloadPredicate pp(&payloadPred);
347  _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
348  "Pcp", "ComputePrimIndexesInParallel");
349  }
350 
354  template <class ChildrenPredicate, class PayloadPredicate>
355  void ComputePrimIndexesInParallel(const SdfPathVector &paths,
356  PcpErrorVector *allErrors,
357  const ChildrenPredicate &childrenPred,
358  const PayloadPredicate &payloadPred,
359  const char *mallocTag1,
360  const char *mallocTag2) {
361  _UntypedIndexingChildrenPredicate cp(&childrenPred);
362  _UntypedIndexingPayloadPredicate pp(&payloadPred);
363  _ComputePrimIndexesInParallel(paths, allErrors, cp, pp,
364  mallocTag1, mallocTag2);
365  }
366 
369  PCP_API
370  const PcpPrimIndex *
371  FindPrimIndex(const SdfPath &primPath) const;
372 
375  template <class Callback>
376  void
377  ForEachPrimIndex(const Callback& callback) const
378  {
379  TfFunctionRef<void(const PcpPrimIndex&)> fn(callback);
380  _ForEachPrimIndex(fn);
381  }
382 
386  PCP_API
387  const PcpPropertyIndex &
388  ComputePropertyIndex(const SdfPath &propPath, PcpErrorVector *allErrors);
389 
392  PCP_API
393  const PcpPropertyIndex *
394  FindPropertyIndex(const SdfPath &propPath) const;
395 
405  PCP_API
406  void
407  ComputeRelationshipTargetPaths(const SdfPath &relationshipPath,
408  SdfPathVector *paths,
409  bool localOnly,
410  const SdfSpecHandle &stopProperty,
411  bool includeStopProperty,
412  SdfPathVector *deletedPaths,
413  PcpErrorVector *allErrors);
414 
424  PCP_API
425  void
426  ComputeAttributeConnectionPaths(const SdfPath &attributePath,
427  SdfPathVector *paths,
428  bool localOnly,
429  const SdfSpecHandle &stopProperty,
430  bool includeStopProperty,
431  SdfPathVector *deletedPaths,
432  PcpErrorVector *allErrors);
433 
437 
439  PCP_API
440  SdfLayerHandleSet GetUsedLayers() const;
441 
447  PCP_API
448  size_t GetUsedLayersRevision() const;
449 
451  PCP_API
452  SdfLayerHandleSet GetUsedRootLayers() const;
453 
455  PCP_API
456  const PcpLayerStackPtrVector&
457  FindAllLayerStacksUsingLayer(const SdfLayerHandle& layer) const;
458 
462  template <class Callback>
463  void
464  ForEachLayerStack(const Callback& callback) const
465  {
466  TfFunctionRef<void(const PcpLayerStackPtr&)> fn(callback);
467  _ForEachLayerStack(fn);
468  }
469 
483  PCP_API
484  PcpDependencyVector
485  FindSiteDependencies(const PcpLayerStackPtr& siteLayerStack,
486  const SdfPath& sitePath,
487  PcpDependencyFlags depMask,
488  bool recurseOnSite,
489  bool recurseOnIndex,
490  bool filterForExistingCachesOnly) const;
491 
501  PCP_API
502  PcpDependencyVector
503  FindSiteDependencies(const SdfLayerHandle& siteLayer,
504  const SdfPath& sitePath,
505  PcpDependencyFlags depMask,
506  bool recurseOnSite,
507  bool recurseOnIndex,
508  bool filterForExistingCachesOnly) const;
509 
518  PCP_API
519  bool CanHaveOpinionForSite(const SdfPath& localPcpSitePath,
520  const SdfLayerHandle& layer,
521  SdfPath* allowedPathInLayer) const;
522 
525  PCP_API
526  std::vector<std::string> GetInvalidSublayerIdentifiers() const;
527 
532  PCP_API
533  bool IsInvalidSublayerIdentifier(const std::string& identifier) const;
534 
537  PCP_API
538  std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan>
539  GetInvalidAssetPaths() const;
540 
545  PCP_API
546  bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
547 
550  PCP_API
552 
556  PCP_API
557  bool IsPossibleDynamicFileFormatArgumentField(const TfToken &field) const;
558 
563  PCP_API
566  const SdfPath &primIndexPath) const;
567 
569 
572 
592  PCP_API
593  void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
594 
601  PCP_API
602  void Reload(PcpChanges* changes);
603 
615  PCP_API
616  void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
617 
619 
622 
624  PCP_API
625  void PrintStatistics() const;
626 
628 
629 private:
630  friend class PcpChanges;
631  friend class Pcp_Dependencies;
632  friend class Pcp_Statistics;
633 
634  struct _ParallelIndexer;
635 
636  // Helper struct to type-erase a children predicate for the duration of
637  // ComputePrimIndexesInParallel.
638  //
639  // This lets us achieve two goals. First, clients may pass any arbitrary
640  // type as a predicate (e.g. they do not have to derive some base class).
641  // Second, it lets us keep the parallel indexing implementation in the .cpp
642  // file, avoiding any large template code instantiation.
643  //
644  // The cost we pay is this very thin indirect call. We instantiate a
645  // function template with the client's predicate type that simply does a
646  // typecast and predicate invocation, and pass that function pointer into
647  // the implementation. There is no heap allocation, no predicate copy, no
648  // argument marshalling, etc.
649  struct _UntypedIndexingChildrenPredicate {
650  _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
651  template <class Pred>
652  explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
653  : pred(pred), invoke(_Invoke<Pred>) {}
654 
655  inline bool operator()(const PcpPrimIndex &index,
656  TfTokenVector *childNamesToCompose) const {
657  return invoke(pred, index, childNamesToCompose);
658  }
659  private:
660  template <class Pred>
661  static bool _Invoke(const void *pred, const PcpPrimIndex &index,
662  TfTokenVector *namesToCompose) {
663  return (*static_cast<const Pred *>(pred))(index, namesToCompose);
664  }
665  const void *pred;
666  bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
667  };
668 
669  // See doc for _UntypedIndexingChildrenPredicate above. This does the same
670  // for the payload inclusion predicate.
671  struct _UntypedIndexingPayloadPredicate {
672  template <class Pred>
673  explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
674  : pred(pred), invoke(_Invoke<Pred>) {}
675 
676  inline bool operator()(const SdfPath &path) const {
677  return invoke(pred, path);
678  }
679  private:
680  template <class Pred>
681  static bool _Invoke(const void *pred, const SdfPath &path) {
682  return (*static_cast<const Pred *>(pred))(path);
683  }
684  const void *pred;
685  bool (*invoke)(const void *, const SdfPath &);
686  };
687 
688  // Internal helper for recursive indexing.
689  const PcpPrimIndex &
690  _ComputePrimIndexWithCompatibleInputs(
691  const SdfPath & path, const PcpPrimIndexInputs &inputs,
692  PcpErrorVector *allErrors);
693 
694  // Friend to allow low-level indexing code access to the above.
695  friend const PcpPrimIndex &
696  Pcp_ComputePrimIndexWithCompatibleInputs(
697  PcpCache &cache,
698  const SdfPath & path, const PcpPrimIndexInputs &inputs,
699  PcpErrorVector *allErrors);
700 
701  // Parallel indexing implementation.
702  PCP_API
703  void _ComputePrimIndexesInParallel(
704  const SdfPathVector &paths,
705  PcpErrorVector *allErrors,
706  _UntypedIndexingChildrenPredicate childrenPred,
707  _UntypedIndexingPayloadPredicate payloadPred,
708  const char *mallocTag1,
709  const char *mallocTag2);
710 
711  void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
712  void _RemovePrimAndPropertyCaches(const SdfPath& root,
713  PcpLifeboat* lifeboat);
714  void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
715  void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
716 
717  // Returns the prim index for \p path if it exists, NULL otherwise.
718  PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
719  const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
720 
721  // Returns the property index for \p path if it exists, NULL otherwise.
722  PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
723  const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
724 
725  PCP_API
726  void _ForEachPrimIndex(
727  const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
728 
729  PCP_API
730  void _ForEachLayerStack(
731  const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
732 
733 private:
734  // Fixed evaluation parameters, set when the cache is created. Note that
735  // _rootLayer and _sessionLayer are not const because we want to mutate them
736  // to enable parallel teardown in the destructor.
737  SdfLayerRefPtr _rootLayer;
738  SdfLayerRefPtr _sessionLayer;
739  const PcpLayerStackIdentifier _layerStackIdentifier;
740 
741  // Flag that configures PcpCache to use the restricted set of USD features.
742  // Currently it governs whether relocates, inherits, permissions,
743  // symmetry, or payloads are considered, and whether the prim stack
744  // is populated and its depdencies gathered during computation of
745  // prim indices and composition of prim child names.
746  const bool _usd;
747 
748  // File format target for all scene description layers this cache will
749  // find or open during prim index computation.
750  const std::string _fileFormatTarget;
751 
752  // The layer stack for this cache. Holding this by ref ptr means we
753  // hold all of our local layers by ref ptr (including the root and
754  // session layers, again).
755  PcpLayerStackRefPtr _layerStack;
756 
757  // Modifiable evaluation parameters.
758  // Anything that changes these should also yield a PcpChanges
759  // value describing the necessary cache invalidation.
760  PayloadSet _includedPayloads;
761  PcpVariantFallbackMap _variantFallbackMap;
762 
763  // Cached computation types.
764  typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
765  typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
766  typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
767 
768  // Cached computations.
769  _LayerStackCache _layerStackCache;
770  _PrimIndexCache _primIndexCache;
771  _PropertyIndexCache _propertyIndexCache;
772  std::unique_ptr<Pcp_Dependencies> _primDependencies;
773 
774  // Parallel indexer state.
775  std::unique_ptr<_ParallelIndexer> _parallelIndexer;
776 };
777 
778 PXR_NAMESPACE_CLOSE_SCOPE
779 
780 #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:314
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:464
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:355
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:52
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.
bool HasRootLayerStack(PcpLayerStackRefPtr const &layerStack) const
Return true if this cache's root layer stack is layerStack, false otherwise.
Definition: cache.h:134
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:377
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:341
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:339
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:170
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:327
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.