24#ifndef PXR_USD_USD_NAMESPACE_EDITOR_H
25#define PXR_USD_USD_NAMESPACE_EDITOR_H
30#include "pxr/usd/usd/api.h"
36PXR_NAMESPACE_OPEN_SCOPE
206 enum class _EditType {
215 struct _EditDescription {
223 _EditType editType = _EditType::Invalid;
234 struct _ProcessedEdit
238 std::vector<std::string> errors;
246 SdfLayerHandleVector layersToEdit;
251 struct TargetPathListOpEdit {
256 SdfPropertySpecHandle propertySpec;
263 SdfPathListOp newFieldValue;
265 std::vector<TargetPathListOpEdit> targetPathListOpEdits;
270 std::vector<std::string> targetPathListOpErrors;
275 SdfPath createParentSpecIfNeededPath;
279 bool removeInertAncestorOvers =
false;
282 bool requiresRelocates =
false;
289 bool CanApply(std::string *whyNot)
const;
293 bool _AddPrimDelete(
const SdfPath &oldPath);
296 bool _AddPrimMove(
const SdfPath &oldPath,
const SdfPath &newPath);
299 bool _AddPropertyDelete(
const SdfPath &oldPath);
302 bool _AddPropertyMove(
const SdfPath &oldPath,
const SdfPath &newPath);
305 void _ClearProcessedEdits();
309 void _ProcessEditsIfNeeded()
const;
314 class _EditProcessor;
316 UsdStageRefPtr _stage;
317 _EditDescription _editDescription;
318 mutable std::optional<_ProcessedEdit> _processedEdit;
321PXR_NAMESPACE_CLOSE_SCOPE
A description of an arbitrarily complex namespace edit.
A path value used to locate objects in layers or scenegraphs.
SDF_API bool IsPrimPropertyPath() const
Returns whether the path identifies a prim's property.
Token for efficient comparison, assignment, and hashing of known strings.
USD_API bool MovePrimAtPath(const SdfPath &path, const SdfPath &newPath)
Adds an edit operation to move the composed prim at the given path on this namespace editor's stage t...
USD_API bool DeletePrimAtPath(const SdfPath &path)
Adds an edit operation to delete the composed prim at the given path from this namespace editor's sta...
USD_API bool RenameProperty(const UsdProperty &property, const TfToken &newName)
Adds an edit operation to rename the composed property at the path of property on this namespace edit...
USD_API bool ApplyEdits()
Applies all the added namespace edits stored in this to namespace editor to its stage by authoring al...
USD_API bool ReparentProperty(const UsdProperty &property, const UsdPrim &newParent)
Adds an edit operation to reparent the composed property at the path of property on this namespace ed...
USD_API bool DeleteProperty(const UsdProperty &property)
Adds an edit operation to delete the composed property at the path of property from this namespace ed...
USD_API bool ReparentPrim(const UsdPrim &prim, const UsdPrim &newParent)
Adds an edit operation to reparent the composed prim at the path of prim on this namespace editor's s...
USD_API bool MovePropertyAtPath(const SdfPath &path, const SdfPath &newPath)
Adds an edit operation to move the composed property at the given path on this namespace editor's sta...
USD_API bool ReparentProperty(const UsdProperty &property, const UsdPrim &newParent, const TfToken &newName)
Adds an edit operation to reparent the composed property at the path of property on this namespace ed...
USD_API bool ReparentPrim(const UsdPrim &prim, const UsdPrim &newParent, const TfToken &newName)
Adds an edit operation to reparent the composed prim at the path of prim on this namespace editor's s...
USD_API bool CanApplyEdits(std::string *whyNot=nullptr) const
Returns whether all the added namespace edits stored in this to namespace editor can be applied to it...
USD_API bool RenamePrim(const UsdPrim &prim, const TfToken &newName)
Adds an edit operation to rename the composed prim at the path of prim on this namespace editor's sta...
USD_API bool DeletePrim(const UsdPrim &prim)
Adds an edit operation to delete the composed prim at the path of prim from this namespace editor's s...
USD_API bool DeletePropertyAtPath(const SdfPath &path)
Adds an edit operation to delete the composed property at the given path from this namespace editor's...
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Base class for UsdAttribute and UsdRelationship scenegraph objects.
@ Invalid
Invalid or unknown schema kind.