7#ifndef PXR_USD_USD_NAMESPACE_EDITOR_H
8#define PXR_USD_USD_NAMESPACE_EDITOR_H
13#include "pxr/usd/usd/api.h"
16#include "pxr/usd/pcp/dependentNamespaceEditUtils.h"
19PXR_NAMESPACE_OPEN_SCOPE
46 const UsdStageRefPtr &stage,
51 const UsdStageRefPtr &stage,
252 enum class _EditType {
261 struct _EditDescription {
269 _EditType editType = _EditType::Invalid;
280 struct _ProcessedEdit
284 std::vector<std::string> errors;
287 _EditDescription editDescription;
291 SdfLayerHandleVector layersToEdit;
294 bool willAuthorRelocates =
false;
299 struct TargetPathListOpEdit {
304 SdfPropertySpecHandle propertySpec;
311 SdfPathListOp newFieldValue;
313 std::vector<TargetPathListOpEdit> targetPathListOpEdits;
323 std::vector<std::string> targetPathListOpErrors;
330 bool CanApply(std::string *whyNot)
const;
334 bool _AddPrimDelete(
const SdfPath &oldPath);
337 bool _AddPrimMove(
const SdfPath &oldPath,
const SdfPath &newPath);
340 bool _AddPropertyDelete(
const SdfPath &oldPath);
343 bool _AddPropertyMove(
const SdfPath &oldPath,
const SdfPath &newPath);
346 void _ClearProcessedEdits();
350 void _ProcessEditsIfNeeded()
const;
355 class _EditProcessor;
357 UsdStageRefPtr _stage;
360 using _StageSet = std::unordered_set<UsdStageRefPtr, TfHash>;
361 _StageSet _dependentStages;
362 EditOptions _editOptions;
363 _EditDescription _editDescription;
364 mutable std::optional<_ProcessedEdit> _processedEdit;
367PXR_NAMESPACE_CLOSE_SCOPE
Structure for bundling all the edits that need to be performed in order to perform a namespace edit a...
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 SdfLayerHandleVector GetLayersToEdit()
Returns the list of layers that will be edited if ApplyEdits() is called.
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 void AddDependentStage(const UsdStageRefPtr &stage)
Adds the given stage as a dependent stage of this namespace editor.
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 void SetDependentStages(const UsdStageRefPtrVector &stages)
Sets the list of dependent stages for this namespace editor to stages.
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...
USD_API void RemoveDependentStage(const UsdStageRefPtr &stage)
Removes the given stage as a dependent stage of this namespace editor.
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.