Loading...
Searching...
No Matches
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
49PXR_NAMESPACE_OPEN_SCOPE
50
51// Forward declarations:
52class PcpChanges;
53class PcpCacheChanges;
54class Pcp_Dependencies;
56class PcpLifeboat;
57class PcpNodeRef;
58class PcpMapFunction;
59
61TF_DECLARE_WEAK_AND_REF_PTRS(Pcp_LayerStackRegistry);
62SDF_DECLARE_HANDLES(SdfSpec);
63
94{
95 PcpCache(PcpCache const &) = delete;
96 PcpCache &operator=(PcpCache const &) = delete;
97public:
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
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
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
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>
540
545 PCP_API
546 bool IsInvalidAssetPath(const std::string& resolvedAssetPath) const;
547
550 PCP_API
552
555 PCP_API
557
561 PCP_API
563
567 PCP_API
569 const TfToken &attributeName) const;
570
575 PCP_API
578 const SdfPath &primIndexPath) const;
579
582 PCP_API
584 const PcpLayerStackPtr &layerStack) const;
585
588 PCP_API
589 const std::unordered_set<std::string>&
591 const SdfPath &primIndexPath,
592 const PcpLayerStackPtr &layerStack) const;
593
595
598
618 PCP_API
619 void Apply(const PcpCacheChanges& changes, PcpLifeboat* lifeboat);
620
627 PCP_API
628 void Reload(PcpChanges* changes);
629
641 PCP_API
642 void ReloadReferences(PcpChanges* changes, const SdfPath& primPath);
643
645
648
650 PCP_API
651 void PrintStatistics() const;
652
654
655private:
656 friend class PcpChanges;
657 friend class Pcp_Dependencies;
658 friend class Pcp_Statistics;
659
660 struct _ParallelIndexer;
661
662 // Helper struct to type-erase a children predicate for the duration of
663 // ComputePrimIndexesInParallel.
664 //
665 // This lets us achieve two goals. First, clients may pass any arbitrary
666 // type as a predicate (e.g. they do not have to derive some base class).
667 // Second, it lets us keep the parallel indexing implementation in the .cpp
668 // file, avoiding any large template code instantiation.
669 //
670 // The cost we pay is this very thin indirect call. We instantiate a
671 // function template with the client's predicate type that simply does a
672 // typecast and predicate invocation, and pass that function pointer into
673 // the implementation. There is no heap allocation, no predicate copy, no
674 // argument marshalling, etc.
675 struct _UntypedIndexingChildrenPredicate {
676 _UntypedIndexingChildrenPredicate() : pred(nullptr), invoke(nullptr) {}
677 template <class Pred>
678 explicit _UntypedIndexingChildrenPredicate(const Pred *pred)
679 : pred(pred), invoke(_Invoke<Pred>) {}
680
681 inline bool operator()(const PcpPrimIndex &index,
682 TfTokenVector *childNamesToCompose) const {
683 return invoke(pred, index, childNamesToCompose);
684 }
685 private:
686 template <class Pred>
687 static bool _Invoke(const void *pred, const PcpPrimIndex &index,
688 TfTokenVector *namesToCompose) {
689 return (*static_cast<const Pred *>(pred))(index, namesToCompose);
690 }
691 const void *pred;
692 bool (*invoke)(const void *, const PcpPrimIndex &, TfTokenVector *);
693 };
694
695 // See doc for _UntypedIndexingChildrenPredicate above. This does the same
696 // for the payload inclusion predicate.
697 struct _UntypedIndexingPayloadPredicate {
698 template <class Pred>
699 explicit _UntypedIndexingPayloadPredicate(const Pred *pred)
700 : pred(pred), invoke(_Invoke<Pred>) {}
701
702 inline bool operator()(const SdfPath &path) const {
703 return invoke(pred, path);
704 }
705 private:
706 template <class Pred>
707 static bool _Invoke(const void *pred, const SdfPath &path) {
708 return (*static_cast<const Pred *>(pred))(path);
709 }
710 const void *pred;
711 bool (*invoke)(const void *, const SdfPath &);
712 };
713
714 // Internal helper for recursive indexing.
715 const PcpPrimIndex &
716 _ComputePrimIndexWithCompatibleInputs(
717 const SdfPath & path, const PcpPrimIndexInputs &inputs,
718 PcpErrorVector *allErrors);
719
720 // Friend to allow low-level indexing code access to the above.
721 friend const PcpPrimIndex &
722 Pcp_ComputePrimIndexWithCompatibleInputs(
723 PcpCache &cache,
724 const SdfPath & path, const PcpPrimIndexInputs &inputs,
725 PcpErrorVector *allErrors);
726
727 // Parallel indexing implementation.
728 PCP_API
729 void _ComputePrimIndexesInParallel(
730 const SdfPathVector &paths,
731 PcpErrorVector *allErrors,
732 _UntypedIndexingChildrenPredicate childrenPred,
733 _UntypedIndexingPayloadPredicate payloadPred,
734 const char *mallocTag1,
735 const char *mallocTag2);
736
737 void _RemovePrimCache(const SdfPath& primPath, PcpLifeboat* lifeboat);
738 void _RemovePrimAndPropertyCaches(const SdfPath& root,
739 PcpLifeboat* lifeboat);
740 void _RemovePropertyCache(const SdfPath& root, PcpLifeboat* lifeboat);
741 void _RemovePropertyCaches(const SdfPath& root, PcpLifeboat* lifeboat);
742
743 // Returns the prim index for \p path if it exists, NULL otherwise.
744 PcpPrimIndex* _GetPrimIndex(const SdfPath& path);
745 const PcpPrimIndex* _GetPrimIndex(const SdfPath& path) const;
746
747 // Returns the property index for \p path if it exists, NULL otherwise.
748 PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path);
749 const PcpPropertyIndex* _GetPropertyIndex(const SdfPath& path) const;
750
751 PCP_API
752 void _ForEachPrimIndex(
753 const TfFunctionRef<void(const PcpPrimIndex&)>& fn) const;
754
755 PCP_API
756 void _ForEachLayerStack(
757 const TfFunctionRef<void(const PcpLayerStackPtr&)>& fn) const;
758
759private:
760 // Fixed evaluation parameters, set when the cache is created. Note that
761 // _rootLayer and _sessionLayer are not const because we want to mutate them
762 // to enable parallel teardown in the destructor.
763 SdfLayerRefPtr _rootLayer;
764 SdfLayerRefPtr _sessionLayer;
765 const PcpLayerStackIdentifier _layerStackIdentifier;
766
767 // Flag that configures PcpCache to use the restricted set of USD features.
768 // Currently it governs whether relocates, inherits, permissions,
769 // symmetry, or payloads are considered, and whether the prim stack
770 // is populated and its depdencies gathered during computation of
771 // prim indices and composition of prim child names.
772 const bool _usd;
773
774 // File format target for all scene description layers this cache will
775 // find or open during prim index computation.
776 const std::string _fileFormatTarget;
777
778 // The layer stack for this cache. Holding this by ref ptr means we
779 // hold all of our local layers by ref ptr (including the root and
780 // session layers, again).
781 PcpLayerStackRefPtr _layerStack;
782
783 // Modifiable evaluation parameters.
784 // Anything that changes these should also yield a PcpChanges
785 // value describing the necessary cache invalidation.
786 PayloadSet _includedPayloads;
787 PcpVariantFallbackMap _variantFallbackMap;
788
789 // Cached computation types.
790 typedef Pcp_LayerStackRegistryRefPtr _LayerStackCache;
791 typedef SdfPathTable<PcpPrimIndex> _PrimIndexCache;
792 typedef SdfPathTable<PcpPropertyIndex> _PropertyIndexCache;
793
794 // Cached computations.
795 _LayerStackCache _layerStackCache;
796 _PrimIndexCache _primIndexCache;
797 _PropertyIndexCache _propertyIndexCache;
798 std::unique_ptr<Pcp_Dependencies> _primDependencies;
799
800 // Parallel indexer state.
801 std::unique_ptr<_ParallelIndexer> _parallelIndexer;
802};
803
804PXR_NAMESPACE_CLOSE_SCOPE
805
806#endif // PXR_USD_PCP_CACHE_H
Types of changes per cache.
Definition: changes.h:115
PcpCache is the context required to make requests of the Pcp composition algorithm and cache the resu...
Definition: cache.h:94
std::unordered_set< SdfPath, SdfPath::Hash > PayloadSet
Returns the payloads requested for inclusion.
Definition: cache.h:170
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
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:377
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:327
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:134
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:314
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:341
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:464
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:191
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:67
Arguments used to identify a layer stack.
Structure used to temporarily retain layers and layerStacks within a code block.
Definition: changes.h:159
A function that maps values from one namespace (and time domain) to another.
Definition: mapFunction.h:82
PcpNode represents a node in an expression tree for compositing scene description.
Definition: node.h:64
PcpPrimIndex is an index of the all sites of scene description that contribute opinions to a specific...
Definition: primIndex.h:78
Inputs for the prim indexing procedure.
Definition: primIndex.h:349
PcpPropertyIndex is an index of all sites in scene description that contribute opinions to a specific...
Definition: propertyIndex.h:66
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
A mapping from SdfPath to MappedType, somewhat similar to map<SdfPath, MappedType> and TfHashMap<SdfP...
Definition: pathTable.h:83
Base class for all Sdf spec classes.
Definition: spec.h:50
This class provides a non-owning reference to a type-erased callable object with a specified signatur...
Definition: functionRef.h:36
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:88
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
std::map< std::string, std::vector< std::string > > PcpVariantFallbackMap
typedef std::map<std::string, std::vector<std::string>> PcpVariantFallbackMap
Definition: types.h:206