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
UsdPayloads Class Reference

UsdPayloads provides an interface to authoring and introspecting payloads. More...

#include <payloads.h>

Public Member Functions

USD_API bool AddPayload (const SdfPayload &payload, UsdListPosition position=UsdListPositionBackOfPrependList)
 Adds a payload to the payload listOp at the current EditTarget, in the position specified by position.
 
USD_API bool AddPayload (const std::string &identifier, const SdfPath &primPath, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
 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 AddPayload (const std::string &identifier, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
 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 AddInternalPayload (const SdfPath &primPath, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
 Add an internal payload to the specified prim.
 
USD_API bool RemovePayload (const SdfPayload &ref)
 Removes the specified payload from the payloads listOp at the current EditTarget.
 
USD_API bool ClearPayloads ()
 Removes the authored payload listOp edits at the current EditTarget.
 
USD_API bool SetPayloads (const SdfPayloadVector &items)
 Explicitly set the payloads, potentially blocking weaker opinions that add or remove items.
 
const UsdPrimGetPrim () const
 Return the prim this object is bound to.
 
UsdPrim GetPrim ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
 operator bool ()
 

Friends

class UsdPrim
 

Detailed Description

UsdPayloads provides an interface to authoring and introspecting payloads.

Payloads behave the same as Usd references except that payloads can be optionally loaded.

Definition at line 26 of file payloads.h.

Member Function Documentation

◆ AddInternalPayload()

USD_API bool AddInternalPayload ( const SdfPath primPath,
const SdfLayerOffset layerOffset = SdfLayerOffset(),
UsdListPosition  position = UsdListPositionBackOfPrependList 
)

Add an internal payload to the specified prim.

See also
Internal Payloads

◆ AddPayload() [1/3]

USD_API bool AddPayload ( const SdfPayload payload,
UsdListPosition  position = UsdListPositionBackOfPrependList 
)

Adds a payload to the payload listOp at the current EditTarget, in the position specified by position.

See also
Why adding references may fail for explanation of expectations on payload and what return values and errors to expect, and ListOps and List Editing for details on list editing and composition of listOps.

◆ AddPayload() [2/3]

USD_API bool AddPayload ( const std::string &  identifier,
const SdfLayerOffset layerOffset = SdfLayerOffset(),
UsdListPosition  position = UsdListPositionBackOfPrependList 
)

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

See also
Payloads Without Prim Paths

◆ AddPayload() [3/3]

USD_API bool AddPayload ( const std::string &  identifier,
const SdfPath primPath,
const SdfLayerOffset layerOffset = SdfLayerOffset(),
UsdListPosition  position = UsdListPositionBackOfPrependList 
)

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

◆ ClearPayloads()

USD_API bool ClearPayloads ( )

Removes the authored payload listOp edits at the current EditTarget.

The same caveats for Remove() apply to Clear(). In fact, Clear() may actually increase the number of composed payloads, if the listOp being cleared contained the "remove" operator.

See also
ListOps and List Editing

◆ GetPrim() [1/2]

UsdPrim GetPrim ( )
inline

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

Definition at line 92 of file payloads.h.

◆ GetPrim() [2/2]

const UsdPrim & GetPrim ( ) const
inline

Return the prim this object is bound to.

Definition at line 89 of file payloads.h.

◆ operator bool()

operator bool ( )
inlineexplicit

Definition at line 94 of file payloads.h.

◆ RemovePayload()

USD_API bool RemovePayload ( const SdfPayload ref)

Removes the specified payload from the payloads listOp at the current EditTarget.

This does not necessarily eliminate the payload completely, as it may be added or set in another layer in the same LayerStack as the current EditTarget.

See also
ListOps and List Editing

◆ SetPayloads()

USD_API bool SetPayloads ( const SdfPayloadVector &  items)

Explicitly set the payloads, potentially blocking weaker opinions that add or remove items.

See also
Why adding payloads may fail for explanation of expectations on items and what return values and errors to expect, and ListOps and List Editing for details on list editing and composition of listOps.

Friends And Related Function Documentation

◆ UsdPrim

friend class UsdPrim
friend

Definition at line 27 of file payloads.h.


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