All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
payloads.h
1//
2// Copyright 2019 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_USD_USD_PAYLOADS_H
8#define PXR_USD_USD_PAYLOADS_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/usd/api.h"
12#include "pxr/usd/usd/common.h"
13#include "pxr/usd/usd/prim.h"
14
16#include "pxr/usd/sdf/path.h"
17#include "pxr/usd/sdf/payload.h"
18
19PXR_NAMESPACE_OPEN_SCOPE
20
27 friend class UsdPrim;
28
29 explicit UsdPayloads(const UsdPrim& prim) : _prim(prim) {}
30
31public:
38 USD_API
39 bool AddPayload(const SdfPayload& payload,
41
43 USD_API
44 bool AddPayload(const std::string &identifier,
45 const SdfPath &primPath,
46 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
48
51 USD_API
52 bool AddPayload(const std::string &identifier,
53 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
55
58 USD_API
59 bool AddInternalPayload(const SdfPath &primPath,
60 const SdfLayerOffset &layerOffset = SdfLayerOffset(),
62
68 USD_API
69 bool RemovePayload(const SdfPayload& ref);
70
76 USD_API
78
85 USD_API
86 bool SetPayloads(const SdfPayloadVector& items);
87
89 const UsdPrim &GetPrim() const { return _prim; }
90
92 UsdPrim GetPrim() { return _prim; }
93
94 explicit operator bool() { return bool(_prim); }
95
96private:
97 UsdPrim _prim;
98};
99
100PXR_NAMESPACE_CLOSE_SCOPE
101
102#endif // PXR_USD_USD_PAYLOADS_H
Represents a time offset and scale between layers.
Definition: layerOffset.h:44
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Represents a payload and all its meta data.
Definition: payload.h:41
UsdPayloads provides an interface to authoring and introspecting payloads.
Definition: payloads.h:26
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 o...
USD_API bool SetPayloads(const SdfPayloadVector &items)
Explicitly set the payloads, potentially blocking weaker opinions that add or remove items.
USD_API bool ClearPayloads()
Removes the authored payload listOp edits at the current EditTarget.
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 o...
const UsdPrim & GetPrim() const
Return the prim this object is bound to.
Definition: payloads.h:89
USD_API bool RemovePayload(const SdfPayload &ref)
Removes the specified payload from the payloads listOp at the current EditTarget.
USD_API bool AddInternalPayload(const SdfPath &primPath, const SdfLayerOffset &layerOffset=SdfLayerOffset(), UsdListPosition position=UsdListPositionBackOfPrependList)
Add an internal payload to the specified prim.
UsdPrim GetPrim()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: payloads.h:92
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
UsdListPosition
Specifies a position to add items to lists.
Definition: common.h:71
@ UsdListPositionBackOfPrependList
The position at the back of the prepend list.
Definition: common.h:81