7#ifndef PXR_USD_USD_NAMESPACE_EDITOR_H
8#define PXR_USD_USD_NAMESPACE_EDITOR_H
13#include "pxr/usd/usd/api.h"
20PXR_NAMESPACE_OPEN_SCOPE
47 const UsdStageRefPtr &stage,
52 const UsdStageRefPtr &stage,
212 enum class _EditType {
221 struct _EditDescription {
229 _EditType editType = _EditType::Invalid;
240 struct _ProcessedEdit
244 std::vector<std::string> errors;
252 SdfLayerHandleVector layersToEdit;
261 struct TargetPathListOpEdit {
266 SdfPropertySpecHandle propertySpec;
273 SdfPathListOp newFieldValue;
275 std::vector<TargetPathListOpEdit> targetPathListOpEdits;
280 std::vector<std::string> targetPathListOpErrors;
285 SdfPath createParentSpecIfNeededPath;
289 bool removeInertAncestorOvers =
false;
296 bool CanApply(std::string *whyNot)
const;
300 bool _AddPrimDelete(
const SdfPath &oldPath);
303 bool _AddPrimMove(
const SdfPath &oldPath,
const SdfPath &newPath);
306 bool _AddPropertyDelete(
const SdfPath &oldPath);
309 bool _AddPropertyMove(
const SdfPath &oldPath,
const SdfPath &newPath);
312 void _ClearProcessedEdits();
316 void _ProcessEditsIfNeeded()
const;
321 class _EditProcessor;
323 UsdStageRefPtr _stage;
324 EditOptions _editOptions;
325 _EditDescription _editDescription;
326 mutable std::optional<_ProcessedEdit> _processedEdit;
329PXR_NAMESPACE_CLOSE_SCOPE
std::vector< LayerRelocatesEdit > LayerRelocatesEdits
List of relocates edits to perform on all layers.
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...
bool allowRelocatesAuthoring
Whether the namespace editor will allow the authoring of relocates in order to perform edits that wou...
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...
Structure for holding the options for how the namespace editor will behave when trying to perform edi...
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.