![]() |
|
Notice sent in response to authored changes that affect UsdObjects. More...
Classes | |
class | PathRange |
An iterable range of paths to objects that have changed. More... | |
Public Member Functions | |
bool | AffectedObject (const UsdObject &obj) const |
Return true if obj was possibly affected by the layer changes that generated this notice. More... | |
USD_API bool | ResyncedObject (const UsdObject &obj) const |
Return true if obj was resynced by the layer changes that generated this notice. More... | |
USD_API bool | ChangedInfoOnly (const UsdObject &obj) const |
Return true if obj was changed but not resynced by the layer changes that generated this notice. More... | |
USD_API PathRange | GetResyncedPaths () const |
Return the set of paths that are resynced in lexicographical order. More... | |
USD_API PathRange | GetChangedInfoOnlyPaths () const |
Return the set of paths that have only info changes (those that do not affect the structure of cached UsdPrims on a UsdStage) in lexicographical order. More... | |
USD_API TfTokenVector | GetChangedFields (const UsdObject &obj) const |
Return the set of changed fields in layers that affected obj . More... | |
USD_API TfTokenVector | GetChangedFields (const SdfPath &path) const |
USD_API bool | HasChangedFields (const UsdObject &obj) const |
Return true if there are any changed fields that affected obj , false otherwise. More... | |
USD_API bool | HasChangedFields (const SdfPath &path) const |
![]() | |
USD_API | StageNotice (const UsdStageWeakPtr &stage) |
const UsdStageWeakPtr & | GetStage () const |
Return the stage associated with this notice. More... | |
![]() | |
TF_API size_t | Send () const |
Deliver the notice to interested listeners, returning the number of interested listeners. More... | |
template<typename SenderPtr > | |
size_t | Send (SenderPtr const &s) const |
Deliver the notice to interested listeners, returning the number of interested listeners. More... | |
TF_API size_t | SendWithWeakBase (const TfWeakBase *senderWeakBase, const void *senderUniqueId, const std::type_info &type) const |
Variant of Send() that takes a specific sender in the form of a TfWeakBase pointer and a typeid. More... | |
Friends | |
class | UsdStage |
Additional Inherited Members | |
![]() | |
typedef TfWeakPtr< Probe > | WeakProbePtr |
typedef std::vector< Key > | Keys |
A TfNotice::Key container. More... | |
![]() | |
static void | InsertProbe (const WeakProbePtr &probe) |
Register a probe that will be invoked when notices are sent and delivered. More... | |
static void | RemoveProbe (const WeakProbePtr &probe) |
Remove a probe that was previously registered with InsertProbe . More... | |
template<class LPtr , class MethodPtr > | |
static TfNotice::Key | Register (LPtr const &listener, MethodPtr method) |
Register a listener as being interested in a TfNotice . More... | |
template<class LPtr , class MethodPtr , class SenderPtr > | |
static TfNotice::Key | Register (LPtr const &listener, MethodPtr method, SenderPtr const &sender) |
template<class LPtr , class MethodPtr > | |
static TfNotice::Key | Register (LPtr const &listener, MethodPtr method, const TfType ¬iceType, const TfAnyWeakPtr &sender) |
static TF_API bool | Revoke (TfNotice::Key &key) |
Revoke interest by a listener. More... | |
static TF_API void | Revoke (TfNotice::Keys *keys) |
Revoke interest by listeners. More... | |
Notice sent in response to authored changes that affect UsdObjects.
The kinds of object changes are divided into two categories: "resync" and "changed-info". "Resyncs" are potentially structural changes that invalidate entire subtrees of UsdObjects (including prims and properties). For example, if the path "/foo" is resynced, then all subpaths like "/foo/bar" and "/foo/bar.baz" may be arbitrarily changed. In contrast, "changed-info" means that a nonstructural change has occurred, like an attribute value change or a value change to a metadata field not related to composition.
When a prim is resynced, say "/foo/bar", it might have been created or destroyed. In that case "/foo"'s list of children will have changed, but we do not consider "/foo" to be resynced. If we did, it would mean clients would have to consider all of "/foo/bar"'s siblings (and their descendants) to be resynced which might be egregious overinvalidation.
This notice provides API for two client use-cases. Clients interested in testing whether specific objects are affected by the changes should use the AffectedObject() method (and the ResyncedObject() and ChangedInfoOnly() methods). Clients that wish to reason about all changes as a whole should use the GetResyncedPaths() and GetChangedInfoOnlyPaths() methods.
|
inline |
Return true if obj
was possibly affected by the layer changes that generated this notice.
This is the case if either the object is subject to a resync or has changed info. Equivalent to:
USD_API bool ChangedInfoOnly | ( | const UsdObject & | obj | ) | const |
Return true if obj
was changed but not resynced by the layer changes that generated this notice.
USD_API TfTokenVector GetChangedFields | ( | const UsdObject & | obj | ) | const |
Return the set of changed fields in layers that affected obj
.
This set will be empty for objects whose paths are not in GetResyncedPaths() or GetChangedInfoOnlyPaths().
If a field is present in this set, it does not necessarily mean the composed value of that field on obj
has changed. For example, if a metadata value on obj
is overridden in a stronger layer and is changed in a weaker layer, that field will appear in this set. However, since the value in the stronger layer did not change, the composed value returned by GetMetadata() will not have changed.
USD_API TfTokenVector GetChangedFields | ( | const SdfPath & | path | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
USD_API PathRange GetChangedInfoOnlyPaths | ( | ) | const |
Return the set of paths that have only info changes (those that do not affect the structure of cached UsdPrims on a UsdStage) in lexicographical order.
Info changes do not imply entire subtree invalidation, so this set is not minimal regarding ancestors and descendants, as opposed to GetResyncedPaths(). For example, both the paths '/foo' and '/foo/bar' may appear in this set.
USD_API PathRange GetResyncedPaths | ( | ) | const |
Return the set of paths that are resynced in lexicographical order.
Resyncs imply entire subtree invalidation of all descendant prims and properties, so this set is minimal regarding ancestors and descendants. For example, if the path '/foo' appears in this set, the entire subtree at '/foo' is resynced so the path '/foo/bar' will not appear, but it should be considered resynced.
USD_API bool HasChangedFields | ( | const UsdObject & | obj | ) | const |
Return true if there are any changed fields that affected obj
, false otherwise.
See GetChangedFields for more details.
USD_API bool HasChangedFields | ( | const SdfPath & | path | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
USD_API bool ResyncedObject | ( | const UsdObject & | obj | ) | const |
Return true if obj
was resynced by the layer changes that generated this notice.
This is the case if the object's path or an ancestor path is present in GetResyncedPrimPaths().