Reparenting - introduce loop detection on instance reparenting (DCO fix) (#1752)
* Detect loops in reparenting code and assert. Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Add warning when detecting a cyclical dependancy. Revert reparenting on loop. Signed-off-by: daimini <82231674+AMZN-daimini@users.noreply.github.com> Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com> * Use GetActiveWindow helper to handle window edge cases Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
#include <AzToolsFramework/UI/UICore/QTreeViewStateSaver.hxx>
|
||||
#include <AzToolsFramework/UI/UICore/QWidgetSavedState.h>
|
||||
#include <AzToolsFramework/UI/UICore/ProgressShield.hxx>
|
||||
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
|
||||
#include <AzToolsFramework/Slice/SliceUtilities.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorInspectorComponent.h>
|
||||
#include <AzToolsFramework/API/ComponentEntityObjectBus.h>
|
||||
@@ -1589,7 +1590,13 @@ namespace AzToolsFramework
|
||||
// Multiple changes to the same entity are just split between different undo nodes.
|
||||
for (AZ::EntityId entityId : m_dirtyEntities)
|
||||
{
|
||||
prefabPublicInterface->GenerateUndoNodesForEntityChangeAndUpdateCache(entityId, m_currentBatchUndo);
|
||||
auto outcome = prefabPublicInterface->GenerateUndoNodesForEntityChangeAndUpdateCache(entityId, m_currentBatchUndo);
|
||||
|
||||
if (!outcome.IsSuccess())
|
||||
{
|
||||
QMessageBox::warning(
|
||||
AzToolsFramework::GetActiveWindow(), QString("Error"), QString(outcome.GetError().c_str()), QMessageBox::Ok, QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user