RtChangeTracker#

Fully qualified name: usdrt::RtChangeTracker

class RtChangeTracker#

The RtChangeTracker class provides an interface for tracking changes to Fabric data. Unlike TfNotice (USD’s built in notification system), RtChangeTracker and Fabric handle change notifications in a non-blocking manner.

RTChangeTracker leverages Fabric’s change tracking capabilities, while abstracting out the underlying bucket-based details. It also adds helper methods for querying changes in the data by prim and attribute.

Public Functions

inline RtChangeTracker(UsdStageRefPtr stage)#

Construct an RtChangeTracker instance from a USD stage reference.

Parameters:

stage – The stage you want to track changes in

inline ~RtChangeTracker()#

Destructor.

inline void TrackAttribute(TfToken attrName)#

Start tracking an attribute.

Parameters:

attrName – The name of the attribute to track

inline void StopTrackingAttribute(TfToken attrName)#

Stop tracking an attribute.

Parameters:

attrName – The name of the attribute to stop tracking

inline void PauseTracking()#

Pauses change tracking.

inline void ResumeTracking()#

Resumes paused change tracking.

inline bool IsChangeTrackingPaused()#

Check if change tracking is paused.

Returns:

true if change tracking is paused

inline bool HasChanges()#

Check if there are any tracked changes.

Returns:

true if there are tracked changes

inline void ClearChanges()#

Clear out any tracked changes.

inline void EnablePrimCreateTracking()#

Enable tracking added prims.

inline std::vector<SdfPath> GetAllChangedPrims()#

Get list of all prims with changes.

Returns:

list of SdfPaths of all prims with changes

inline std::vector<SdfPath> GetAddedPrims()#

Get list of all newly-created prims in fabric.

Returns:

a list of SdfPaths of all newly-added prims.

inline std::vector<SdfPath> GetAllChangedAttributes()#

Get list of all prim & attribute combos that have changed.

Returns:

list of full SdfPaths of all attributes with changes

inline bool PrimChanged(UsdPrim prim)#

Check for changes on a given prim.

Parameters:

prim – prim to check for changes

Returns:

true if prim has tracked changes

inline bool PrimChanged(SdfPath primPath)#

Check for changes on a given prim.

Parameters:

primPath – path to prim to check for changes

Returns:

true if prim has tracked changes

inline bool AttributeChanged(UsdAttribute attr)#

Check for changes on a specific attribute of a prim.

Parameters:

attr – prim attribute to check for changes

Returns:

true if attribute has tracked changes

inline bool AttributeChanged(SdfPath attrPath)#

Check for changes on a specific attribute of a prim.

Parameters:

attrPath – path to attribute on a prim to check for changes

Returns:

true if attribute has tracked changes

inline std::vector<TfToken> GetChangedAttributes(UsdPrim prim)#

Get list of attributes that have changed for given prim.

Parameters:

prim – prim to check for changes

Returns:

list of attributes with changes

inline std::vector<TfToken> GetChangedAttributes(SdfPath primPath)#

Get list of attributes that have changed for a given prim.

Parameters:

primPath – path to prim to check for changes

Returns:

list of attributes with changes

inline bool IsTrackingAttribute(TfToken attrName)#

Check if an attribute is being tracked.

Parameters:

attrName – name of the attribute to check

Returns:

true if attribute is being tracked

inline std::vector<TfToken> GetTrackedAttributes()#

Get list of all currently tracked attributes.

Returns:

list of tracked attribute names