This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PcpCache Class Reference

PcpCache is the context required to make requests of the Pcp composition algorithm and cache the results. More...

#include <cache.h>

Public Member Functions

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.
 
Computations
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 identifier.
 
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 bool UsesLayerStack (const PcpLayerStackPtr &layerStack) const
 Return true if layerStack is used by this cache in its composition, false otherwise.
 
PCP_API const PcpPrimIndexComputePrimIndex (const SdfPath &primPath, PcpErrorVector *allErrors)
 Compute and return a reference to the cached result for the prim index for the given path.
 
template<class ChildrenPredicate , class PayloadPredicate >
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 supplied childrenPred.
 
template<class ChildrenPredicate , class PayloadPredicate >
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 only in what argument(s) it accepts. XXX Do not add new callers of this method.
 
template<class ChildrenPredicate , class PayloadPredicate >
void ComputePrimIndexesInParallel (const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred)
 Vectorized form of ComputePrimIndexesInParallel().
 
template<class ChildrenPredicate , class PayloadPredicate >
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 only in what argument(s) it accepts. XXX Do not add new callers of this method.
 
PCP_API const PcpPrimIndexFindPrimIndex (const SdfPath &primPath) const
 Returns a pointer to the cached computed prim index for the given path, or NULL if it has not been computed.
 
template<class Callback >
void ForEachPrimIndex (const Callback &callback) const
 Run the given callback on every prim index in the cache.
 
PCP_API const PcpPropertyIndexComputePropertyIndex (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 PcpPropertyIndexFindPropertyIndex (const SdfPath &propPath) const
 Returns a pointer to the cached computed property index for the given path, or NULL if it has not been computed.
 
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 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.
 
Dependencies
PCP_API SdfLayerHandleSet GetUsedLayers () const
 Returns set of all layers used by this cache.
 
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 have changed or not.
 
PCP_API SdfLayerHandleSet GetUsedRootLayers () const
 Returns set of all root layers used by this cache.
 
PCP_API const PcpLayerStackPtrVector & FindAllLayerStacksUsingLayer (const SdfLayerHandle &layer) const
 Returns every computed & cached layer stack that includes layer.
 
template<class Callback >
void ForEachLayerStack (const Callback &callback) const
 Run the given callbcack on every layer stack used by prim indexes in the cache.
 
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 computations.
 
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 computations.
 
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 provided by an opinion in layer, false otherwise.
 
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 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 layer.
 
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 bool IsInvalidAssetPath (const std::string &resolvedAssetPath) const
 Returns true if resolvedAssetPath was used by a prim (e.g.
 
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 bool HasAnyDynamicFileFormatArgumentAttributeDependencies () const
 Returns true if any prim index in this cache has a dependency on a dynamic file format argument attribute's default value field.
 
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 file format arguments for any prim index 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 composed while generating dynamic file format arguments for any prim index in this cache.
 
PCP_API const PcpDynamicFileFormatDependencyDataGetDynamicFileFormatArgumentDependencyData (const SdfPath &primIndexPath) const
 Returns the dynamic file format dependency data object for the prim index with the given primIndexPath.
 
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 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 primIndexPath.
 
Change handling
PCP_API void Apply (const PcpCacheChanges &changes, PcpLifeboat *lifeboat)
 Apply the changes in changes.
 
PCP_API void Reload (PcpChanges *changes)
 Reload the layers of the layer stack, except session layers and sublayers of session layers.
 
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.
 
Diagnostics
PCP_API void PrintStatistics () const
 Prints various statistics about the data stored in this cache.
 

Friends

class PcpChanges
 

Parameters

using PayloadSet = std::unordered_set< SdfPath, SdfPath::Hash >
 Returns the payloads requested for inclusion.
 
PCP_API const PcpLayerStackIdentifierGetLayerStackIdentifier () const
 Get the identifier of the layerStack used for composition.
 
PCP_API PcpLayerStackPtr GetLayerStack () const
 Get the layer stack for GetLayerStackIdentifier().
 
bool HasRootLayerStack (PcpLayerStackRefPtr const &layerStack) const
 Return true if this cache's root layer stack is layerStack, false otherwise.
 
PCP_API bool HasRootLayerStack (PcpLayerStackPtr const &layerStack) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
PCP_API bool IsUsd () const
 Return true if the cache is configured in Usd mode.
 
PCP_API const std::string & GetFileFormatTarget () const
 Returns the file format target this cache is configured for.
 
PCP_API PcpVariantFallbackMap GetVariantFallbacks () const
 Get the list of fallbacks to attempt to use when evaluating variant sets that lack an authored selection.
 
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 selection.
 
PCP_API bool IsPayloadIncluded (const SdfPath &path) const
 Return true if the payload is included for the given path.
 
PCP_API PayloadSet const & GetIncludedPayloads () const
 
PCP_API void RequestPayloads (const SdfPathSet &pathsToInclude, const SdfPathSet &pathsToExclude, PcpChanges *changes=NULL)
 Request payloads to be included or excluded from composition.
 
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 std::vector< std::string > & GetMutedLayers () const
 Returns the list of canonical identifiers for muted layers 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 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.
 
PCP_API PcpPrimIndexInputs GetPrimIndexInputs ()
 Returns parameter object containing all inputs for the prim index computation used by this cache.
 

Detailed Description

PcpCache is the context required to make requests of the Pcp composition algorithm and cache the results.

Because the algorithms are recursive – making a request typically makes other internal requests to solve subproblems – caching subproblem results is required for reasonable performance, and so this cache is the only entrypoint to the algorithms.

There is a set of parameters that affect the composition results:

  • variant fallbacks: per named variant set, an ordered list of fallback values to use when composing a prim that defines a variant set but does not specify a selection
  • payload inclusion set: an SdfPath set used to identify which prims should have their payloads included during composition; this is the basis for explicit control over the "working set" of composition
  • file format target: the file format target that Pcp will request when opening scene description layers
  • "USD mode" configures the Pcp composition algorithm to provide only a custom, lighter subset of the full feature set, as needed by the Universal Scene Description system

There are a number of different computations that can be requested. These include computing a layer stack from a PcpLayerStackIdentifier, computing a prim index or prim stack, and computing a property index.

Definition at line 76 of file cache.h.

Member Typedef Documentation

◆ PayloadSet

using PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash>

Returns the payloads requested for inclusion.

Definition at line 153 of file cache.h.

Constructor & Destructor Documentation

◆ PcpCache()

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.

If fileFormatTarget is given, Pcp will specify fileFormatTarget as the file format target when searching for or opening a layer.

If usd is true, computation of prim indices and composition of prim child names are performed without relocates, inherits, permissions, symmetry, or payloads, and without populating the prim stack and gathering its dependencies.

Member Function Documentation

◆ Apply()

PCP_API void Apply ( const PcpCacheChanges changes,
PcpLifeboat lifeboat 
)

Apply the changes in changes.

This blows caches. It's up to the client to pull on those caches again as needed.

Objects that are no longer needed and would be destroyed are retained in lifeboat and won't be destroyed until lifeboat is itself destroyed. This gives the client control over the timing of the destruction of those objects. Clients may choose to pull on the caches before destroying lifeboat. That may cause the caches to again retain the objects, meaning they won't be destroyed when lifeboat is destroyed.

For example, if blowing a cache means an SdfLayer is no longer needed then lifeboat will hold an SdfLayerRefPtr to that layer. The client can then pull on that cache, which could cause the cache to hold an SdfLayerRefPtr to the layer again. If so then destroying changes will not destroy the layer. In any case, we don't destroy the layer and then read it again. However, if the client destroys lifeboat before pulling on the cache then we would destroy the layer then read it again.

◆ CanHaveOpinionForSite()

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 provided by an opinion in layer, false otherwise.

If true and allowedPathInLayer is not NULL then it's set to a path in layer that would provide an opinion.

This returns false if no prim index has yet been computed for localPcpSitePath.

◆ ComputeAttributeConnectionPaths()

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.

If localOnly is true then this will compose attribute connections from local nodes only. If stopProperty is not NULL then this will stop composing attribute connections at stopProperty, including stopProperty iff includeStopProperty is true. If not NULL, deletedPaths will be populated with connection paths whose deletion contributed to the computed result. allErrors will contain any errors encountered while performing this operation.

◆ ComputeLayerStack()

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 identifier.

This returns NULL if identifier is invalid (i.e. its root layer is NULL). allErrors will contain any errors encountered while creating a new layer stack. It'll be unchanged if the layer stack already existed.

◆ ComputePrimIndex()

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.

allErrors will contain any errors encountered while performing this operation.

◆ ComputePrimIndexesInParallel() [1/4]

void ComputePrimIndexesInParallel ( const SdfPath path,
PcpErrorVector *  allErrors,
const ChildrenPredicate &  childrenPred,
const PayloadPredicate &  payloadPred 
)
inline

Compute PcpPrimIndexes in the subtree rooted at path in parallel, recursing to children based on the supplied childrenPred.

Also include payloads not already in this cache's included payloads (see GetIncludedPayloads()) according to payloadPred.

This is similar to ComputePrimIndex(), except it computes an entire subtree of indexes in parallel so it can be much more efficient. This function invokes both childrenPred and payloadPred concurrently, so it must be safe to do so.

When a PcpPrimIndex computation completes invoke childrenPred, passing it the PcpPrimIndex. If childrenPred returns true, continue indexing children prim indexes. In this case, childrenPred may provide a list of names of the children prim indexes to compute. If it does not, all children prim indexes will be computed. If childrenPred returns false, stop indexing in that subtree.

If payloads discovered during indexing do not already appear in this cache's set of included payloads, invoke payloadPred, passing it the path for the prim with the payload. If payloadPred returns true, include its payload and add it to the cache's set of included payloads upon completion.

Definition at line 300 of file cache.h.

◆ ComputePrimIndexesInParallel() [2/4]

void ComputePrimIndexesInParallel ( const SdfPath path,
PcpErrorVector *  allErrors,
const ChildrenPredicate &  childrenPred,
const PayloadPredicate &  payloadPred,
const char *  mallocTag1,
const char *  mallocTag2 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. XXX Do not add new callers of this method.

It is needed as a workaround for bug #132031, which we hope to tackle soon (as of 6/2016)

Definition at line 313 of file cache.h.

◆ ComputePrimIndexesInParallel() [3/4]

void ComputePrimIndexesInParallel ( const SdfPathVector &  paths,
PcpErrorVector *  allErrors,
const ChildrenPredicate &  childrenPred,
const PayloadPredicate &  payloadPred 
)
inline

Vectorized form of ComputePrimIndexesInParallel().

Equivalent to invoking that method for each path in paths, but more efficient.

Definition at line 327 of file cache.h.

◆ ComputePrimIndexesInParallel() [4/4]

void ComputePrimIndexesInParallel ( const SdfPathVector &  paths,
PcpErrorVector *  allErrors,
const ChildrenPredicate &  childrenPred,
const PayloadPredicate &  payloadPred,
const char *  mallocTag1,
const char *  mallocTag2 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. XXX Do not add new callers of this method.

It is needed as a workaround for bug #132031, which we hope to tackle soon (as of 6/2016)

Definition at line 341 of file cache.h.

◆ ComputePropertyIndex()

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.

allErrors will contain any errors encountered while performing this operation.

◆ ComputeRelationshipTargetPaths()

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.

If localOnly is true then this will compose relationship targets from local nodes only. If stopProperty is not NULL then this will stop composing relationship targets at stopProperty, including stopProperty iff includeStopProperty is true. If not NULL, deletedPaths will be populated with target paths whose deletion contributed to the computed result. allErrors will contain any errors encountered while performing this operation.

◆ FindAllLayerStacksUsingLayer()

PCP_API const PcpLayerStackPtrVector & FindAllLayerStacksUsingLayer ( const SdfLayerHandle &  layer) const

Returns every computed & cached layer stack that includes layer.

◆ FindLayerStack()

PCP_API PcpLayerStackPtr FindLayerStack ( const PcpLayerStackIdentifier identifier) const

Returns the layer stack for identifier if it has been computed and cached, otherwise returns NULL.

◆ FindPrimIndex()

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 computed.

◆ FindPropertyIndex()

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 been computed.

◆ FindSiteDependencies() [1/2]

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 computations.

Parameters
depMaskspecifies what classes of dependency to include; see PcpDependencyFlags for details
recurseOnSiteincludes incoming dependencies on children of sitePath
recurseOnIndexextends the result to include all PcpCache child indexes below discovered results
filterForExistingCachesOnlyfilters the results to only paths representing computed prim and property index caches; otherwise a recursively-expanded result can include un-computed paths that are expected to depend on the site

◆ FindSiteDependencies() [2/2]

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 computations.

This method overload takes a site layer rather than a layer stack. It will check every layer stack using that layer, and apply any relevant sublayer offsets to the map functions in the returned PcpDependencyVector.

See the other method for parameter details.

◆ ForEachLayerStack()

void ForEachLayerStack ( const Callback &  callback) const
inline

Run the given callbcack on every layer stack used by prim indexes in the cache.

The callback must have the signature: void(const PcpLayerStackPtr&).

Definition at line 450 of file cache.h.

◆ ForEachPrimIndex()

void ForEachPrimIndex ( const Callback &  callback) const
inline

Run the given callback on every prim index in the cache.

The callback must have the signature: void(const PcpPrimIndex&).

Definition at line 363 of file cache.h.

◆ GetDynamicFileFormatArgumentDependencyData()

PCP_API const PcpDynamicFileFormatDependencyData & GetDynamicFileFormatArgumentDependencyData ( const SdfPath primIndexPath) const

Returns the dynamic file format dependency data object for the prim index with the given primIndexPath.

This will return an empty dependency data if either there is no cache prim index for the path or if the prim index has no dynamic file formats that it depends on.

◆ GetExpressionVariablesFromLayerStackUsedByPrim()

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 primIndexPath.

◆ GetFileFormatTarget()

PCP_API const std::string & GetFileFormatTarget ( ) const

Returns the file format target this cache is configured for.

◆ GetInvalidAssetPaths()

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.

in a reference) that didn't resolve to valid assets.

◆ GetInvalidSublayerIdentifiers()

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.

◆ GetLayerStack()

PCP_API PcpLayerStackPtr GetLayerStack ( ) const

Get the layer stack for GetLayerStackIdentifier().

Note that this will neither compute the layer stack nor report errors. So if the layer stack has not been computed yet this will return NULL. Use ComputeLayerStack() if you need to compute the layer stack if it hasn't been computed already and/or get errors caused by computing the layer stack.

◆ GetLayerStackIdentifier()

PCP_API const PcpLayerStackIdentifier & GetLayerStackIdentifier ( ) const

Get the identifier of the layerStack used for composition.

◆ GetMutedLayers()

PCP_API const std::vector< std::string > & GetMutedLayers ( ) const

Returns the list of canonical identifiers for muted layers in this cache.

See documentation on RequestLayerMuting for more details.

◆ GetPrimIndexInputs()

PCP_API PcpPrimIndexInputs GetPrimIndexInputs ( )

Returns parameter object containing all inputs for the prim index computation used by this cache.


◆ GetPrimsUsingExpressionVariablesFromLayerStack()

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.

◆ GetUsedLayers()

PCP_API SdfLayerHandleSet GetUsedLayers ( ) const

Returns set of all layers used by this cache.

◆ GetUsedLayersRevision()

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 have changed or not.

For example, if one calls GetUsedLayers() and saves the GetUsedLayersRevision(), and then later calls GetUsedLayersRevision() again, if the number is unchanged, then GetUsedLayers() is guaranteed to be unchanged as well.

◆ GetUsedRootLayers()

PCP_API SdfLayerHandleSet GetUsedRootLayers ( ) const

Returns set of all root layers used by this cache.

◆ GetVariantFallbacks()

PCP_API PcpVariantFallbackMap GetVariantFallbacks ( ) const

Get the list of fallbacks to attempt to use when evaluating variant sets that lack an authored selection.

◆ HasAnyDynamicFileFormatArgumentAttributeDependencies()

PCP_API bool HasAnyDynamicFileFormatArgumentAttributeDependencies ( ) const

Returns true if any prim index in this cache has a dependency on a dynamic file format argument attribute's default value field.


◆ HasAnyDynamicFileFormatArgumentFieldDependencies()

PCP_API bool HasAnyDynamicFileFormatArgumentFieldDependencies ( ) const

Returns true if any prim index in this cache has a dependency on a dynamic file format argument field.


◆ HasRootLayerStack() [1/2]

PCP_API bool HasRootLayerStack ( PcpLayerStackPtr const &  layerStack) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ HasRootLayerStack() [2/2]

bool HasRootLayerStack ( PcpLayerStackRefPtr const &  layerStack) const
inline

Return true if this cache's root layer stack is layerStack, false otherwise.

This is functionally equivalent to comparing against the result of GetLayerStack(), but does not require constructing a TfWeakPtr or any refcount operations.

Definition at line 117 of file cache.h.

◆ IsInvalidAssetPath()

PCP_API bool IsInvalidAssetPath ( const std::string &  resolvedAssetPath) const

Returns true if resolvedAssetPath was used by a prim (e.g.

in a reference) but did not resolve to a valid asset. This is functionally equivalent to examining the values in the map returned by GetInvalidAssetPaths, but more efficient.

◆ IsInvalidSublayerIdentifier()

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 layer.

This is functionally equivalent to examining the values in the vector returned by GetInvalidSublayerIdentifiers, but more efficient.

◆ IsLayerMuted() [1/2]

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.

If layerIdentifier is relative, it is assumed to be relative to anchorLayer. If canonicalMutedLayerIdentifier is supplied, it will be populated with the canonical identifier of the muted layer if this function returns true. See documentation on RequestLayerMuting for more details.

◆ IsLayerMuted() [2/2]

PCP_API bool IsLayerMuted ( const std::string &  layerIdentifier) const

Returns true if the layer specified by layerIdentifier is muted in this cache, false otherwise.

If layerIdentifier is relative, it is assumed to be relative to this cache's root layer. See documentation on RequestLayerMuting for more details.

◆ IsPayloadIncluded()

PCP_API bool IsPayloadIncluded ( const SdfPath path) const

Return true if the payload is included for the given path.

◆ IsPossibleDynamicFileFormatArgumentAttribute()

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 composed while generating dynamic file format arguments for any prim index in this cache.


◆ IsPossibleDynamicFileFormatArgumentField()

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 file format arguments for any prim index in this cache.


◆ IsUsd()

PCP_API bool IsUsd ( ) const

Return true if the cache is configured in Usd mode.

◆ PrintStatistics()

PCP_API void PrintStatistics ( ) const

Prints various statistics about the data stored in this cache.

◆ Reload()

PCP_API void Reload ( PcpChanges changes)

Reload the layers of the layer stack, except session layers and sublayers of session layers.

This will also try to load sublayers in this cache's layer stack that could not be loaded previously. It will also try to load any referenced or payloaded layer that could not be loaded previously. Clients should subsequently Apply() changes to use any now-valid layers.

◆ ReloadReferences()

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.

Clients should subsequently apply the changes to use any now valid layers.

Note: If a reference or payload was to an invalid asset and this asset is valid upon reloading then this call will not necessarily reload every layer accessible across the reference or payload. For example, say prim R has an invalid reference and prim Q has a valid reference to layer X with sublayer Y. If on reload R now has a valid reference to layer Z with sublayer Y, we will load Z but we will not reload Y.

◆ RequestLayerMuting()

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.

Muted layers are ignored during composition and do not appear in any layer stacks. The root layer of this stage may not be muted; attempting to do so will generate a coding error. If the root layer of a reference or payload layer stack is muted, the behavior is as if the muted layer did not exist, which means a composition error will be generated.

A canonical identifier for each layer in layersToMute will be computed using ArResolver::CreateIdentifier using the cache's root layer as the anchoring asset. If an identifier contains a file format target that matches this cache's file format target, that argument will be removed from the identifier. Any layer encountered during composition with the same canonical identifier will be considered muted and ignored.

Note that muting a layer will cause this cache to release all references to that layer. If no other client is holding on to references to that layer, it will be unloaded. In this case, if there are unsaved edits to the muted layer, those edits are lost.
Since anonymous layers are not serialized, muting an anonymous layer will cause that layer and its contents to be lost in this case.

If changes is not nullptr, it is adjusted to reflect the changes necessary to see the change in muted layers. Otherwise, those changes are applied immediately.

newLayersMuted and newLayersUnmuted contains the pruned vector of layers which are muted or unmuted by this call to RequestLayerMuting.

◆ RequestPayloads()

PCP_API void RequestPayloads ( const SdfPathSet &  pathsToInclude,
const SdfPathSet &  pathsToExclude,
PcpChanges changes = NULL 
)

Request payloads to be included or excluded from composition.

Parameters
pathsToIncludeis a set of paths to add to the set for payload inclusion.
pathsToExcludeis a set of paths to remove from the set for payload inclusion.
changesif not NULL, is adjusted to reflect the changes necessary to see the change in payloads; otherwise those changes are applied immediately.
Note
If a path is listed in both pathsToInclude and pathsToExclude, it will be treated as an inclusion only.

◆ SetVariantFallbacks()

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 selection.

If changes is not NULL then it's adjusted to reflect the changes necessary to see the change in standin preferences, otherwise those changes are applied immediately.

◆ UsesLayerStack()

PCP_API bool UsesLayerStack ( const PcpLayerStackPtr &  layerStack) const

Return true if layerStack is used by this cache in its composition, false otherwise.

Friends And Related Function Documentation

◆ PcpChanges

friend class PcpChanges
friend

Definition at line 642 of file cache.h.


The documentation for this class was generated from the following file: