SetComponentProperty is now supported by undo operation (#5599)

* Adding undo support to SetComponentProperty to make it function with prefab system

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>

* Renaming a variable

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>

* PR feedback

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>
monroegm-disable-blank-issue-2
Mikhail Naumov 4 years ago committed by GitHub
parent 5c0fe6a54f
commit b3e2c3f075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -597,11 +597,13 @@ namespace AzToolsFramework
pte.SetVisibleEnforcement(true); pte.SetVisibleEnforcement(true);
} }
ScopedUndoBatch undo("Modify Entity Property");
PropertyOutcome result = pte.SetProperty(propertyPath, value); PropertyOutcome result = pte.SetProperty(propertyPath, value);
if (result.IsSuccess()) if (result.IsSuccess())
{ {
PropertyEditorEntityChangeNotificationBus::Event(componentInstance.GetEntityId(), &PropertyEditorEntityChangeNotifications::OnEntityComponentPropertyChanged, componentInstance.GetComponentId()); PropertyEditorEntityChangeNotificationBus::Event(componentInstance.GetEntityId(), &PropertyEditorEntityChangeNotifications::OnEntityComponentPropertyChanged, componentInstance.GetComponentId());
} }
undo.MarkEntityDirty(componentInstance.GetEntityId());
return result; return result;
} }

Loading…
Cancel
Save