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
59 std::vector<std::string> errors;
60 std::vector<std::string> warnings;
64 return errors.empty();
73 const UsdStageRefPtr &stage,
74 EditOptions &&editOptions);
78 const UsdStageRefPtr &stage,
79 const EditOptions &editOptions);
292 enum class _EditType {
301 struct _EditDescription {
309 _EditType editType = _EditType::Invalid;
320 struct _ProcessedEdit
324 std::vector<std::string> errors;
329 std::vector<std::string> warnings;
332 _EditDescription editDescription;
336 SdfLayerHandleVector layersToEdit;
339 bool willAuthorRelocates =
false;
344 struct PathBearingFieldEdit {
356 std::vector<PathBearingFieldEdit> pathBearingFieldEdits;
369 UsdNamespaceEditor::CanApplyResult CanApply()
const;
373 bool _AddPrimDelete(
const SdfPath &oldPath);
376 bool _AddPrimMove(
const SdfPath &oldPath,
const SdfPath &newPath);
379 bool _AddPropertyDelete(
const SdfPath &oldPath);
382 bool _AddPropertyMove(
const SdfPath &oldPath,
const SdfPath &newPath);
385 void _ClearProcessedEdits();
389 void _ProcessEditsIfNeeded()
const;
394 class _EditProcessor;
396 UsdStageRefPtr _stage;
399 using _StageSet = std::unordered_set<UsdStageRefPtr, TfHash>;
400 _StageSet _dependentStages;
401 EditOptions _editOptions;
402 _EditDescription _editDescription;
403 mutable std::optional<_ProcessedEdit> _processedEdit;
406PXR_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.
Provides namespace editing operations, where a namespace edit is an operation that removes or changes...
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 CanApplyResult CanApplyEdits() const
Returns whether all the added namespace edits stored in this to namespace editor can be applied to it...
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 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...
USD_API bool CanApplyEdits(std::string *whyNot) const
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.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
@ Invalid
Invalid or unknown schema kind.