class
ReparentSceneObjectUndoableOperation
Inherits:
UndoableOperation
Moves one or multiple scene objects to a new parent and allows you to undo the operation.
Public
Constructors
ReparentSceneObjectUndoableOperation
ReparentSceneObjectUndoableOperation(PrivatelyConstruct, const String &description, const Vector<HSceneObject> &sceneObjects, const HSceneObject &newParent)
Methods
staticExecute
static void Execute(const SPtr<UndoRedo> &undoRedo, const Vector<HSceneObject> &sceneObjects, const HSceneObject &newParent, const String &description = StringUtility::kBlank)
Creates and executes the operation on the provided scene object(s).
Automatically registers the operation with undo/redo system.
- undoRedo
- Undo/redo system to register the operation with.
- sceneObjects
- Object(s) to change the parent for.
- newParent
- New parent for the provided objects.
- description
- Optional description of what exactly the operation does.
Commit
void Commit() override
Applies the command, committing the change.
Revert
void Revert() override
Reverts the command, reverting the change previously done with commit().
Private
Fields
mSceneObjects
Vector<HSceneObject> mSceneObjects
mOldParents
Vector<HSceneObject> mOldParents
mNewParent
HSceneObject mNewParent