All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UsdNamespaceEditor Class Reference

#include <namespaceEditor.h>

Classes

struct  EditOptions
 Structure for holding the options for how the namespace editor will behave when trying to perform edits. More...
 

Public Member Functions

USD_API UsdNamespaceEditor (const UsdStageRefPtr &stage)
 
USD_API UsdNamespaceEditor (const UsdStageRefPtr &stage, EditOptions &&editOptions)
 
USD_API UsdNamespaceEditor (const UsdStageRefPtr &stage, const EditOptions &editOptions)
 
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 stage.
 
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 to instead be at the path newPath.
 
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 stage.
 
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 stage to instead have the name newName.
 
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 stage to instead be a namespace child of the composed prim at the path of newParent.
 
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 stage to instead be a prim named newName that is a namespace child of the composed prim at the
path of newParent.
 
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 stage.
 
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 stage to instead be at the path newPath.
 
USD_API bool DeleteProperty (const UsdProperty &property)
 Adds an edit operation to delete the composed property at the path of property from this namespace editor's stage.
 
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 editor's stage to instead have the name newName.
 
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 editor's stage to instead be a namespace child of the composed property at the path of newParent.
 
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 editor's stage to instead be a property named newName that is a namespace child of the composed prim at the path of newParent.
 
USD_API bool ApplyEdits ()
 Applies all the added namespace edits stored in this to namespace editor to its stage by authoring all scene description in the layer stack of the current edit target necessary to move or delete the composed objects that the edit paths refer to.
 
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 its stage.
 
Dependent Stages

Dependent stages are additional stages that may have composition dependencies on the layer edits made for the editor's primary stage.

By adding dependent stages, the editor can make additional edits so that affected composition arcs and specs that depend on affected composition in composed prims on these stages are updated to compose with the moved prim specs or, in the case of deletions, removed when the specs they depend on are removed.

Dependencies in the dependent stages are based only what is currently loaded for those stages. In other words, the editor cannot find and edit dependencies from unloaded payloads, inactive prim children, prims that are load mask filtered, unselected variants, etc. The primary stage of this editor is always a dependent stage, meaning that edits will always be made to maintain affected composition dependencies in the primary stage.

USD_API void AddDependentStage (const UsdStageRefPtr &stage)
 Adds the given stage as a dependent stage of this namespace editor.
 
USD_API void RemoveDependentStage (const UsdStageRefPtr &stage)
 Removes the given stage as a dependent stage of this namespace editor.
 
USD_API void SetDependentStages (const UsdStageRefPtrVector &stages)
 Sets the list of dependent stages for this namespace editor to stages.
 

Detailed Description

Warning
This code is a work in progress and should not be used in production scenarios. It is currently not feature-complete and subject to change.

Provides namespace editing operations

Definition at line 26 of file namespaceEditor.h.


Class Documentation

◆ UsdNamespaceEditor::EditOptions

struct UsdNamespaceEditor::EditOptions

Structure for holding the options for how the namespace editor will behave when trying to perform edits.

Definition at line 31 of file namespaceEditor.h.

Class Members
bool allowRelocatesAuthoring = true Whether the namespace editor will allow the authoring of relocates in order to perform edits that would otherwise not be possible because of opinions across composition arcs.

By default this is set to true. If set to false the namespace editor will consider edits that require relocates as errors and will not apply the edit.

Member Function Documentation

◆ AddDependentStage()

USD_API void AddDependentStage ( const UsdStageRefPtr &  stage)

Adds the given stage as a dependent stage of this namespace editor.

◆ ApplyEdits()

USD_API bool ApplyEdits ( )

Applies all the added namespace edits stored in this to namespace editor to its stage by authoring all scene description in the layer stack of the current edit target necessary to move or delete the composed objects that the edit paths refer to.

Returns true if all the necessary edits are successfully performed; returns false and emits a coding error otherwise.

◆ CanApplyEdits()

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 its stage.

In other words, this returns whether ApplyEdits should be successful if it were called right now. If this would return false and whyNot is provided, the reasons ApplyEdits would fail will be copied to whyNot.

◆ DeletePrim()

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 stage.

This is equivalent to calling DeletePrimAtPath(prim.GetPath())

Returns true if the prim provides a valid possible composed prim path; returns false and emits a coding error if not.

◆ DeletePrimAtPath()

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 stage.

Returns true if the path is a valid possible composed prim path; returns false and emits a coding error if not.

◆ DeleteProperty()

USD_API bool DeleteProperty ( const UsdProperty property)

Adds an edit operation to delete the composed property at the path of property from this namespace editor's stage.

This is equivalent to calling DeletePropertyAtPath(property.GetPath())

Returns true if the property provides a valid possible composed property path; returns false and emits a coding error if not.

◆ DeletePropertyAtPath()

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 stage.

Returns true if the path is a valid possible composed property path; returns false and emits a coding error if not.

◆ MovePrimAtPath()

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 to instead be at the path newPath.


Returns true if both paths are valid possible composed prim path; returns false and emits a coding error if not.

◆ MovePropertyAtPath()

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 stage to instead be at the path newPath.

Returns true if both paths are valid possible composed property path; returns false and emits a coding error if not.

◆ RemoveDependentStage()

USD_API void RemoveDependentStage ( const UsdStageRefPtr &  stage)

Removes the given stage as a dependent stage of this namespace editor.

◆ RenamePrim()

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 stage to instead have the name newName.

Returns true if the prim provides a valid possible composed prim path and the new name is a valid possible prim name; returns false and emits a coding error if not.

◆ RenameProperty()

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 editor's stage to instead have the name newName.

Returns true if the property provides a valid possible composed property path and the new name is a valid possible property name; returns false and emits a coding error if not.

◆ ReparentPrim() [1/2]

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 stage to instead be a namespace child of the composed prim at the path of newParent.

Returns true if the both the prim and the new parent prim provide a valid possible composed prim paths; returns false and emits a coding error if not.

◆ ReparentPrim() [2/2]

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 stage to instead be a prim named newName that is a namespace child of the composed prim at the
path of newParent.

Returns true if the both the prim and the new parent prim provide a valid possible composed prim paths and the new name is a valid prim name; returns false and emits a coding error if not.

◆ ReparentProperty() [1/2]

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 editor's stage to instead be a namespace child of the composed property at the path of newParent.

Returns true if the both the property and the new parent prim provide a valid possible composed paths; returns false and emits a coding error if not.

◆ ReparentProperty() [2/2]

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 editor's stage to instead be a property named newName that is a namespace child of the composed prim at the path of newParent.

Returns true if the both the property and the new parent prim provide a valid possible composed paths and the new name is a valid property name; returns false and emits a coding error if not.

◆ SetDependentStages()

USD_API void SetDependentStages ( const UsdStageRefPtrVector &  stages)

Sets the list of dependent stages for this namespace editor to stages.


The documentation for this class was generated from the following file: