HDK
|
#include <cache.h>
Public Member Functions | |
PCP_API | PcpCache (const PcpLayerStackIdentifier &layerStackIdentifier, const std::string &fileFormatTarget=std::string(), bool usd=false) |
PCP_API | ~PcpCache () |
Computations | |
PCP_API PcpLayerStackRefPtr | ComputeLayerStack (const PcpLayerStackIdentifier &identifier, PcpErrorVector *allErrors) |
PCP_API PcpLayerStackPtr | FindLayerStack (const PcpLayerStackIdentifier &identifier) const |
PCP_API bool | UsesLayerStack (const PcpLayerStackPtr &layerStack) const |
PCP_API const PcpPrimIndex & | ComputePrimIndex (const SdfPath &primPath, PcpErrorVector *allErrors) |
template<class ChildrenPredicate , class PayloadPredicate > | |
void | ComputePrimIndexesInParallel (const SdfPath &path, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred) |
template<class ChildrenPredicate , class PayloadPredicate > | |
void | ComputePrimIndexesInParallel (const SdfPath &path, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred, const char *mallocTag1, const char *mallocTag2) |
template<class ChildrenPredicate , class PayloadPredicate > | |
void | ComputePrimIndexesInParallel (const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred) |
template<class ChildrenPredicate , class PayloadPredicate > | |
void | ComputePrimIndexesInParallel (const SdfPathVector &paths, PcpErrorVector *allErrors, const ChildrenPredicate &childrenPred, const PayloadPredicate &payloadPred, const char *mallocTag1, const char *mallocTag2) |
PCP_API const PcpPrimIndex * | FindPrimIndex (const SdfPath &primPath) const |
template<class Callback > | |
void | ForEachPrimIndex (const Callback &callback) const |
PCP_API const PcpPropertyIndex & | ComputePropertyIndex (const SdfPath &propPath, PcpErrorVector *allErrors) |
PCP_API const PcpPropertyIndex * | FindPropertyIndex (const SdfPath &propPath) const |
PCP_API void | ComputeRelationshipTargetPaths (const SdfPath &relationshipPath, SdfPathVector *paths, bool localOnly, const SdfSpecHandle &stopProperty, bool includeStopProperty, SdfPathVector *deletedPaths, PcpErrorVector *allErrors) |
PCP_API void | ComputeAttributeConnectionPaths (const SdfPath &attributePath, SdfPathVector *paths, bool localOnly, const SdfSpecHandle &stopProperty, bool includeStopProperty, SdfPathVector *deletedPaths, PcpErrorVector *allErrors) |
Dependencies | |
PCP_API SdfLayerHandleSet | GetUsedLayers () const |
Returns set of all layers used by this cache. More... | |
PCP_API size_t | GetUsedLayersRevision () const |
PCP_API SdfLayerHandleSet | GetUsedRootLayers () const |
Returns set of all root layers used by this cache. More... | |
PCP_API const PcpLayerStackPtrVector & | FindAllLayerStacksUsingLayer (const SdfLayerHandle &layer) const |
Returns every computed & cached layer stack that includes layer . More... | |
template<class Callback > | |
void | ForEachLayerStack (const Callback &callback) const |
PCP_API PcpDependencyVector | FindSiteDependencies (const PcpLayerStackPtr &siteLayerStack, const SdfPath &sitePath, PcpDependencyFlags depMask, bool recurseOnSite, bool recurseOnIndex, bool filterForExistingCachesOnly) const |
PCP_API PcpDependencyVector | FindSiteDependencies (const SdfLayerHandle &siteLayer, const SdfPath &sitePath, PcpDependencyFlags depMask, bool recurseOnSite, bool recurseOnIndex, bool filterForExistingCachesOnly) const |
PCP_API bool | CanHaveOpinionForSite (const SdfPath &localPcpSitePath, const SdfLayerHandle &layer, SdfPath *allowedPathInLayer) const |
PCP_API std::vector< std::string > | GetInvalidSublayerIdentifiers () const |
PCP_API bool | IsInvalidSublayerIdentifier (const std::string &identifier) const |
PCP_API std::map< SdfPath, std::vector< std::string > , SdfPath::FastLessThan > | GetInvalidAssetPaths () const |
PCP_API bool | IsInvalidAssetPath (const std::string &resolvedAssetPath) const |
PCP_API bool | HasAnyDynamicFileFormatArgumentFieldDependencies () const |
PCP_API bool | HasAnyDynamicFileFormatArgumentAttributeDependencies () const |
PCP_API bool | IsPossibleDynamicFileFormatArgumentField (const TfToken &field) const |
PCP_API bool | IsPossibleDynamicFileFormatArgumentAttribute (const TfToken &attributeName) const |
PCP_API const PcpDynamicFileFormatDependencyData & | GetDynamicFileFormatArgumentDependencyData (const SdfPath &primIndexPath) const |
PCP_API const SdfPathVector & | GetPrimsUsingExpressionVariablesFromLayerStack (const PcpLayerStackPtr &layerStack) const |
PCP_API const std::unordered_set < std::string > & | GetExpressionVariablesFromLayerStackUsedByPrim (const SdfPath &primIndexPath, const PcpLayerStackPtr &layerStack) const |
Change handling | |
PCP_API void | Apply (const PcpCacheChanges &changes, PcpLifeboat *lifeboat) |
PCP_API void | Reload (PcpChanges *changes) |
PCP_API void | ReloadReferences (PcpChanges *changes, const SdfPath &primPath) |
Diagnostics | |
PCP_API void | PrintStatistics () const |
Prints various statistics about the data stored in this cache. More... | |
Friends | |
class | PcpChanges |
class | Pcp_Dependencies |
class | Pcp_Statistics |
const PcpPrimIndex & | Pcp_ComputePrimIndexWithCompatibleInputs (PcpCache &cache, const SdfPath &path, const PcpPrimIndexInputs &inputs, PcpErrorVector *allErrors) |
Parameters | |
using | PayloadSet = std::unordered_set< SdfPath, SdfPath::Hash > |
Returns the payloads requested for inclusion. More... | |
PCP_API const PcpLayerStackIdentifier & | GetLayerStackIdentifier () const |
Get the identifier of the layerStack used for composition. More... | |
PCP_API PcpLayerStackPtr | GetLayerStack () const |
bool | HasRootLayerStack (PcpLayerStackRefPtr const &layerStack) const |
PCP_API bool | HasRootLayerStack (PcpLayerStackPtr const &layerStack) const |
PCP_API bool | IsUsd () const |
Return true if the cache is configured in Usd mode. More... | |
PCP_API const std::string & | GetFileFormatTarget () const |
Returns the file format target this cache is configured for. More... | |
PCP_API PcpVariantFallbackMap | GetVariantFallbacks () const |
PCP_API void | SetVariantFallbacks (const PcpVariantFallbackMap &map, PcpChanges *changes=NULL) |
PCP_API bool | IsPayloadIncluded (const SdfPath &path) const |
Return true if the payload is included for the given path. More... | |
PCP_API PayloadSet const & | GetIncludedPayloads () const |
Returns the payloads requested for inclusion. More... | |
PCP_API void | RequestPayloads (const SdfPathSet &pathsToInclude, const SdfPathSet &pathsToExclude, PcpChanges *changes=NULL) |
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) |
PCP_API const std::vector < std::string > & | GetMutedLayers () const |
PCP_API bool | IsLayerMuted (const std::string &layerIdentifier) const |
PCP_API bool | IsLayerMuted (const SdfLayerHandle &anchorLayer, const std::string &layerIdentifier, std::string *canonicalMutedLayerIdentifier=nullptr) const |
PCP_API PcpPrimIndexInputs | GetPrimIndexInputs () |
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:
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.
using PcpCache::PayloadSet = std::unordered_set<SdfPath, SdfPath::Hash> |
PCP_API PcpCache::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.
PCP_API PcpCache::~PcpCache | ( | ) |
PCP_API void PcpCache::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.
PCP_API bool PcpCache::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
.
PCP_API void PcpCache::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.
PCP_API PcpLayerStackRefPtr PcpCache::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.
PCP_API const PcpPrimIndex& PcpCache::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.
|
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.
|
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)
|
inline |
Vectorized form of ComputePrimIndexesInParallel(). Equivalent to invoking that method for each path in paths
, but more efficient.
|
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)
PCP_API const PcpPropertyIndex& PcpCache::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.
PCP_API void PcpCache::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.
PCP_API const PcpLayerStackPtrVector& PcpCache::FindAllLayerStacksUsingLayer | ( | const SdfLayerHandle & | layer | ) | const |
Returns every computed & cached layer stack that includes layer
.
PCP_API PcpLayerStackPtr PcpCache::FindLayerStack | ( | const PcpLayerStackIdentifier & | identifier | ) | const |
Returns the layer stack for identifier
if it has been computed and cached, otherwise returns NULL
.
PCP_API const PcpPrimIndex* PcpCache::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.
PCP_API const PcpPropertyIndex* PcpCache::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.
PCP_API PcpDependencyVector PcpCache::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.
depMask | specifies what classes of dependency to include; see PcpDependencyFlags for details |
recurseOnSite | includes incoming dependencies on children of sitePath |
recurseOnIndex | extends the result to include all PcpCache child indexes below discovered results |
filterForExistingCachesOnly | filters 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 |
PCP_API PcpDependencyVector PcpCache::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.
|
inline |
|
inline |
PCP_API const PcpDynamicFileFormatDependencyData& PcpCache::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.
PCP_API const std::unordered_set<std::string>& PcpCache::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
.
PCP_API const std::string& PcpCache::GetFileFormatTarget | ( | ) | const |
Returns the file format target this cache is configured for.
PCP_API PayloadSet const& PcpCache::GetIncludedPayloads | ( | ) | const |
Returns the payloads requested for inclusion.
PCP_API std::map<SdfPath, std::vector<std::string>, SdfPath::FastLessThan> PcpCache::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.
PCP_API std::vector<std::string> PcpCache::GetInvalidSublayerIdentifiers | ( | ) | const |
Returns a vector of sublayer asset paths used in the layer stack that didn't resolve to valid assets.
PCP_API PcpLayerStackPtr PcpCache::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.
PCP_API const PcpLayerStackIdentifier& PcpCache::GetLayerStackIdentifier | ( | ) | const |
Get the identifier of the layerStack used for composition.
PCP_API const std::vector<std::string>& PcpCache::GetMutedLayers | ( | ) | const |
Returns the list of canonical identifiers for muted layers in this cache. See documentation on RequestLayerMuting for more details.
PCP_API PcpPrimIndexInputs PcpCache::GetPrimIndexInputs | ( | ) |
Returns parameter object containing all inputs for the prim index computation used by this cache.
PCP_API const SdfPathVector& PcpCache::GetPrimsUsingExpressionVariablesFromLayerStack | ( | const PcpLayerStackPtr & | layerStack | ) | const |
Returns the list of prim index paths that depend on one or more expression variables from layerStack
.
PCP_API SdfLayerHandleSet PcpCache::GetUsedLayers | ( | ) | const |
Returns set of all layers used by this cache.
PCP_API size_t PcpCache::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.
PCP_API SdfLayerHandleSet PcpCache::GetUsedRootLayers | ( | ) | const |
Returns set of all root layers used by this cache.
PCP_API PcpVariantFallbackMap PcpCache::GetVariantFallbacks | ( | ) | const |
Get the list of fallbacks to attempt to use when evaluating variant sets that lack an authored selection.
PCP_API bool PcpCache::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 PcpCache::HasAnyDynamicFileFormatArgumentFieldDependencies | ( | ) | const |
Returns true if any prim index in this cache has a dependency on a dynamic file format argument field.
|
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.
PCP_API bool PcpCache::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 PcpCache::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.
PCP_API bool PcpCache::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.
PCP_API bool PcpCache::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.
PCP_API bool PcpCache::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.
Return true if the payload is included for the given path.
PCP_API bool PcpCache::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.
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 PcpCache::IsUsd | ( | ) | const |
Return true if the cache is configured in Usd mode.
Prints various statistics about the data stored in this cache.
PCP_API void PcpCache::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.
PCP_API void PcpCache::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.
PCP_API void PcpCache::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.
PCP_API void PcpCache::RequestPayloads | ( | const SdfPathSet & | pathsToInclude, |
const SdfPathSet & | pathsToExclude, | ||
PcpChanges * | changes = NULL |
||
) |
Request payloads to be included or excluded from composition.
pathsToInclude | is a set of paths to add to the set for payload inclusion. |
pathsToExclude | is a set of paths to remove from the set for payload inclusion. |
changes | if not NULL , is adjusted to reflect the changes necessary to see the change in payloads; otherwise those changes are applied immediately. |
PCP_API void PcpCache::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.
PCP_API bool PcpCache::UsesLayerStack | ( | const PcpLayerStackPtr & | layerStack | ) | const |
Return true if layerStack
is used by this cache in its composition, false otherwise.
|
friend |
|
friend |