[LYN-3412] Updated LandscapeCanvas component to properly serialize with prefabs. (#1224)

* [LYN-3412] Updated LandscapeCanvas component to properly serialize with prefabs.

* [LYN-3412] Updated PR with feedback.

* [LYN-3412] Reverted unintentional changes.

* [LYN-3412] Removed one more comment.

* [LYN-3412] Additional PR feedback fixed.
main
cgalvan 5 years ago committed by GitHub
parent a963cd3ac8
commit 46f8c7c1ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,7 +173,7 @@ namespace AZ
{ {
if (inputPropertyValue.IsObject() && inputPropertyValue.HasMember("Value") && inputPropertyValue.HasMember("$type")) if (inputPropertyValue.IsObject() && inputPropertyValue.HasMember("Value") && inputPropertyValue.HasMember("$type"))
{ {
// Requiring explicit type info to differentiate be=tween colors versus vectors and numeric types // Requiring explicit type info to differentiate between colors versus vectors and numeric types
const AZ::Uuid baseTypeId = azrtti_typeid<T>(); const AZ::Uuid baseTypeId = azrtti_typeid<T>();
AZ::Uuid typeId = AZ::Uuid::CreateNull(); AZ::Uuid typeId = AZ::Uuid::CreateNull();
result.Combine(LoadTypeId(typeId, inputPropertyValue, context, &baseTypeId)); result.Combine(LoadTypeId(typeId, inputPropertyValue, context, &baseTypeId));
@ -198,7 +198,7 @@ namespace AZ
{ {
outputPropertyValue.SetObject(); outputPropertyValue.SetObject();
// Storing explicit type info to differentiate be=tween colors versus vectors and numeric types // Storing explicit type info to differentiate between colors versus vectors and numeric types
rapidjson::Value typeValue; rapidjson::Value typeValue;
result.Combine(StoreTypeId(typeValue, azrtti_typeid<T>(), context)); result.Combine(StoreTypeId(typeValue, azrtti_typeid<T>(), context));
outputPropertyValue.AddMember("$type", typeValue, context.GetJsonAllocator()); outputPropertyValue.AddMember("$type", typeValue, context.GetJsonAllocator());

@ -14,6 +14,7 @@
// AZ // AZ
#include <AzCore/RTTI/RTTI.h> #include <AzCore/RTTI/RTTI.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/std/containers/map.h> #include <AzCore/std/containers/map.h>
// Graph Model // Graph Model

@ -14,10 +14,10 @@
// AZ // AZ
#include <AzCore/std/containers/unordered_map.h> #include <AzCore/std/containers/unordered_map.h>
#include <AzCore/std/containers/vector.h> #include <AzCore/std/containers/vector.h>
#include <AzCore/std/any.h>
#include <AzCore/std/smart_ptr/enable_shared_from_this.h> #include <AzCore/std/smart_ptr/enable_shared_from_this.h>
// Graph Model // Graph Model
#include <GraphModel/Integration/GraphCanvasMetadata.h>
#include <GraphModel/Model/Common.h> #include <GraphModel/Model/Common.h>
#include <GraphModel/Model/GraphElement.h> #include <GraphModel/Model/GraphElement.h>
@ -136,9 +136,9 @@ namespace GraphModel
//! Set/gets a bundle of generic metadata that is provided by the node graph UI //! Set/gets a bundle of generic metadata that is provided by the node graph UI
//! system. This may include node positions, comment blocks, node groupings, and //! system. This may include node positions, comment blocks, node groupings, and
//! bookmarks, for example. //! bookmarks, for example.
void SetUiMetadata(const AZStd::any& uiMetadata); void SetUiMetadata(const GraphModelIntegration::GraphCanvasMetadata& uiMetadata);
const AZStd::any& GetUiMetadata() const; const GraphModelIntegration::GraphCanvasMetadata& GetUiMetadata() const;
AZStd::any& GetUiMetadata(); GraphModelIntegration::GraphCanvasMetadata& GetUiMetadata();
AZStd::shared_ptr<Slot> FindSlot(const Endpoint& endpoint); AZStd::shared_ptr<Slot> FindSlot(const Endpoint& endpoint);
@ -157,7 +157,7 @@ namespace GraphModel
ConnectionList m_connections; ConnectionList m_connections;
//! Used to store and serialize metadata from the graph UI, like node positions, comments, group boxes, etc. //! Used to store and serialize metadata from the graph UI, like node positions, comments, group boxes, etc.
AZStd::any m_uiMetadata; GraphModelIntegration::GraphCanvasMetadata m_uiMetadata;
//! Used to store all of our node <-> wrapper node mappings //! Used to store all of our node <-> wrapper node mappings
NodeWrappingMap m_nodeWrappings; NodeWrappingMap m_nodeWrappings;

@ -12,6 +12,7 @@
#pragma once #pragma once
// AZ // AZ
#include <AzCore/Serialization/Json/BaseJsonSerializer.h>
#include <AzCore/std/any.h> #include <AzCore/std/any.h>
#include <AzCore/std/hash.h> #include <AzCore/std/hash.h>
#include <AzCore/std/containers/list.h> #include <AzCore/std/containers/list.h>
@ -165,6 +166,32 @@ namespace GraphModel
ExtendableSlotConfiguration m_extendableSlotConfiguration; ExtendableSlotConfiguration m_extendableSlotConfiguration;
}; };
//! Custom JSON serializer for Slot because we use an AZStd::any for m_value
class JsonSlotSerializer
: public AZ::BaseJsonSerializer
{
public:
AZ_RTTI(JsonSlotSerializer, "{8AC96D70-7BCD-4D68-8813-269938982D51}", AZ::BaseJsonSerializer);
AZ_CLASS_ALLOCATOR(JsonSlotSerializer, AZ::SystemAllocator, 0);
AZ::JsonSerializationResult::Result Load(
void* outputValue, const AZ::Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
AZ::JsonDeserializerContext& context) override;
AZ::JsonSerializationResult::Result Store(
rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, const AZ::Uuid& valueTypeId,
AZ::JsonSerializerContext& context) override;
private:
template<typename T>
bool LoadAny(
AZStd::any& propertyValue, const rapidjson::Value& inputPropertyValue, AZ::JsonDeserializerContext& context,
AZ::JsonSerializationResult::ResultCode& result);
template<typename T>
bool StoreAny(
const AZStd::any& propertyValue, rapidjson::Value& outputPropertyValue, AZ::JsonSerializerContext& context,
AZ::JsonSerializationResult::ResultCode& result);
};
//!!! Start in Graph.h for high level GraphModel documentation !!! //!!! Start in Graph.h for high level GraphModel documentation !!!
@ -180,6 +207,7 @@ namespace GraphModel
class Slot : public GraphElement, public AZStd::enable_shared_from_this<Slot> class Slot : public GraphElement, public AZStd::enable_shared_from_this<Slot>
{ {
friend class Graph; // So the Graph can update the Slot's cache of Connection pointers friend class Graph; // So the Graph can update the Slot's cache of Connection pointers
friend class JsonSlotSerializer; // So we can set the m_value and m_subId directly from the serializer
public: public:
AZ_CLASS_ALLOCATOR(Slot, AZ::SystemAllocator, 0); AZ_CLASS_ALLOCATOR(Slot, AZ::SystemAllocator, 0);

@ -1338,11 +1338,7 @@ namespace GraphModelIntegration
GraphCanvasMetadata* GraphController::GetGraphMetadata() GraphCanvasMetadata* GraphController::GetGraphMetadata()
{ {
if (!m_graph->GetUiMetadata().is<GraphCanvasMetadata>()) GraphCanvasMetadata* graphCanvasMetadata = &m_graph->GetUiMetadata();
{
m_graph->SetUiMetadata(AZStd::any(GraphCanvasMetadata()));
}
GraphCanvasMetadata* graphCanvasMetadata = AZStd::any_cast<GraphCanvasMetadata>(&m_graph->GetUiMetadata());
AZ_Assert(graphCanvasMetadata, "GraphCanvasMetadata not initialized"); AZ_Assert(graphCanvasMetadata, "GraphCanvasMetadata not initialized");
return graphCanvasMetadata; return graphCanvasMetadata;
} }

@ -37,7 +37,7 @@ namespace GraphModel
if (serializeContext) if (serializeContext)
{ {
serializeContext->Class<Graph>() serializeContext->Class<Graph>()
->Version(1) ->Version(2)
->Field("m_nodes", &Graph::m_nodes) ->Field("m_nodes", &Graph::m_nodes)
->Field("m_connections", &Graph::m_connections) ->Field("m_connections", &Graph::m_connections)
->Field("m_uiMetadata", &Graph::m_uiMetadata) ->Field("m_uiMetadata", &Graph::m_uiMetadata)
@ -312,19 +312,19 @@ namespace GraphModel
} }
void Graph::SetUiMetadata(const AZStd::any& uiMetadata) void Graph::SetUiMetadata(const GraphModelIntegration::GraphCanvasMetadata& uiMetadata)
{ {
m_uiMetadata = uiMetadata; m_uiMetadata = uiMetadata;
} }
const AZStd::any& Graph::GetUiMetadata() const const GraphModelIntegration::GraphCanvasMetadata& Graph::GetUiMetadata() const
{ {
return m_uiMetadata; return m_uiMetadata;
} }
AZStd::any& Graph::GetUiMetadata() GraphModelIntegration::GraphCanvasMetadata& Graph::GetUiMetadata()
{ {
return m_uiMetadata; return m_uiMetadata;
} }

@ -11,9 +11,14 @@
*/ */
// AZ // AZ
#include <AzCore/Math/Color.h>
#include <AzCore/Math/Vector2.h>
#include <AzCore/Math/Vector3.h>
#include <AzCore/Math/Vector4.h>
#include <AzCore/std/smart_ptr/make_shared.h> #include <AzCore/std/smart_ptr/make_shared.h>
#include <AzCore/RTTI/BehaviorContext.h> #include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/EditContext.h> #include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/Json/RegistrationContext.h>
#include <AzCore/Serialization/SerializeContext.h> #include <AzCore/Serialization/SerializeContext.h>
// Graph Model // Graph Model
@ -294,13 +299,164 @@ namespace GraphModel
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////
// Slot // Slot
AZ::JsonSerializationResult::Result JsonSlotSerializer::Load(
void* outputValue, const AZ::Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
AZ::JsonDeserializerContext& context)
{
namespace JSR = AZ::JsonSerializationResult;
AZ_Assert(
azrtti_typeid<Slot>() == outputValueTypeId,
"Unable to deserialize Slot from json because the provided type is %s.",
outputValueTypeId.ToString<AZStd::string>().c_str());
Slot* slot = reinterpret_cast<Slot*>(outputValue);
AZ_Assert(slot, "Output value for JsonSlotSerializer can't be null.");
JSR::ResultCode result(JSR::Tasks::ReadField);
auto serializedSlotValue = inputValue.FindMember("m_value");
if (serializedSlotValue != inputValue.MemberEnd())
{
AZStd::any slotValue;
if (LoadAny<bool>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<int>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<float>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<AZStd::string>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<AZ::Vector2>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<AZ::Vector3>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<AZ::Vector4>(slotValue, serializedSlotValue->value, context, result) ||
LoadAny<AZ::EntityId>(slotValue, serializedSlotValue->value, context, result))
{
slot->m_value = slotValue;
}
}
// Load m_subId normally because it's just an int
{
SlotSubId slotSubId = 0;
result.Combine(ContinueLoadingFromJsonObjectField(
&slotSubId, azrtti_typeid<SlotSubId>(), inputValue,
"m_subId", context));
slot->m_subId = slotSubId;
}
return context.Report(
result,
result.GetProcessing() != JSR::Processing::Halted ? "Succesfully loaded Slot information."
: "Failed to load Slot information.");
}
AZ::JsonSerializationResult::Result JsonSlotSerializer::Store(
rapidjson::Value& outputValue, const void* inputValue, [[maybe_unused]] const void* defaultValue, const AZ::Uuid& valueTypeId,
AZ::JsonSerializerContext& context)
{
namespace JSR = AZ::JsonSerializationResult;
AZ_Assert(
azrtti_typeid<Slot>() == valueTypeId,
"Unable to Serialize Slot because the provided type is %s.", valueTypeId.ToString<AZStd::string>().c_str());
const Slot* slot = reinterpret_cast<const Slot*>(inputValue);
AZ_Assert(slot, "Input value for JsonSlotSerializer can't be null.");
outputValue.SetObject();
JSR::ResultCode result(JSR::Tasks::WriteValue);
{
AZ::ScopedContextPath subPathPropertyOverrides(context, "m_value");
if (!slot->m_value.empty())
{
rapidjson::Value outputPropertyValue;
if (StoreAny<bool>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<int>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<float>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<AZStd::string>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<AZ::Vector2>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<AZ::Vector3>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<AZ::Vector4>(slot->m_value, outputPropertyValue, context, result) ||
StoreAny<AZ::EntityId>(slot->m_value, outputPropertyValue, context, result))
{
outputValue.AddMember("m_value", outputPropertyValue, context.GetJsonAllocator());
}
}
}
{
AZ::ScopedContextPath subSlotId(context, "m_subId");
SlotSubId defaultSubId = 0;
result.Combine(ContinueStoringToJsonObjectField(
outputValue, "m_subId", &slot->m_subId, &defaultSubId,
azrtti_typeid<SlotSubId>(), context));
}
return context.Report(
result,
result.GetProcessing() != JSR::Processing::Halted ? "Successfully stored MaterialAssignment information."
: "Failed to store MaterialAssignment information.");
}
template<typename T>
bool JsonSlotSerializer::LoadAny(
AZStd::any& propertyValue, const rapidjson::Value& inputPropertyValue, AZ::JsonDeserializerContext& context,
AZ::JsonSerializationResult::ResultCode& result)
{
auto valueItr = inputPropertyValue.FindMember("Value");
auto typeItr = inputPropertyValue.FindMember("$type");
if ((valueItr != inputPropertyValue.MemberEnd()) && (typeItr != inputPropertyValue.MemberEnd()))
{
// Requiring explicit type info to differentiate between colors versus vectors and numeric types
const AZ::Uuid baseTypeId = azrtti_typeid<T>();
AZ::Uuid typeId = AZ::Uuid::CreateNull();
result.Combine(LoadTypeId(typeId, inputPropertyValue, context, &baseTypeId));
if (typeId == azrtti_typeid<T>())
{
T value;
result.Combine(ContinueLoadingFromJsonObjectField(&value, azrtti_typeid<T>(), inputPropertyValue, "Value", context));
propertyValue = value;
return true;
}
}
return false;
}
template<typename T>
bool JsonSlotSerializer::StoreAny(
const AZStd::any& propertyValue, rapidjson::Value& outputPropertyValue, AZ::JsonSerializerContext& context,
AZ::JsonSerializationResult::ResultCode& result)
{
if (propertyValue.is<T>())
{
outputPropertyValue.SetObject();
// Storing explicit type info to differentiate between colors versus vectors and numeric types
rapidjson::Value typeValue;
result.Combine(StoreTypeId(typeValue, azrtti_typeid<T>(), context));
outputPropertyValue.AddMember("$type", typeValue, context.GetJsonAllocator());
T value = AZStd::any_cast<T>(propertyValue);
result.Combine(
ContinueStoringToJsonObjectField(outputPropertyValue, "Value", &value, nullptr, azrtti_typeid<T>(), context));
return true;
}
return false;
}
void Slot::Reflect(AZ::ReflectContext* context) void Slot::Reflect(AZ::ReflectContext* context)
{ {
AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context); if (auto jsonContext = azrtti_cast<AZ::JsonRegistrationContext*>(context))
if (serializeContext) {
jsonContext->Serializer<JsonSlotSerializer>()->HandlesType<Slot>();
}
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{ {
serializeContext->Class<Slot>() serializeContext->Class<Slot>()
->Version(0) ->Version(1)
->Field("m_value", &Slot::m_value) ->Field("m_value", &Slot::m_value)
->Field("m_subId", &Slot::m_subId) ->Field("m_subId", &Slot::m_subId)
// m_slotDescription is not reflected because that data is populated procedurally by each node // m_slotDescription is not reflected because that data is populated procedurally by each node

@ -460,10 +460,10 @@ namespace LandscapeCanvasEditor
GraphCanvas::StyleManagerRequestBus::Event(editorId, &GraphCanvas::StyleManagerRequests::RegisterDataPaletteStyle, LandscapeCanvas::AreaTypeId, "VegetationAreaDataColorPalette"); GraphCanvas::StyleManagerRequestBus::Event(editorId, &GraphCanvas::StyleManagerRequests::RegisterDataPaletteStyle, LandscapeCanvas::AreaTypeId, "VegetationAreaDataColorPalette");
LandscapeCanvas::LandscapeCanvasRequestBus::Handler::BusConnect(); LandscapeCanvas::LandscapeCanvasRequestBus::Handler::BusConnect();
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
AzToolsFramework::EditorPickModeNotificationBus::Handler::BusConnect(AzToolsFramework::GetEntityContextId()); AzToolsFramework::EditorPickModeNotificationBus::Handler::BusConnect(AzToolsFramework::GetEntityContextId());
AzToolsFramework::EntityCompositionNotificationBus::Handler::BusConnect(); AzToolsFramework::EntityCompositionNotificationBus::Handler::BusConnect();
AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusConnect(); AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusConnect();
AzToolsFramework::Prefab::PrefabPublicNotificationBus::Handler::BusConnect();
CrySystemEventBus::Handler::BusConnect(); CrySystemEventBus::Handler::BusConnect();
AZ::EntitySystemBus::Handler::BusConnect(); AZ::EntitySystemBus::Handler::BusConnect();
@ -480,6 +480,7 @@ namespace LandscapeCanvasEditor
{ {
AZ::EntitySystemBus::Handler::BusDisconnect(); AZ::EntitySystemBus::Handler::BusDisconnect();
CrySystemEventBus::Handler::BusDisconnect(); CrySystemEventBus::Handler::BusDisconnect();
AzToolsFramework::Prefab::PrefabPublicNotificationBus::Handler::BusDisconnect();
AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusDisconnect(); AzToolsFramework::ToolsApplicationNotificationBus::Handler::BusDisconnect();
AzToolsFramework::EditorPickModeNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EditorPickModeNotificationBus::Handler::BusDisconnect();
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
@ -883,6 +884,10 @@ namespace LandscapeCanvasEditor
if (landscapeCanvasComponent) if (landscapeCanvasComponent)
{ {
landscapeCanvasComponent->m_graph = *m_serializeContext->CloneObject(graph.get()); landscapeCanvasComponent->m_graph = *m_serializeContext->CloneObject(graph.get());
// Mark the Landscape Canvas entity as dirty so the changes to the graph will be picked up on the next save
AzToolsFramework::ScopedUndoBatch undo("Update Landscape Canvas Graph");
AzToolsFramework::ToolsApplicationRequests::Bus::Broadcast(&AzToolsFramework::ToolsApplicationRequests::Bus::Events::AddDirtyEntity, rootEntityId);
} }
} }
} }
@ -1572,7 +1577,7 @@ namespace LandscapeCanvasEditor
void MainWindow::HandleEditorEntityCreated(const AZ::EntityId& entityId, GraphCanvas::GraphId graphId) void MainWindow::HandleEditorEntityCreated(const AZ::EntityId& entityId, GraphCanvas::GraphId graphId)
{ {
if (m_ignoreGraphUpdates) if (m_ignoreGraphUpdates || m_prefabPropagationInProgress)
{ {
return; return;
} }
@ -1622,6 +1627,11 @@ namespace LandscapeCanvasEditor
void MainWindow::OnEditorEntityDeleted(const AZ::EntityId& entityId) void MainWindow::OnEditorEntityDeleted(const AZ::EntityId& entityId)
{ {
if (m_prefabPropagationInProgress)
{
return;
}
m_queuedEntityDeletes.push_back(entityId); m_queuedEntityDeletes.push_back(entityId);
QTimer::singleShot(0, [this, entityId]() { QTimer::singleShot(0, [this, entityId]() {
@ -2456,6 +2466,11 @@ namespace LandscapeCanvasEditor
void MainWindow::EntityParentChanged(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId) void MainWindow::EntityParentChanged(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId)
{ {
if (m_prefabPropagationInProgress)
{
return;
}
GraphCanvas::GraphId oldGraphId = FindGraphContainingEntity(oldParentId); GraphCanvas::GraphId oldGraphId = FindGraphContainingEntity(oldParentId);
GraphCanvas::GraphId newGraphId = FindGraphContainingEntity(newParentId); GraphCanvas::GraphId newGraphId = FindGraphContainingEntity(newParentId);
@ -2482,6 +2497,20 @@ namespace LandscapeCanvasEditor
} }
} }
void MainWindow::OnPrefabInstancePropagationBegin()
{
// Ignore graph updates during prefab propagation because the entities will be
// deleted and re-created, which would inadvertantly trigger our logic to close
// the graph when the corresponding entity is deleted.
m_prefabPropagationInProgress = true;
}
void MainWindow::OnPrefabInstancePropagationEnd()
{
// See comment above in OnPrefabInstancePropagationBegin
m_prefabPropagationInProgress = false;
}
void MainWindow::OnCryEditorEndCreate() void MainWindow::OnCryEditorEndCreate()
{ {
UpdateGraphEnabled(); UpdateGraphEnabled();
@ -2490,6 +2519,15 @@ namespace LandscapeCanvasEditor
void MainWindow::OnCryEditorEndLoad() void MainWindow::OnCryEditorEndLoad()
{ {
UpdateGraphEnabled(); UpdateGraphEnabled();
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect();
}
void MainWindow::OnCryEditorCloseScene()
{
UpdateGraphEnabled();
AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect();
} }
void MainWindow::OnCryEditorSceneClosed() void MainWindow::OnCryEditorSceneClosed()

@ -24,6 +24,7 @@
#include <AzToolsFramework/API/EntityCompositionNotificationBus.h> #include <AzToolsFramework/API/EntityCompositionNotificationBus.h>
#include <AzToolsFramework/API/ToolsApplicationAPI.h> #include <AzToolsFramework/API/ToolsApplicationAPI.h>
#include <AzToolsFramework/Entity/EditorEntityContextBus.h> #include <AzToolsFramework/Entity/EditorEntityContextBus.h>
#include <AzToolsFramework/Prefab/PrefabPublicNotificationBus.h>
#include <AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx> #include <AzToolsFramework/UI/PropertyEditor/EntityPropertyEditor.hxx>
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h> #include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
@ -84,6 +85,7 @@ namespace LandscapeCanvasEditor
, private AzToolsFramework::EntityCompositionNotificationBus::Handler , private AzToolsFramework::EntityCompositionNotificationBus::Handler
, private AzToolsFramework::PropertyEditorEntityChangeNotificationBus::MultiHandler , private AzToolsFramework::PropertyEditorEntityChangeNotificationBus::MultiHandler
, private AzToolsFramework::ToolsApplicationNotificationBus::Handler , private AzToolsFramework::ToolsApplicationNotificationBus::Handler
, private AzToolsFramework::Prefab::PrefabPublicNotificationBus::Handler
, private CrySystemEventBus::Handler , private CrySystemEventBus::Handler
{ {
Q_OBJECT Q_OBJECT
@ -183,10 +185,15 @@ namespace LandscapeCanvasEditor
void EntityParentChanged(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId) override; void EntityParentChanged(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId) override;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//! PrefabPublicNotificationBus overrides
void OnPrefabInstancePropagationBegin() override;
void OnPrefabInstancePropagationEnd() override;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// CrySystemEventBus overrides // CrySystemEventBus overrides
void OnCryEditorEndCreate() override; void OnCryEditorEndCreate() override;
void OnCryEditorEndLoad() override; void OnCryEditorEndLoad() override;
void OnCryEditorCloseScene() override;
void OnCryEditorSceneClosed() override; void OnCryEditorSceneClosed() override;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -246,6 +253,7 @@ namespace LandscapeCanvasEditor
AZ::SerializeContext* m_serializeContext = nullptr; AZ::SerializeContext* m_serializeContext = nullptr;
bool m_ignoreGraphUpdates = false; bool m_ignoreGraphUpdates = false;
bool m_prefabPropagationInProgress = false;
bool m_inObjectPickMode = false; bool m_inObjectPickMode = false;
using DeletedNodePositionsMap = AZStd::unordered_map<AZ::EntityComponentIdPair, AZ::Vector2>; using DeletedNodePositionsMap = AZStd::unordered_map<AZ::EntityComponentIdPair, AZ::Vector2>;

Loading…
Cancel
Save