From decf15df2167806daaa2159e1787fd568ddabfe0 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 24 Aug 2021 16:19:38 -0700 Subject: [PATCH 01/13] Move packet dispatch to return an enum that includes a pending option Signed-off-by: puvvadar --- .../AutoGen/AutoPacketDispatcher_Header.jinja | 2 +- .../AutoGen/AutoPacketDispatcher_Inline.jinja | 18 +++++++++++++---- .../ConnectionLayer/IConnectionListener.h | 4 ++-- .../AzNetworking/PacketLayer/IPacketHeader.h | 6 ++++++ .../UdpTransport/UdpConnection.cpp | 18 ++++++++--------- .../AzNetworking/UdpTransport/UdpConnection.h | 2 +- .../UdpTransport/UdpFragmentQueue.cpp | 20 +++++++++---------- .../UdpTransport/UdpFragmentQueue.h | 5 +++-- .../UdpTransport/UdpNetworkInterface.cpp | 12 ++++++++--- .../AutoGen/Multiplayer.AutoPackets.xml | 4 ++-- .../Editor/MultiplayerEditorConnection.cpp | 2 +- .../Editor/MultiplayerEditorConnection.h | 3 ++- .../Source/MultiplayerSystemComponent.cpp | 11 +++++++++- .../Code/Source/MultiplayerSystemComponent.h | 4 +++- 14 files changed, 73 insertions(+), 38 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Header.jinja b/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Header.jinja index 63442ea1eb..1e9edc56bd 100644 --- a/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Header.jinja +++ b/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Header.jinja @@ -16,7 +16,7 @@ namespace {{ xml.attrib['Name'] }} //! @param handler the handler used to handle the received packet //! @return boolean true on successful dispatch, false if the request was not handled template - bool DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler); + AzNetworking::PacketDispatchResult DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler); } {% endfor %} diff --git a/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja b/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja index ac659820c3..9767828f3a 100644 --- a/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja +++ b/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja @@ -2,7 +2,7 @@ namespace {{ xml.attrib['Name'] }} { template - inline bool DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler) + inline AzNetworking::PacketDispatchResult DispatchPacket(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer, HANDLER& handler) { switch (aznumeric_cast(packetHeader.GetPacketType())) { @@ -10,16 +10,26 @@ namespace {{ xml.attrib['Name'] }} case aznumeric_cast({{ Packet.attrib['Name'] }}::Type): { AZLOG(Debug_DispatchPackets, "Received packet %s", "{{ Packet.attrib['Name'] }}"); +{% if ('HandshakePacket' not in Packet.attrib) or (Packet.attrib['HandshakePacket'] == 'false') %} + if (!handler.IsHandshakeComplete()) + { + return AzNetworking::PacketDispatchResult::Pending; + } +{% endif %} + {{ Packet.attrib['Name'] }} packet; if (!serializer.Serialize(packet, "Packet")) { - return false; + return AzNetworking::PacketDispatchResult::Failure; + } + if(handler.HandleRequest(connection, packetHeader, packet)) + { + return AzNetworking::PacketDispatchResult::Success; } - return handler.HandleRequest(connection, packetHeader, packet); } {% endfor %} } - return false; + return AzNetworking::PacketDispatchResult::Failure; } } {% endfor %} diff --git a/Code/Framework/AzNetworking/AzNetworking/ConnectionLayer/IConnectionListener.h b/Code/Framework/AzNetworking/AzNetworking/ConnectionLayer/IConnectionListener.h index 41e79e2207..f93e7d72f6 100644 --- a/Code/Framework/AzNetworking/AzNetworking/ConnectionLayer/IConnectionListener.h +++ b/Code/Framework/AzNetworking/AzNetworking/ConnectionLayer/IConnectionListener.h @@ -45,8 +45,8 @@ namespace AzNetworking //! @param connection pointer to the connection instance generating the event //! @param packetHeader packet header of the associated payload //! @param serializer serializer instance containing the transmitted payload - //! @return boolean true to signal success, false to disconnect with a transport error - virtual bool OnPacketReceived(IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) = 0; + //! @return PacketDispatchResult result of the packet handling attempt + virtual PacketDispatchResult OnPacketReceived(IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) = 0; //! Called when a packet is deemed lost by the remote connection. //! @param connection pointer to the connection instance generating the event diff --git a/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h b/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h index ea9734a867..f7ca7f0166 100644 --- a/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h +++ b/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h @@ -15,6 +15,12 @@ namespace AzNetworking { + AZ_ENUM_CLASS(PacketDispatchResult + , Success + , Pending + , Failure + ); + AZ_ENUM_CLASS(PacketFlag , Compressed , MAX diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.cpp index 3efc6a51a8..7b451865c4 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.cpp @@ -236,14 +236,14 @@ namespace AzNetworking return true; } - bool UdpConnection::HandleCorePacket(IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer) + PacketDispatchResult UdpConnection::HandleCorePacket(IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer) { switch (static_cast(header.GetPacketType())) { case CorePackets::PacketType::InitiateConnectionPacket: { AZLOG(NET_CorePackets, "Received core packet %s", "InitiateConnection"); - return true; + return PacketDispatchResult::Success; } break; @@ -253,7 +253,7 @@ namespace AzNetworking CorePackets::ConnectionHandshakePacket packet; if (!serializer.Serialize(packet, "Packet")) { - return false; + return PacketDispatchResult::Failure; } if (m_state != ConnectionState::Connected) @@ -264,7 +264,7 @@ namespace AzNetworking } } - return true; + return PacketDispatchResult::Success; } break; @@ -274,10 +274,10 @@ namespace AzNetworking CorePackets::TerminateConnectionPacket packet; if (!serializer.Serialize(packet, "Packet")) { - return false; + return PacketDispatchResult::Failure; } Disconnect(packet.GetDisconnectReason(), TerminationEndpoint::Remote); - return true; + return PacketDispatchResult::Success; } break; @@ -287,10 +287,10 @@ namespace AzNetworking CorePackets::HeartbeatPacket packet; if (!serializer.Serialize(packet, "Packet")) { - return false; + return PacketDispatchResult::Failure; } // Do nothing, we've already processed our ack packets - return true; + return PacketDispatchResult::Success; } break; @@ -302,6 +302,6 @@ namespace AzNetworking AZ_Assert(false, "Unhandled core packet type!"); } - return false; + return PacketDispatchResult::Failure; } } diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h index 67d626d6cb..3d29cfcd23 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h @@ -131,7 +131,7 @@ namespace AzNetworking //! @param header the packet header received to process //! @param serializer the output serializer containing the transmitted packet data //! @return boolean true on successful handling of the received header - bool HandleCorePacket(IConnectionListener& listener, UdpPacketHeader& header, ISerializer& serializer); + PacketDispatchResult HandleCorePacket(IConnectionListener& listener, UdpPacketHeader& header, ISerializer& serializer); AZ_DISABLE_COPY_MOVE(UdpConnection); diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.cpp index 66fe6f30eb..fa4ee78a92 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.cpp @@ -37,14 +37,14 @@ namespace AzNetworking return m_sequenceGenerator.GetNextSequenceId(); } - bool UdpFragmentQueue::ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer) + PacketDispatchResult UdpFragmentQueue::ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer) { AZStd::unique_ptr packet = AZStd::make_unique(); if (!serializer.Serialize(*packet, "Packet")) { AZLOG(NET_FragmentQueue, "Fragment failed serialization"); - return false; + return PacketDispatchResult::Failure; } const bool isReliable = header.GetIsReliable(); @@ -63,14 +63,14 @@ namespace AzNetworking { // Too old to process AZLOG(NET_FragmentQueue, "Fragment sequence ID is outside our tracked window"); - return false; + return PacketDispatchResult::Failure; } if (m_deliveredFragments.GetBit(static_cast(sequenceDelta))) { // Received packet is a duplicate of one already forwarded to gameplay AZLOG(NET_FragmentQueue, "Received duplicate of fragmented packet %u, discarding", static_cast(fragmentSequence)); - return true; + return PacketDispatchResult::Success; } const uint32_t chunkCount = packet->GetChunkCount(); @@ -89,7 +89,7 @@ namespace AzNetworking { // Either we disagree on the number of chunks, or chunkIndex is bigger than the expected size, bail and disconnect AZLOG(NET_FragmentQueue, "Malformed chunk metadata in fragmented packet, chunkIndex %u, chunkCount %u, reservedSize %u", chunkIndex, chunkCount, static_cast(packetFragments.size())); - return false; + return PacketDispatchResult::Failure; } packetFragments[chunkIndex] = AZStd::move(packet); @@ -105,7 +105,7 @@ namespace AzNetworking } // We haven't received all chunks required to complete this packet yet - return true; + return PacketDispatchResult::Success; } totalPacketSize += static_cast(packetFragments[index]->GetChunkBuffer().GetSize()); @@ -119,7 +119,7 @@ namespace AzNetworking if (!buffer.Resize(totalPacketSize)) { AZLOG_ERROR("Fragmented packet is too large to fit in UdpPacketEncodingBuffer"); - return false; + return PacketDispatchResult::Failure; } uint8_t* bufferPointer = buffer.GetBuffer(); @@ -141,17 +141,17 @@ namespace AzNetworking if (!header.SerializePacketFlags(networkSerializer)) { AZLOG(NET_FragmentQueue, "Reconstructed fragmented packet failed packet flags serialization"); - return false; + return PacketDispatchResult::Failure; } if (!networkISerializer.Serialize(header, "Header")) { AZLOG(NET_FragmentQueue, "Reconstructed fragmented packet failed header serialization"); - return false; + return PacketDispatchResult::Failure; } } connection->GetPacketTracker().ProcessReceived(connection, header); - bool handledPacket = false; + PacketDispatchResult handledPacket; if (header.GetPacketType() < aznumeric_cast(CorePackets::PacketType::MAX)) { handledPacket = connection->HandleCorePacket(connectionListener, header, networkSerializer); diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.h index 38c4df4f0e..15d4cfa10c 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpFragmentQueue.h @@ -9,6 +9,7 @@ #pragma once #include +#include #include #include #include @@ -44,8 +45,8 @@ namespace AzNetworking //! @param connectionListener the connection listener for delivery of completed packets //! @param header the chunk packet header //! @param serializer the serializer containing the chunk body - //! @return boolean true if the chunk was processed, false if an error was encountered - bool ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer); + //! @return PacketDispatchResult result of processing the chunk + PacketDispatchResult ProcessReceivedChunk(UdpConnection* connection, IConnectionListener& connectionListener, UdpPacketHeader& header, ISerializer& serializer); private: diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index d50b20831f..983b425b60 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -277,7 +277,7 @@ namespace AzNetworking timeoutItem->UpdateTimeoutTime(startTimeMs); - bool handledPacket = false; + PacketDispatchResult handledPacket; if (header.GetPacketType() < aznumeric_cast(CorePackets::PacketType::MAX)) { handledPacket = connection->HandleCorePacket(m_connectionListener, header, packetSerializer); @@ -287,7 +287,7 @@ namespace AzNetworking handledPacket = m_connectionListener.OnPacketReceived(connection, header, packetSerializer); } - if (handledPacket) + if (handledPacket == PacketDispatchResult::Success) { connection->UpdateHeartbeat(currentTimeMs); if (connection->GetConnectionState() == ConnectionState::Connecting && !connection->GetDtlsEndpoint().IsConnecting()) @@ -299,10 +299,16 @@ namespace AzNetworking else if (m_socket->IsEncrypted() && connection->GetDtlsEndpoint().IsConnecting() && !IsHandshakePacket(connection->GetDtlsEndpoint(), header.GetPacketType())) { - // It's possible for one side to finish its half of the handshake and start sending encrypted data + // It's possible for one side to finish its half of the encryption handshake and start sending encrypted data + // This will appear as a SerializationError due to the incomplete encryption handshake // If it's not an expected unencrypted type then skip it for now continue; } + else if (handledPacket == PacketDispatchResult::Pending) + { + // If we did not handle due to a handshake pending completion, defer it + continue; + } else if (connection->GetConnectionState() != ConnectionState::Disconnecting) { connection->Disconnect(DisconnectReason::StreamError, TerminationEndpoint::Local); diff --git a/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml b/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml index ce8931107f..203750d761 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml +++ b/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml @@ -7,12 +7,12 @@ - + - + diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp index fc398182ef..e634cb52fc 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -168,7 +168,7 @@ namespace Multiplayer ; } - bool MultiplayerEditorConnection::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) + AzNetworking::PacketDispatchResult MultiplayerEditorConnection::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) { return MultiplayerEditorPackets::DispatchPacket(connection, packetHeader, serializer, *this); } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h index 8c19848db7..8f1f90cc6b 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h @@ -33,6 +33,7 @@ namespace Multiplayer MultiplayerEditorConnection(); ~MultiplayerEditorConnection() = default; + bool IsHandshakeComplete(){ return true; }; bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerInit& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerReady& packet); @@ -40,7 +41,7 @@ namespace Multiplayer //! @{ AzNetworking::ConnectResult ValidateConnect(const AzNetworking::IpAddress& remoteAddress, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; void OnConnect(AzNetworking::IConnection* connection) override; - bool OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; + AzNetworking::PacketDispatchResult OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; void OnPacketLost(AzNetworking::IConnection* connection, AzNetworking::PacketId packetId) override; void OnDisconnect(AzNetworking::IConnection* connection, AzNetworking::DisconnectReason reason, AzNetworking::TerminationEndpoint endpoint) override; //! @} diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index b0a8350982..c36f2e0f11 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -441,6 +441,11 @@ namespace Multiplayer MultiplayerPackets::SyncConsole m_syncPacket; }; + bool MultiplayerSystemComponent::IsHandshakeComplete() + { + return m_didHandshake; + } + bool MultiplayerSystemComponent::HandleRequest ( [[maybe_unused]] AzNetworking::IConnection* connection, @@ -465,6 +470,8 @@ namespace Multiplayer if (connection->SendReliablePacket(MultiplayerPackets::Accept(InvalidHostId, sv_map))) { + m_didHandshake = true; + // Sync our console ConsoleReplicator consoleReplicator(connection); AZ::Interface::Get()->VisitRegisteredFunctors([&consoleReplicator](AZ::ConsoleFunctorBase* functor) { consoleReplicator.Visit(functor); }); @@ -480,6 +487,8 @@ namespace Multiplayer [[maybe_unused]] MultiplayerPackets::Accept& packet ) { + m_didHandshake = true; + AZ::CVarFixedString commandString = "sv_map " + packet.GetMap(); AZ::Interface::Get()->PerformCommand(commandString.c_str()); @@ -670,7 +679,7 @@ namespace Multiplayer } } - bool MultiplayerSystemComponent::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) + AzNetworking::PacketDispatchResult MultiplayerSystemComponent::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) { return MultiplayerPackets::DispatchPacket(connection, packetHeader, serializer, *this); } diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index e2fb7deacc..74ba2ddf34 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -76,6 +76,7 @@ namespace Multiplayer int GetTickOrder() override; //! @} + bool IsHandshakeComplete(); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Connect& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Accept& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet); @@ -89,7 +90,7 @@ namespace Multiplayer //! @{ AzNetworking::ConnectResult ValidateConnect(const AzNetworking::IpAddress& remoteAddress, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; void OnConnect(AzNetworking::IConnection* connection) override; - bool OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; + AzNetworking::PacketDispatchResult OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; void OnPacketLost(AzNetworking::IConnection* connection, AzNetworking::PacketId packetId) override; void OnDisconnect(AzNetworking::IConnection* connection, AzNetworking::DisconnectReason reason, AzNetworking::TerminationEndpoint endpoint) override; //! @} @@ -158,6 +159,7 @@ namespace Multiplayer double m_serverSendAccumulator = 0.0; float m_renderBlendFactor = 0.0f; float m_tickFactor = 0.0f; + bool m_didHandshake = false; #if !defined(AZ_RELEASE_BUILD) MultiplayerEditorConnection m_editorConnectionListener; From 2ef5e956ba102492e270010bb79001f516596b8d Mon Sep 17 00:00:00 2001 From: puvvadar Date: Tue, 24 Aug 2021 16:26:32 -0700 Subject: [PATCH 02/13] Fix a function header comment Signed-off-by: puvvadar --- .../AzNetworking/AzNetworking/UdpTransport/UdpConnection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h index 3d29cfcd23..199a5a8347 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpConnection.h @@ -130,7 +130,7 @@ namespace AzNetworking //! @param listener a connection listener to receive connection related events //! @param header the packet header received to process //! @param serializer the output serializer containing the transmitted packet data - //! @return boolean true on successful handling of the received header + //! @return PacketDispatchResult result of processing the core packet PacketDispatchResult HandleCorePacket(IConnectionListener& listener, UdpPacketHeader& header, ISerializer& serializer); AZ_DISABLE_COPY_MOVE(UdpConnection); From ebbe4b99a409fdfaa90e20fc54742be4abad6a15 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 25 Aug 2021 10:21:29 -0700 Subject: [PATCH 03/13] Add const to some funcs and fix a comment Signed-off-by: puvvadar --- .../AzNetworking/UdpTransport/UdpNetworkInterface.cpp | 2 +- .../Code/Source/Editor/MultiplayerEditorConnection.h | 2 +- Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp | 2 +- Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index 983b425b60..c450d27dc8 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -306,7 +306,7 @@ namespace AzNetworking } else if (handledPacket == PacketDispatchResult::Pending) { - // If we did not handle due to a handshake pending completion, defer it + // If we did not handle due to a handshake pending completion, skip it continue; } else if (connection->GetConnectionState() != ConnectionState::Disconnecting) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h index 8f1f90cc6b..ca815d5c48 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h @@ -33,7 +33,7 @@ namespace Multiplayer MultiplayerEditorConnection(); ~MultiplayerEditorConnection() = default; - bool IsHandshakeComplete(){ return true; }; + bool IsHandshakeComplete() const { return true; }; bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerInit& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerReady& packet); diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index c36f2e0f11..6e9cd35c79 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -441,7 +441,7 @@ namespace Multiplayer MultiplayerPackets::SyncConsole m_syncPacket; }; - bool MultiplayerSystemComponent::IsHandshakeComplete() + bool MultiplayerSystemComponent::IsHandshakeComplete() const { return m_didHandshake; } diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index 74ba2ddf34..c467ed9ad9 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -76,7 +76,7 @@ namespace Multiplayer int GetTickOrder() override; //! @} - bool IsHandshakeComplete(); + bool IsHandshakeComplete() const; bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Connect& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Accept& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet); From c30642d855d63e60f25f879d48362ad9a2aaaf2b Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Wed, 25 Aug 2021 16:13:10 -0500 Subject: [PATCH 04/13] Renaming test files for standardization and setting optimized tests to run alongside existing Signed-off-by: jckand-amzn --- .../PythonTests/largeworlds/CMakeLists.txt | 34 +++- ...gnal_Periodic.py => TestSuite_Periodic.py} | 0 ...zed.py => TestSuite_Periodic_Optimized.py} | 0 .../test_GradientIncompatibilities.py | 103 ----------- .../test_GradientPreviewSettings.py | 118 ------------ .../gradient_signal/test_GradientSampling.py | 86 --------- .../test_GradientSurfaceTagEmitter.py | 116 ------------ .../gradient_signal/test_GradientTransform.py | 157 ---------------- .../gradient_signal/test_ImageGradient.py | 69 ------- ...dscapeCanvas_Main.py => TestSuite_Main.py} | 0 ...timized.py => TestSuite_Main_Optimized.py} | 8 +- ...nvas_Periodic.py => TestSuite_Periodic.py} | 0 .../landscape_canvas/test_AreaNodes.py | 125 ------------- .../test_EditFunctionality.py | 84 --------- .../test_GeneralGraphFunctionality.py | 173 ------------------ .../test_GradientModifierNodes.py | 92 ---------- .../landscape_canvas/test_GradientNodes.py | 109 ----------- .../test_GraphComponentSync.py | 167 ----------------- .../test_LandscapeCanvas_Main_Optimized.py | 22 --- .../landscape_canvas/test_ShapeNodes.py | 82 --------- 20 files changed, 38 insertions(+), 1507 deletions(-) rename AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/{test_GradientSignal_Periodic.py => TestSuite_Periodic.py} (100%) rename AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/{test_GradientSignal_Periodic_Optimized.py => TestSuite_Periodic_Optimized.py} (100%) delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py rename AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/{test_LandscapeCanvas_Main.py => TestSuite_Main.py} (100%) rename AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/{test_LandscapeCanvas_Periodic_Optimized.py => TestSuite_Main_Optimized.py} (92%) rename AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/{test_LandscapeCanvas_Periodic.py => TestSuite_Periodic.py} (100%) delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py delete mode 100644 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py delete mode 100644 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Main_Optimized.py delete mode 100755 AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt index f133780fbc..b3030e84ac 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt @@ -124,13 +124,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ COMPONENT LargeWorlds ) + ## LandscapeCanvas ## ly_add_pytest( NAME AutomatedTesting::LandscapeCanvasTests_Main TEST_SERIAL TEST_SUITE main - PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/test_LandscapeCanvas_Main.py + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -143,7 +144,20 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ NAME AutomatedTesting::LandscapeCanvasTests_Periodic TEST_SERIAL TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/test_LandscapeCanvas_Periodic.py + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Periodic.py + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::LandscapeCanvasTests_Main_Optimized + TEST_SERIAL + TEST_SUITE main + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas/TestSuite_Main_Optimized.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor @@ -153,11 +167,25 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_ ) ## GradientSignal ## + ly_add_pytest( NAME AutomatedTesting::GradientSignalTests_Periodic TEST_SERIAL TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/test_GradientSignal_Periodic.py + PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic.py + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::GradientSignalTests_Periodic_Optimized + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal/TestSuite_Periodic_Optimized.py RUNTIME_DEPENDENCIES AZ::AssetProcessor Legacy::Editor diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSignal_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSignal_Periodic.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic.py diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSignal_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSignal_Periodic_Optimized.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/TestSuite_Periodic_Optimized.py diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py deleted file mode 100755 index ec9fb7cb0b..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientIncompatibilities.py +++ /dev/null @@ -1,103 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - - -""" -Tests that the Gradient Generator components are incompatible with Vegetation Area components -""" - -import os -import pytest -pytest.importorskip('ly_test_tools') - -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - -gradient_generators = [ - 'Altitude Gradient', - 'Constant Gradient', - 'FastNoise Gradient', - 'Image Gradient', - 'Perlin Noise Gradient', - 'Random Noise Gradient', - 'Shape Falloff Gradient', - 'Slope Gradient', - 'Surface Mask Gradient' -] - -gradient_modifiers = [ - 'Dither Gradient Modifier', - 'Gradient Mixer', - 'Invert Gradient Modifier', - 'Levels Gradient Modifier', - 'Posterize Gradient Modifier', - 'Smooth-Step Gradient Modifier', - 'Threshold Gradient Modifier' -] - -vegetation_areas = [ - 'Vegetation Layer Spawner', - 'Vegetation Layer Blender', - 'Vegetation Layer Blocker', - 'Vegetation Layer Blocker (Mesh)' -] - -all_gradients = gradient_modifiers + gradient_generators - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientIncompatibilities(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - @pytest.mark.test_case_id('C2691648', 'C2691649', 'C2691650', 'C2691651', - 'C2691653', 'C2691656', 'C2691657', 'C2691658', - 'C2691647', 'C2691655') - @pytest.mark.SUITE_periodic - def test_GradientGenerators_Incompatibilities(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [] - for gradient_generator in gradient_generators: - for vegetation_area in vegetation_areas: - expected_lines.append(f"{gradient_generator} is disabled before removing {vegetation_area} component") - expected_lines.append(f"{gradient_generator} is enabled after removing {vegetation_area} component") - expected_lines.append("GradientGeneratorIncompatibilities: result=SUCCESS") - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientGenerators_Incompatibilities.py', - expected_lines=expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C3416464', 'C3416546', 'C3961318', 'C3961319', - 'C3961323', 'C3961324', 'C3980656', 'C3980657', - 'C3980661', 'C3980662', 'C3980666', 'C3980667', - 'C2691652') - @pytest.mark.SUITE_periodic - def test_GradientModifiers_Incompatibilities(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [] - for gradient_modifier in gradient_modifiers: - for vegetation_area in vegetation_areas: - expected_lines.append(f"{gradient_modifier} is disabled before removing {vegetation_area} component") - expected_lines.append(f"{gradient_modifier} is enabled after removing {vegetation_area} component") - - for conflicting_gradient in all_gradients: - expected_lines.append(f"{gradient_modifier} is disabled before removing {conflicting_gradient} component") - expected_lines.append(f"{gradient_modifier} is enabled after removing {conflicting_gradient} component") - expected_lines.append("GradientModifiersIncompatibilities: result=SUCCESS") - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientModifiers_Incompatibilities.py', - expected_lines=expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py deleted file mode 100755 index f41dd605e6..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientPreviewSettings.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientPreviewSettings(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C3980668', 'C2676825', 'C2676828', 'C2676822', 'C3416547', 'C3961320', 'C3961325', - 'C3980658', 'C3980663') - @pytest.mark.SUITE_periodic - def test_GradientPreviewSettings_DefaultPinnedEntityIsSelf(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Perlin Noise Gradient has Preview pinned to own Entity result: SUCCESS", - "Random Noise Gradient has Preview pinned to own Entity result: SUCCESS", - "FastNoise Gradient has Preview pinned to own Entity result: SUCCESS", - "Dither Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Invert Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Levels Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Posterize Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Smooth-Step Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "Threshold Gradient Modifier has Preview pinned to own Entity result: SUCCESS", - "GradientPreviewSettings_DefaultPinnedEntity: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientPreviewSettings_DefaultPinnedEntityIsSelf.py", - expected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C2676829", "C3961326", "C3980659", "C3980664", "C3980669", "C3416548", "C2676823", - "C3961321", "C2676826") - @pytest.mark.SUITE_periodic - def test_GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin(self, request, editor, level, - launcher_platform): - - expected_lines = [ - "Random Noise Gradient entity Created", - "Entity has a Random Noise Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "Random Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS", - "Random Noise Gradient --- Preview Position set to world origin", - "Random Noise Gradient --- Preview Size set to (1, 1, 1)", - "Levels Gradient Modifier entity Created", - "Entity has a Levels Gradient Modifier component", - "Levels Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Levels Gradient Modifier --- Preview Position set to world origin", - "Posterize Gradient Modifier entity Created", - "Entity has a Posterize Gradient Modifier component", - "Posterize Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Posterize Gradient Modifier --- Preview Position set to world origin", - "Smooth-Step Gradient Modifier entity Created", - "Entity has a Smooth-Step Gradient Modifier component", - "Smooth-Step Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Smooth-Step Gradient Modifier --- Preview Position set to world origin", - "Threshold Gradient Modifier entity Created", - "Entity has a Threshold Gradient Modifier component", - "Threshold Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Threshold Gradient Modifier --- Preview Position set to world origin", - "FastNoise Gradient entity Created", - "Entity has a FastNoise Gradient component", - "FastNoise Gradient Preview Settings|Pin Preview to Shape: SUCCESS", - "FastNoise Gradient --- Preview Position set to world origin", - "FastNoise Gradient --- Preview Size set to (1, 1, 1)", - "Dither Gradient Modifier entity Created", - "Entity has a Dither Gradient Modifier component", - "Dither Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Dither Gradient Modifier --- Preview Position set to world origin", - "Dither Gradient Modifier --- Preview Size set to (1, 1, 1)", - "Invert Gradient Modifier entity Created", - "Entity has a Invert Gradient Modifier component", - "Invert Gradient Modifier Preview Settings|Pin Preview to Shape: SUCCESS", - "Invert Gradient Modifier --- Preview Position set to world origin", - "Perlin Noise Gradient entity Created", - "Entity has a Perlin Noise Gradient component", - "Perlin Noise Gradient Preview Settings|Pin Preview to Shape: SUCCESS", - "Perlin Noise Gradient --- Preview Position set to world origin", - "Perlin Noise Gradient --- Preview Size set to (1, 1, 1)", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py", - expected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py deleted file mode 100755 index 099a9404e1..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSampling.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import logging - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -logger = logging.getLogger(__name__) -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientSampling(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C3526311") - @pytest.mark.SUITE_periodic - def test_GradientSampling_GradientReferencesAddRemoveSuccessfully(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Entity has a Random Noise Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "Entity has a Dither Gradient Modifier component", - "Gradient Generator is pinned to the Dither Gradient Modifier successfully", - "Gradient Generator is cleared from the Dither Gradient Modifier successfully", - "Entity has a Invert Gradient Modifier component", - "Gradient Generator is pinned to the Invert Gradient Modifier successfully", - "Gradient Generator is cleared from the Invert Gradient Modifier successfully", - "Entity has a Levels Gradient Modifier component", - "Gradient Generator is pinned to the Levels Gradient Modifier successfully", - "Gradient Generator is cleared from the Levels Gradient Modifier successfully", - "Entity has a Posterize Gradient Modifier component", - "Gradient Generator is pinned to the Posterize Gradient Modifier successfully", - "Gradient Generator is cleared from the Posterize Gradient Modifier successfully", - "Entity has a Smooth-Step Gradient Modifier component", - "Gradient Generator is pinned to the Smooth-Step Gradient Modifier successfully", - "Gradient Generator is cleared from the Smooth-Step Gradient Modifier successfully", - "Entity has a Threshold Gradient Modifier component", - "Gradient Generator is pinned to the Threshold Gradient Modifier successfully", - "Gradient Generator is cleared from the Threshold Gradient Modifier successfully", - ] - - unexpected_lines = [ - "Failed to pin Gradient Generator to the Dither Gradient Modifier", - "Failed to clear Gradient Generator from the Dither Gradient Modifier", - "Failed to pin Gradient Generator to the Invert Gradient Modifier", - "Failed to clear Gradient Generator from the Invert Gradient Modifier", - "Failed to pin Gradient Generator to the Levels Gradient Modifier", - "Failed to clear Gradient Generator from the Levels Gradient Modifier", - "Failed to pin Gradient Generator to the Posterize Gradient Modifier", - "Failed to clear Gradient Generator from the Posterize Gradient Modifier", - "Failed to pin Gradient Generator to the Smooth-Step Gradient Modifier", - "Failed to clear Gradient Generator from the Smooth-Step Gradient Modifier", - "Failed to pin Gradient Generator to the Threshold Gradient Modifier", - "Failed to clear Gradient Generator from the Threshold Gradient Modifier", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientSampling_GradientReferencesAddRemoveSuccessfully.py", - expected_lines, - unexpected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py deleted file mode 100755 index 6d4a832875..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientSurfaceTagEmitter.py +++ /dev/null @@ -1,116 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest -import logging - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -logger = logging.getLogger(__name__) -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") - - -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["tmp_level"]) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientSurfaceTagEmitter(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - # Cleanup temp level before and after test runs - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id("C3297302") - @pytest.mark.SUITE_periodic - def test_GradientSurfaceTagEmitter_ComponentDependencies(self, request, editor, level, workspace, - launcher_platform): - cfg_args = [level] - - expected_lines = [ - "GradientSurfaceTagEmitter_ComponentDependencies: test started", - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are enabled", - "GradientSurfaceTagEmitter_ComponentDependencies: result=SUCCESS", - ] - - unexpected_lines = [ - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Surface Tag Emitter is Enabled, but should be Disabled without dependencies met", - "GradientSurfaceTagEmitter_ComponentDependencies: Dither Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Gradient Mixer and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Invert Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Levels Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Posterize Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Smooth-Step Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Threshold Gradient Modifier and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Altitude Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Constant Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: FastNoise Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Image Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Perlin Noise Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Random Noise Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Reference Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Shape Falloff Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Slope Gradient and Gradient Surface Tag Emitter are disabled", - "GradientSurfaceTagEmitter_ComponentDependencies: Surface Mask Gradient and Gradient Surface Tag Emitter are disabled", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientSurfaceTagEmitter_ComponentDependencies.py", - expected_lines=expected_lines, - unexpected_lines=unexpected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C3297303") - @pytest.mark.SUITE_periodic - def test_GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully(self, request, editor, level, - launcher_platform): - - expected_lines = [ - "Entity has a Gradient Surface Tag Emitter component", - "Entity has a Reference Gradient component", - "Added SurfaceTag: container count is 1", - "Removed SurfaceTag: container count is 0", - "GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSucessfully: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientSurfaceTagEmitter_SurfaceTagsAddRemoveSuccessfully.py", - expected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py deleted file mode 100755 index 447a548abb..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_GradientTransform.py +++ /dev/null @@ -1,157 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - - -""" -Tests that the Gradient Transform Modifier component isn't enabled unless it has a component on -the same Entity that provides the ShapeService (e.g. box shape, or reference shape) -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientTransformRequiresShape(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C3430289') - @pytest.mark.SUITE_periodic - def test_GradientTransform_RequiresShape(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Gradient Transform Modifier component was added to entity, but the component is disabled", - "Gradient Transform component is not active without a Shape component on the Entity", - "Box Shape component was added to entity", - "Gradient Transform Modifier component is active now that the Entity has a Shape", - "GradientTransformRequiresShape: result=SUCCESS" - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_RequiresShape.py", - expected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C3430292") - @pytest.mark.SUITE_periodic - def test_GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Entity Created", - "Entity has a Random Noise Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "Components added to the entity", - "entity Configuration|Frequency Zoom: SUCCESS", - "Frequency Zoom is equal to expected value", - ] - - unexpected_lines = ["Frequency Zoom is not equal to expected value"] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_FrequencyZoomCanBeSetBeyondSliderRange.py", - expected_lines, - unexpected_lines=unexpected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C3430297") - @pytest.mark.SUITE_periodic - def test_GradientTransform_ComponentIncompatibleWithSpawners(self, request, editor, launcher_platform, level): - # C3430297: Component cannot be active on the same Entity as an active Vegetation Layer Spawner - expected_lines = [ - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "New Entity Created", - "Gradient Transform Modifier is Enabled", - "Box Shape is Enabled", - "Entity has a Vegetation Layer Spawner component", - "Vegetation Layer Spawner is incompatible and disabled", - "GradientTransform_ComponentIncompatibleWithSpawners: result=SUCCESS" - ] - - unexpected_lines = [ - "Gradient Transform Modifier is Disabled. But It should be Enabled in an Entity", - "Box Shape is Disabled. But It should be Enabled in an Entity", - "Vegetation Layer Spawner is compatible and enabled. But It should be Incompatible and disabled", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_ComponentIncompatibleWithSpawners.py", - expected_lines, - unexpected_lines, - cfg_args=[level] - ) - - @pytest.mark.test_case_id("C4753767") - @pytest.mark.SUITE_periodic - def test_GradientTransform_ComponentIncompatibleWithExpectedGradients(self, request, editor, launcher_platform, level): - expected_lines = [ - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "New Entity Created", - "Gradient Transform Modifier is Enabled", - "Box Shape is Enabled", - "Entity has a Constant Gradient component", - "Entity has a Altitude Gradient component", - "Entity has a Gradient Mixer component", - "Entity has a Reference Gradient component", - "Entity has a Shape Falloff Gradient component", - "Entity has a Slope Gradient component", - "Entity has a Surface Mask Gradient component", - "All newly added components are incompatible and disabled", - "GradientTransform_ComponentIncompatibleWithExpectedGradients: result=SUCCESS" - ] - - unexpected_lines = [ - "Gradient Transform Modifier is disabled, but it should be enabled", - "Box Shape is disabled, but it should be enabled", - "Constant Gradient is enabled, but should be disabled", - "Altitude Gradient is enabled, but should be disabled", - "Gradient Mixer is enabled, but should be disabled", - "Reference Gradient is enabled, but should be disabled", - "Shape Falloff Gradient is enabled, but should be disabled", - "Slope Gradient is enabled, but should be disabled", - "Surface Mask Gradient component is enabled, but should be disabled", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GradientTransform_ComponentIncompatibleWithExpectedGradients.py", - expected_lines, - unexpected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py deleted file mode 100755 index c4280678ee..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/test_ImageGradient.py +++ /dev/null @@ -1,69 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestImageGradientRequiresShape(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - @pytest.mark.test_case_id('C2707570') - @pytest.mark.SUITE_periodic - def test_ImageGradient_RequiresShape(self, request, editor, level, launcher_platform): - cfg_args = [level] - expected_lines = [ - "Image Gradient component was added to entity, but the component is disabled", - "Gradient Transform Modifier component was added to entity, but the component is disabled", - "Image Gradient component is not active without a Shape component on the Entity", - "Box Shape component was added to entity", - "Image Gradient component is active now that the Entity has a Shape", - "ImageGradientRequiresShape: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'ImageGradient_RequiresShape.py', - expected_lines=expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id("C3829430") - @pytest.mark.SUITE_periodic - def test_ImageGradient_ProcessedImageAssignedSuccessfully(self, request, editor, level, launcher_platform): - - expected_lines = [ - "Image Gradient Entity created", - "Entity has a Image Gradient component", - "Entity has a Gradient Transform Modifier component", - "Entity has a Box Shape component", - "image_grad_test_gsi.png was found in the workspace", - "Entity Configuration|Image Asset: SUCCESS", - "ImageGradient_ProcessedImageAssignedSucessfully: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "ImageGradient_ProcessedImageAssignedSuccessfully.py", - expected_lines, - cfg_args=[level] - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Main.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Main.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Periodic_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py similarity index 92% rename from AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Periodic_Optimized.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py index 59e8b1fe90..8c662a9b45 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Periodic_Optimized.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main_Optimized.py @@ -17,6 +17,12 @@ from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, E @pytest.mark.parametrize("project", ["AutomatedTesting"]) class TestAutomation(EditorTestSuite): + class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest): + from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module + + class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest): + from .EditorScripts import GradientMixer_NodeConstruction as test_module + class test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(EditorSharedTest): from .EditorScripts import AreaNodes_DependentComponentsAdded as test_module @@ -86,4 +92,4 @@ class TestAutomation(EditorTestSuite): from .EditorScripts import ShapeNodes_EntityCreatedOnNodeAdd as test_module class test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(EditorSharedTest): - from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module + from .EditorScripts import ShapeNodes_EntityRemovedOnNodeDelete as test_module \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Periodic.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py similarity index 100% rename from AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Periodic.py rename to AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Periodic.py diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py deleted file mode 100755 index e5736d9db9..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_AreaNodes.py +++ /dev/null @@ -1,125 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13815919 - Appropriate component dependencies are automatically added to node entities -C13767844 - All Vegetation Area nodes can be added to a graph -C17605868 - All Vegetation Area nodes can be removed from a graph -C13815873 - All Filters/Modifiers/Selectors can be added to/removed from a Layer node -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestAreaNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13815919') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_AreaNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "SpawnerAreaNode created new Entity with all required components", - "MeshBlockerAreaNode created new Entity with all required components", - "BlockerAreaNode created new Entity with all required components", - "AreaNodeComponentDependency: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_DependentComponentsAdded.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C13767844') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_AreaNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform): - """ - Verifies all Area nodes can be successfully added to a Landscape Canvas graph, and the proper entity - creation occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AreaBlenderNode created new Entity with Vegetation Layer Blender Component", - "BlockerAreaNode created new Entity with Vegetation Layer Blocker Component", - "MeshBlockerAreaNode created new Entity with Vegetation Layer Blocker (Mesh) Component", - "SpawnerAreaNode created new Entity with Vegetation Layer Spawner Component", - "AreaNodeEntityCreate: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'AreaNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C17605868') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_AreaNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform): - """ - Verifies all Area nodes can be successfully removed from a Landscape Canvas graph, and the proper entity - cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AreaBlenderNode corresponding Entity was deleted when node is removed", - "MeshBlockerAreaNode corresponding Entity was deleted when node is removed", - "SpawnerAreaNode corresponding Entity was deleted when node is removed", - "BlockerAreaNode corresponding Entity was deleted when node is removed", - "AreaNodeEntityDelete: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'AreaNodes_EntityRemovedOnNodeDelete.py', expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C13815873') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_LayerExtenderNodes_ComponentEntitySync(self, request, editor, level, launcher_platform): - """ - Verifies all Area Extender nodes can be successfully added to and removed from a Landscape Canvas graph, and the - proper entity creation/cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AreaBlenderNode successfully added and removed all filters/modifiers/selectors", - "SpawnerAreaNode successfully added and removed all filters/modifiers/selectors", - "LayerExtenderNodeComponentEntitySync: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'LayerExtenderNodes_ComponentEntitySync.py', expected_lines, - cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py deleted file mode 100755 index 7ff110d6b0..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_EditFunctionality.py +++ /dev/null @@ -1,84 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C29278563 - Disabled nodes can be successfully duplicated -C30813586 - Editor remains stable after Undoing deletion of a node on a slice entity -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestEditFunctionality(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C29278563') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_DuplicateDisabledNodes(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "SpawnerAreaNode duplicated with disabled component", - "SpawnerAreaNode duplicated with deleted component", - "MeshBlockerAreaNode duplicated with disabled component", - "MeshBlockerAreaNode duplicated with deleted component", - "BlockerAreaNode duplicated with disabled component", - "BlockerAreaNode duplicated with deleted component", - "FastNoiseGradientNode duplicated with disabled component", - "FastNoiseGradientNode duplicated with deleted component", - "ImageGradientNode duplicated with disabled component", - "ImageGradientNode duplicated with deleted component", - "PerlinNoiseGradientNode duplicated with disabled component", - "PerlinNoiseGradientNode duplicated with deleted component", - "RandomNoiseGradientNode duplicated with disabled component", - "RandomNoiseGradientNode duplicated with deleted component", - "DisabledNodeDuplication: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_DisabledNodeDuplication.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C30813586') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_UndoNodeDelete_SliceEntity(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Vegetation Layer Spawner node found on graph", - "Vegetation Layer Spawner node was removed", - "Editor is still responsive", - "UndoNodeDeleteSlice: result=SUCCESS" - ] - - unexpected_lines = [ - "Vegetation Layer Spawner node not found", - "Vegetation Layer Spawner node was not removed" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'Edit_UndoNodeDelete_SliceEntity.py', - expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py deleted file mode 100644 index 4ab5a41b85..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GeneralGraphFunctionality.py +++ /dev/null @@ -1,173 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C2735988 - Landscape Canvas tool can be opened/closed -C13815862 - New graph can be created -C13767840 - New root entity is created when a new graph is created through Landscape Canvas -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip("ly_test_tools") -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") - - -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -@pytest.mark.parametrize("level", ["tmp_level"]) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGeneralGraphFunctionality(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True) - - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "slices", "TestSlice.slice")], True, True) - - @pytest.mark.test_case_id("C2735988", "C13815862", "C13767840") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_NewGraph_CreatedSuccessfully(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "Root entity has Landscape Canvas component", - "Landscape Canvas pane is closed", - "CreateNewGraph: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "CreateNewGraph.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C2735990") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_Component_AddedRemoved(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas Component added to Entity", - "Landscape Canvas Component removed from Entity", - "LandscapeCanvasComponentAddedRemoved: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "LandscapeCanvasComponent_AddedRemoved.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C14212352") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GraphClosed_OnLevelChange(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "Graph is no longer open in Landscape Canvas", - "GraphClosedOnLevelChange: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GraphClosed_OnLevelChange.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C17488412") - @pytest.mark.SUITE_periodic - @pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2201") - def test_LandscapeCanvas_GraphClosed_OnEntityDelete(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "Graph registered with Landscape Canvas", - "The graph is no longer open after deleting the Entity", - "GraphClosedOnEntityDelete: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GraphClosed_OnEntityDelete.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C15167461") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GraphClosed_TabbedGraphClosesIndependently(self, request, editor, level, - launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "2nd new graph created", - "3rd new graph created", - "Graphs registered with Landscape Canvas", - "Graph 2 was successfully closed", - "GraphClosedTabbedGraph: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "GraphClosed_TabbedGraph.py", - expected_lines, - cfg_args=cfg_args - ) - - @pytest.mark.test_case_id("C22602016") - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_SliceCreateInstantiate(self, request, editor, level, workspace, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "LandscapeCanvas_SliceCreateInstantiate: test started", - "landscape_canvas_entity Entity successfully created", - "LandscapeCanvas_SliceCreateInstantiate: Slice has been created successfully: True", - "LandscapeCanvas_SliceCreateInstantiate: Slice instantiated: True", - "LandscapeCanvas_SliceCreateInstantiate: result=SUCCESS", - ] - - hydra.launch_and_validate_results( - request, - test_directory, - editor, - "LandscapeCanvas_SliceCreateInstantiate.py", - expected_lines=expected_lines, - cfg_args=cfg_args - ) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py deleted file mode 100755 index 99f342a574..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientModifierNodes.py +++ /dev/null @@ -1,92 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13767841 - All Gradient Modifier nodes can be added to a graph -C18055051 - All Gradient Modifier nodes can be removed from a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientModifierNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13767841') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientModifierNodes_EntityCreatedOnNodeAdd(self, request, editor, level, - launcher_platform): - """ - Verifies all Gradient Modifier nodes can be successfully added to a Landscape Canvas graph, and the proper - entity creation occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "DitherGradientModifierNode created new Entity with Dither Gradient Modifier Component", - "GradientMixerNode created new Entity with Gradient Mixer Component", - "InvertGradientModifierNode created new Entity with Invert Gradient Modifier Component", - "LevelsGradientModifierNode created new Entity with Levels Gradient Modifier Component", - "PosterizeGradientModifierNode created new Entity with Posterize Gradient Modifier Component", - "SmoothStepGradientModifierNode created new Entity with Smooth-Step Gradient Modifier Component", - "ThresholdGradientModifierNode created new Entity with Threshold Gradient Modifier Component", - "GradientModifierNodeEntityCreate: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientModifierNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C18055051') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientModifierNodes_EntityRemovedOnNodeDelete(self, request, editor, level, - launcher_platform): - """ - Verifies all Gradient Modifier nodes can be successfully removed from a Landscape Canvas graph, and the proper - entity cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "DitherGradientModifierNode corresponding Entity was deleted when node is removed", - "GradientMixerNode corresponding Entity was deleted when node is removed", - "InvertGradientModifierNode corresponding Entity was deleted when node is removed", - "LevelsGradientModifierNode corresponding Entity was deleted when node is removed", - "PosterizeGradientModifierNode corresponding Entity was deleted when node is removed", - "SmoothStepGradientModifierNode corresponding Entity was deleted when node is removed", - "ThresholdGradientModifierNode corresponding Entity was deleted when node is removed", - "GradientModifierNodeEntityDelete: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'GradientModifierNodes_EntityRemovedOnNodeDelete.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py deleted file mode 100755 index 1fdb254e98..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GradientNodes.py +++ /dev/null @@ -1,109 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13815920 - Appropriate component dependencies are automatically added to node entities -C13767842 - All Gradient nodes can be added to a graph -C17461363 - All Gradient nodes can be removed from a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGradientNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13815920') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientNodes_DependentComponentsAdded(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "FastNoiseGradientNode created new Entity with all required components", - "ImageGradientNode created new Entity with all required components", - "PerlinNoiseGradientNode created new Entity with all required components", - "RandomNoiseGradientNode created new Entity with all required components" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_DependentComponentsAdded.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C13767842') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform): - """ - Verifies all Gradient nodes can be successfully added to a Landscape Canvas graph, and the proper entity - creation occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "AltitudeGradientNode created new Entity with Altitude Gradient Component", - "ConstantGradientNode created new Entity with Constant Gradient Component", - "FastNoiseGradientNode created new Entity with FastNoise Gradient Component", - "ImageGradientNode created new Entity with Image Gradient Component", - "PerlinNoiseGradientNode created new Entity with Perlin Noise Gradient Component", - "RandomNoiseGradientNode created new Entity with Random Noise Gradient Component", - "ShapeAreaFalloffGradientNode created new Entity with Shape Falloff Gradient Component", - "SlopeGradientNode created new Entity with Slope Gradient Component", - "SurfaceMaskGradientNode created new Entity with Surface Mask Gradient Component" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C17461363') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GradientNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform): - """ - Verifies all Gradient nodes can be successfully removed from a Landscape Canvas graph, and the proper entity - cleanup occurs. - """ - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "FastNoiseGradientNode corresponding Entity was deleted when node is removed", - "AltitudeGradientNode corresponding Entity was deleted when node is removed", - "ConstantGradientNode corresponding Entity was deleted when node is removed", - "RandomNoiseGradientNode corresponding Entity was deleted when node is removed", - "ShapeAreaFalloffGradientNode corresponding Entity was deleted when node is removed", - "SlopeGradientNode corresponding Entity was deleted when node is removed", - "PerlinNoiseGradientNode corresponding Entity was deleted when node is removed", - "ImageGradientNode corresponding Entity was deleted when node is removed", - "SurfaceMaskGradientNode corresponding Entity was deleted when node is removed" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientNodes_EntityRemovedOnNodeDelete.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py deleted file mode 100755 index 71389dcf5b..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py +++ /dev/null @@ -1,167 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C4705586 - Altering connections on graph nodes appropriately updates component properties -C22715182 - Components are updated when nodes are added/removed/updated -C22602072 - Graph is updated when underlying components are added/removed -C15987206 - Gradient Mixer Layers are properly setup when constructing in a graph -C21333743 - Vegetation Layer Blenders are properly setup when constructing in a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import ly_test_tools._internal.pytest_plugin as internal_plugin -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestGraphComponentSync(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C4705586') - @pytest.mark.BAT - @pytest.mark.SUITE_main - def test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(self, request, editor, level, launcher_platform): - - # Skip test if running against Debug build - if "debug" in internal_plugin.build_directory: - pytest.skip("Does not execute against debug builds.") - - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "Random Noise Gradient component Preview Entity property set to Box Shape EntityId", - "Dither Gradient Modifier component Inbound Gradient property set to Random Noise Gradient EntityId", - "Gradient Mixer component Inbound Gradient extendable property set to Dither Gradient Modifier EntityId", - "SlotConnectionsUpdateComponents: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, - 'SlotConnections_UpdateComponentReferences.py', expected_lines, - cfg_args=cfg_args) - - @pytest.mark.test_case_id('C22715182') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_GraphUpdates_UpdateComponents(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - 'Rotation Modifier component was removed from entity', - 'BushSpawner entity was deleted', - 'Gradient Entity Id reference was properly updated', - 'GraphUpdatesUpdateComponents: result=SUCCESS' - ] - - unexpected_lines = [ - 'Rotation Modifier component is still present on entity', - 'Failed to delete BushSpawner entity', - 'Gradient Entity Id was not updated properly' - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GraphUpdates_UpdateComponents.py', - expected_lines, unexpected_lines=unexpected_lines, - cfg_args=cfg_args) - - @pytest.mark.test_case_id('C22602072') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_ComponentUpdates_UpdateGraph(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "LandscapeCanvas entity found", - "BushSpawner entity found", - "Vegetation Distribution Filter on BushSpawner entity found", - "Graph opened", - "Distribution Filter node found on graph", - "Vegetation Altitude Filter on BushSpawner entity found", - "Altitude Filter node found on graph", - "Vegetation Distribution Filter removed from BushSpawner entity", - "Distribution Filter node was removed from the graph", - "New entity successfully added as a child of the BushSpawner entity", - "Box Shape on Box entity found", - "Box Shape node found on graph", - 'ComponentUpdatesUpdateGraph: result=SUCCESS' - ] - - unexpected_lines = [ - "Distribution Filter node not found on graph", - "Distribution Filter node is still present on the graph", - "Altitude Filter node not found on graph", - "New entity added with an unexpected parent", - "Box Shape node not found on graph" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'ComponentUpdates_UpdateGraph.py', - expected_lines, unexpected_lines=unexpected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C15987206') - @pytest.mark.SUITE_main - def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, editor, level, launcher_platform): - """ - Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set. - """ - - # Skip test if running against Debug build - if "debug" in internal_plugin.build_directory: - pytest.skip("Does not execute against debug builds.") - - cfg_args = [level] - - expected_lines = [ - 'Landscape Canvas pane is open', - 'New graph created', - 'Graph registered with Landscape Canvas', - 'Perlin Noise Gradient component Preview Entity property set to Box Shape EntityId', - 'Gradient Mixer component Inbound Gradient extendable property set to Perlin Noise Gradient EntityId', - 'Gradient Mixer component Inbound Gradient extendable property set to FastNoise Gradient EntityId', - 'Configuration|Layers|[0]|Operation set to 0', - 'Configuration|Layers|[1]|Operation set to 6', - 'GradientMixerNodeConstruction: result=SUCCESS' - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'GradientMixer_NodeConstruction.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C21333743') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, editor, level, launcher_platform): - """ - Verifies a Layer Blender can be setup in Landscape Canvas and all references are property set. - """ - cfg_args = [level] - - expected_lines = [ - 'Landscape Canvas pane is open', - 'New graph created', - 'Graph registered with Landscape Canvas', - 'Vegetation Layer Blender component Vegetation Areas[0] property set to Vegetation Layer Spawner EntityId', - 'Vegetation Layer Blender component Vegetation Areas[1] property set to Vegetation Layer Blocker EntityId', - 'LayerBlenderNodeConstruction: result=SUCCESS' - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'LayerBlender_NodeConstruction.py', - expected_lines, cfg_args=cfg_args) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Main_Optimized.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Main_Optimized.py deleted file mode 100644 index 68bac24452..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_LandscapeCanvas_Main_Optimized.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -import pytest - -from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest, EditorTestSuite - - -@pytest.mark.SUITE_periodic -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -@pytest.mark.parametrize("project", ["AutomatedTesting"]) -class TestAutomation(EditorTestSuite): - - class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest): - from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module - - class test_LandscapeCanvas_GradientMixer_NodeConstruction(EditorSharedTest): - from .EditorScripts import GradientMixer_NodeConstruction as test_module diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py deleted file mode 100755 index 8356d5a404..0000000000 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_ShapeNodes.py +++ /dev/null @@ -1,82 +0,0 @@ -""" -Copyright (c) Contributors to the Open 3D Engine Project. -For complete copyright and license terms please see the LICENSE at the root of this distribution. - -SPDX-License-Identifier: Apache-2.0 OR MIT -""" - -""" -C13767843 - All Shape nodes can be added to a graph -C17412059 - All Shape nodes can be removed from a graph -""" - -import os -import pytest - -# Bail on the test if ly_test_tools doesn't exist. -pytest.importorskip('ly_test_tools') -import ly_test_tools.environment.file_system as file_system -import editor_python_test_tools.hydra_test_utils as hydra - -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') - - -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('level', ['tmp_level']) -@pytest.mark.usefixtures("automatic_process_killer") -@pytest.mark.parametrize("launcher_platform", ['windows_editor']) -class TestShapeNodes(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, project, level): - def teardown(): - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - request.addfinalizer(teardown) - - file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) - - @pytest.mark.test_case_id('C13767843') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_ShapeNodes_EntityCreatedOnNodeAdd(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "BoxShapeNode created new Entity with Box Shape Component", - "CapsuleShapeNode created new Entity with Capsule Shape Component", - "CompoundShapeNode created new Entity with Compound Shape Component", - "CylinderShapeNode created new Entity with Cylinder Shape Component", - "PolygonPrismShapeNode created new Entity with Polygon Prism Shape Component", - "SphereShapeNode created new Entity with Sphere Shape Component", - "TubeShapeNode created new Entity with Tube Shape Component", - "DiskShapeNode created new Entity with Disk Shape Component", - "ShapeNodeEntityCreate: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityCreatedOnNodeAdd.py', - expected_lines, cfg_args=cfg_args) - - @pytest.mark.test_case_id('C17412059') - @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(self, request, editor, level, launcher_platform): - cfg_args = [level] - - expected_lines = [ - "Landscape Canvas pane is open", - "New graph created", - "Graph registered with Landscape Canvas", - "BoxShapeNode corresponding Entity was deleted when node is removed", - "CapsuleShapeNode corresponding Entity was deleted when node is removed", - "CompoundShapeNode corresponding Entity was deleted when node is removed", - "CylinderShapeNode corresponding Entity was deleted when node is removed", - "PolygonPrismShapeNode corresponding Entity was deleted when node is removed", - "SphereShapeNode corresponding Entity was deleted when node is removed", - "TubeShapeNode corresponding Entity was deleted when node is removed", - "DiskShapeNode corresponding Entity was deleted when node is removed", - "ShapeNodeEntityDelete: result=SUCCESS" - ] - - hydra.launch_and_validate_results(request, test_directory, editor, 'ShapeNodes_EntityRemovedOnNodeDelete.py', - expected_lines, cfg_args=cfg_args) From ae9dd275b44685cbfed45fa8b0e17bc4b0a85e89 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Wed, 25 Aug 2021 16:45:16 -0700 Subject: [PATCH 05/13] Correct default value issue with PacketDispatchResult Signed-off-by: puvvadar --- .../AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h | 4 ++-- .../AzNetworking/UdpTransport/UdpNetworkInterface.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h b/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h index f7ca7f0166..0d097429c0 100644 --- a/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h +++ b/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h @@ -16,9 +16,9 @@ namespace AzNetworking { AZ_ENUM_CLASS(PacketDispatchResult - , Success - , Pending , Failure + , Pending + , Success ); AZ_ENUM_CLASS(PacketFlag diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index c450d27dc8..70fa9258df 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -277,7 +277,7 @@ namespace AzNetworking timeoutItem->UpdateTimeoutTime(startTimeMs); - PacketDispatchResult handledPacket; + PacketDispatchResult handledPacket = PacketDispatchResult::Failure; if (header.GetPacketType() < aznumeric_cast(CorePackets::PacketType::MAX)) { handledPacket = connection->HandleCorePacket(m_connectionListener, header, packetSerializer); From aab06f687f64ca84b10403e7390e20433fc9a737 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 26 Aug 2021 10:01:47 -0700 Subject: [PATCH 06/13] Change PacketDispatchResult Pending to Skipped Signed-off-by: puvvadar --- .../AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja | 2 +- .../AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h | 2 +- .../AzNetworking/UdpTransport/UdpNetworkInterface.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja b/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja index 9767828f3a..c6f1a23402 100644 --- a/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja +++ b/Code/Framework/AzNetworking/AzNetworking/AutoGen/AutoPacketDispatcher_Inline.jinja @@ -13,7 +13,7 @@ namespace {{ xml.attrib['Name'] }} {% if ('HandshakePacket' not in Packet.attrib) or (Packet.attrib['HandshakePacket'] == 'false') %} if (!handler.IsHandshakeComplete()) { - return AzNetworking::PacketDispatchResult::Pending; + return AzNetworking::PacketDispatchResult::Skipped; } {% endif %} diff --git a/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h b/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h index 0d097429c0..4a441f5ed2 100644 --- a/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h +++ b/Code/Framework/AzNetworking/AzNetworking/PacketLayer/IPacketHeader.h @@ -17,7 +17,7 @@ namespace AzNetworking { AZ_ENUM_CLASS(PacketDispatchResult , Failure - , Pending + , Skipped , Success ); diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index 70fa9258df..bf01ece458 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -304,9 +304,9 @@ namespace AzNetworking // If it's not an expected unencrypted type then skip it for now continue; } - else if (handledPacket == PacketDispatchResult::Pending) + else if (handledPacket == PacketDispatchResult::Skipped) { - // If we did not handle due to a handshake pending completion, skip it + // If the result is marked as skipped then do so (i.e. if a handshake is not yet complete) continue; } else if (connection->GetConnectionState() != ConnectionState::Disconnecting) From 0ab59e939f6f9f7b7cdc4d12aa7599b556c67144 Mon Sep 17 00:00:00 2001 From: puvvadar Date: Thu, 26 Aug 2021 12:08:14 -0700 Subject: [PATCH 07/13] Update transport tests for PacketDispatchResult change Signed-off-by: puvvadar --- .../AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp | 4 ++-- .../AzNetworking/Tests/UdpTransport/UdpTransportTests.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp b/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp index ff2360b674..d06aac1a14 100644 --- a/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp +++ b/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp @@ -33,11 +33,11 @@ namespace UnitTest ; } - bool OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer) + PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer) { EXPECT_TRUE((packetHeader.GetPacketType() == static_cast(CorePackets::PacketType::InitiateConnectionPacket)) || (packetHeader.GetPacketType() == static_cast(CorePackets::PacketType::HeartbeatPacket))); - return false; + return PacketDispatchResult::Failure; } void OnPacketLost([[maybe_unused]] IConnection* connection, [[maybe_unused]] PacketId packetId) diff --git a/Code/Framework/AzNetworking/Tests/UdpTransport/UdpTransportTests.cpp b/Code/Framework/AzNetworking/Tests/UdpTransport/UdpTransportTests.cpp index ca8de30db9..9cc3fd4b09 100644 --- a/Code/Framework/AzNetworking/Tests/UdpTransport/UdpTransportTests.cpp +++ b/Code/Framework/AzNetworking/Tests/UdpTransport/UdpTransportTests.cpp @@ -36,11 +36,11 @@ namespace UnitTest ; } - bool OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer) + PacketDispatchResult OnPacketReceived([[maybe_unused]] IConnection* connection, const IPacketHeader& packetHeader, [[maybe_unused]] ISerializer& serializer) { EXPECT_TRUE((packetHeader.GetPacketType() == static_cast(CorePackets::PacketType::InitiateConnectionPacket)) || (packetHeader.GetPacketType() == static_cast(CorePackets::PacketType::HeartbeatPacket))); - return false; + return PacketDispatchResult::Failure; } void OnPacketLost([[maybe_unused]] IConnection* connection, [[maybe_unused]] PacketId packetId) From d590a91fe791a85ab81baf5dd1f4b262ba008c73 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 27 Aug 2021 11:24:05 -0500 Subject: [PATCH 08/13] Implemented helper method of QFileDialog::getSaveFileName to prevent user from saving files with invalid names. Signed-off-by: Chris Galvan --- Code/Editor/TrackView/TrackViewDialog.cpp | 3 +- Code/Editor/TrackView/TrackViewNodes.cpp | 3 +- .../Components/Widgets/FileDialog.cpp | 53 +++++++++++++++++++ .../Components/Widgets/FileDialog.h | 29 ++++++++++ .../AzQtComponents/azqtcomponents_files.cmake | 2 + .../AssetEditor/AssetEditorWidget.cpp | 13 ++--- .../Source/ImageProcessingSystemComponent.cpp | 4 +- .../Code/Source/Util/Util.cpp | 6 +-- .../CreateMaterialDialog.cpp | 6 +-- .../EditorMaterialComponentExporter.cpp | 4 +- .../EMStudioSDK/Source/FileManager.cpp | 39 +++++--------- Gems/LyShine/Code/Editor/EditorWindow.cpp | 4 +- .../Code/Editor/View/Windows/MainWindow.cpp | 4 +- .../Code/Source/EditorWhiteBoxComponent.cpp | 6 +-- 14 files changed, 127 insertions(+), 49 deletions(-) create mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp create mode 100644 Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.h diff --git a/Code/Editor/TrackView/TrackViewDialog.cpp b/Code/Editor/TrackView/TrackViewDialog.cpp index cfaa82fdb4..d70cbad29e 100644 --- a/Code/Editor/TrackView/TrackViewDialog.cpp +++ b/Code/Editor/TrackView/TrackViewDialog.cpp @@ -34,6 +34,7 @@ // AzQtComponents #include +#include // CryCommon #include @@ -2324,7 +2325,7 @@ void CTrackViewDialog::SaveCurrentSequenceToFBX() } } - QString filename = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters); + QString filename = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), selectedSequenceFBXStr, szFilters); if (!filename.isEmpty()) { pExportManager->SetBakedKeysSequenceExport(true); diff --git a/Code/Editor/TrackView/TrackViewNodes.cpp b/Code/Editor/TrackView/TrackViewNodes.cpp index e3b994c488..2a2d584e46 100644 --- a/Code/Editor/TrackView/TrackViewNodes.cpp +++ b/Code/Editor/TrackView/TrackViewNodes.cpp @@ -30,6 +30,7 @@ // AzQtComponents #include +#include // CryCommon #include @@ -1044,7 +1045,7 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point) file = QString::fromUtf8(selectedNodes.GetNode(0)->GetName().c_str()) + QString(".fbx"); } - QString path = QFileDialog::getSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)")); + QString path = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Export Selected Nodes To FBX File"), QString(), tr("FBX Files (*.fbx)")); if (!path.isEmpty()) { diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp new file mode 100644 index 0000000000..cdd6a77094 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#include + +#include +#include + +namespace AzQtComponents +{ + QString FileDialog::GetSaveFileName(QWidget* parent, const QString& caption, const QString& dir, + const QString& filter, QString* selectedFilter, QFileDialog::Options options) + { + bool shouldPromptAgain = false; + QString filePath; + + do + { + // Trigger Qt's save filename dialog + // If filePath isn't empty, it means we are prompting again because the filename was invalid, + // so pass it instead of the directory so the filename is pre-filled in for the user + filePath = QFileDialog::getSaveFileName(parent, caption, (filePath.isEmpty()) ? dir : filePath, filter, selectedFilter, options); + + if (!filePath.isEmpty()) + { + QFileInfo fileInfo(filePath); + QString fileName = fileInfo.fileName(); + + // Check if the filename has any invalid characters + QRegExp validFileNameRegex("^[a-zA-Z0-9_\\-./]*$"); + shouldPromptAgain = !validFileNameRegex.exactMatch(fileName); + + // If the filename had invalid characters, then show a warning message and then we will re-prompt the save filename dialog + if (shouldPromptAgain) + { + QMessageBox::warning(parent, QObject::tr("Invalid filename"), QObject::tr("The filename contains invalid characters\n\n%1").arg(fileName)); + } + } + else + { + // If the filePath is empty, then the user cancelled the dialog so we don't need to prompt again + shouldPromptAgain = false; + } + } while (shouldPromptAgain); + + return filePath; + } +} // namespace AzQtComponents diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.h b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.h new file mode 100644 index 0000000000..6b63404949 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Contributors to the Open 3D Engine Project. + * For complete copyright and license terms please see the LICENSE at the root of this distribution. + * + * SPDX-License-Identifier: Apache-2.0 OR MIT + * + */ + +#pragma once + +#include + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace AzQtComponents +{ + class AZ_QT_COMPONENTS_API FileDialog + { + public: + //! Helper method that extends QFileDialog::getSaveFileName to prevent the user from + //! saving a filename with invalid characters (e.g. AP doesn't allow @ characters because they are used for aliases) + static QString GetSaveFileName(QWidget* parent = nullptr, const QString& caption = QString(), + const QString& dir = QString(), const QString& filter = QString(), + QString* selectedFilter = nullptr, QFileDialog::Options options = QFileDialog::Options()); + }; + +} // namespace AzQtComponents diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake index af1a3a9f56..c214b81405 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake +++ b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake @@ -146,6 +146,8 @@ set(FILES Components/Widgets/Eyedropper.h Components/Widgets/Eyedropper.cpp Components/Widgets/EyedropperConfig.ini + Components/Widgets/FileDialog.cpp + Components/Widgets/FileDialog.h Components/Widgets/FilteredSearchWidget.qss Components/Widgets/FilteredSearchWidgetConfig.ini Components/Widgets/GradientSlider.cpp diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp index 7198ed1be8..e155189a99 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp @@ -37,6 +37,10 @@ AZ_POP_DISABLE_WARNING #include #include +#include + +#include + #include #include @@ -46,9 +50,6 @@ AZ_POP_DISABLE_WARNING #include #include #include -AZ_PUSH_DISABLE_WARNING(4251, "-Wunknown-warning-option") // 'QFileInfo::d_ptr': class 'QSharedDataPointer' needs to have dll-interface to be used by clients of class 'QFileInfo' -#include -AZ_POP_DISABLE_WARNING #include namespace AzToolsFramework @@ -414,7 +415,7 @@ namespace AzToolsFramework filter.append(")"); } - const QString saveAs = QFileDialog::getSaveFileName(nullptr, tr("Save As..."), m_userSettings->m_lastSavePath.c_str(), filter); + const QString saveAs = AzQtComponents::FileDialog::GetSaveFileName(AzToolsFramework::GetActiveWindow(), tr("Save As..."), m_userSettings->m_lastSavePath.c_str(), filter); return SaveImpl(asset, saveAs); } @@ -902,7 +903,7 @@ namespace AzToolsFramework statusString = QString("%1"); } - statusString = statusString.arg(m_currentAsset).arg(m_queuedAssetStatus); + statusString = statusString.arg(m_currentAsset); if (!m_queuedAssetStatus.isEmpty()) { @@ -920,7 +921,7 @@ namespace AzToolsFramework void AssetEditorWidget::SetupHeader() { - QString nameString = QString("%1").arg(m_currentAsset).arg(m_queuedAssetStatus); + QString nameString = QString("%1").arg(m_currentAsset); m_header->setName(nameString); diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessingSystemComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessingSystemComponent.cpp index 0436ef0215..665d08b3ae 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessingSystemComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageProcessingSystemComponent.cpp @@ -17,6 +17,8 @@ #include #include +#include + #include #include #include @@ -202,7 +204,7 @@ namespace ImageProcessingAtom AZ::Data::AssetId assetId = product->GetAssetId(); menu->addAction("Save as DDS...", [assetId, this]() { - QString filePath = QFileDialog::getSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)")); + QString filePath = AzQtComponents::FileDialog::GetSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)")); if (filePath.isEmpty()) { return; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp index ba913e317b..be112345a9 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Util/Util.cpp @@ -11,13 +11,13 @@ #include #include #include +#include #include #include #include AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT #include -#include #include #include AZ_POP_DISABLE_WARNING @@ -29,7 +29,7 @@ namespace AtomToolsFramework const QFileInfo initialFileInfo(initialPath); const QString initialExt(initialFileInfo.completeSuffix()); - const QFileInfo selectedFileInfo(QFileDialog::getSaveFileName( + const QFileInfo selectedFileInfo(AzQtComponents::FileDialog::GetSaveFileName( QApplication::activeWindow(), "Save File", initialFileInfo.absolutePath() + @@ -104,7 +104,7 @@ namespace AtomToolsFramework const QFileInfo initialFileInfo(initialPath); const QString initialExt(initialFileInfo.completeSuffix()); - const QFileInfo duplicateFileInfo(QFileDialog::getSaveFileName( + const QFileInfo duplicateFileInfo(AzQtComponents::FileDialog::GetSaveFileName( QApplication::activeWindow(), "Duplicate File", GetUniqueFileInfo(initialPath).absoluteFilePath(), diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp index 608122b77a..f27a08b08d 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp @@ -11,6 +11,8 @@ #include #include +#include + #include #include @@ -19,8 +21,6 @@ #include -#include - namespace MaterialEditor { CreateMaterialDialog::CreateMaterialDialog(QWidget* parent) @@ -95,7 +95,7 @@ namespace MaterialEditor //When the file selection button is pressed, open a file dialog to select where the material will be saved QObject::connect(m_ui->m_materialFilePicker, &AzQtComponents::BrowseEdit::attachedButtonTriggered, m_ui->m_materialFilePicker, [this]() { - QFileInfo fileInfo = QFileDialog::getSaveFileName(this, + QFileInfo fileInfo = AzQtComponents::FileDialog::GetSaveFileName(this, QString("Select Material Filename"), m_materialFileInfo.absoluteFilePath(), QString("Material (*.material)")); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp index 32a36392a4..f55da28fa6 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentExporter.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -22,7 +23,6 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin #include #include #include -#include #include #include #include @@ -145,7 +145,7 @@ namespace AZ // Whenever the browse button is clicked, open a save file dialog in the same location as the current export file setting QObject::connect(materialFileWidget, &AzQtComponents::BrowseEdit::attachedButtonTriggered, materialFileWidget, [&dialog, &exportItem, materialFileWidget, overwriteCheckBox]() { - QFileInfo fileInfo = QFileDialog::getSaveFileName(&dialog, + QFileInfo fileInfo = AzQtComponents::FileDialog::GetSaveFileName(&dialog, QString("Select Material Filename"), exportItem.GetExportPath().c_str(), QString("Material (*.material)"), diff --git a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/FileManager.cpp b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/FileManager.cpp index 5a89729e49..129d005f80 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/FileManager.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Tools/EMotionStudio/EMStudioSDK/Source/FileManager.cpp @@ -9,7 +9,6 @@ #include "FileManager.h" #include #include -#include #include #include #include @@ -36,6 +35,8 @@ #include #include +#include + #include #include #include @@ -412,14 +413,12 @@ namespace EMStudio { GetManager()->SetAvoidRendering(true); - QFileDialog::Options options; QString selectedFilter; - const AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent + const AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent "Save", // caption GetLastUsedFolder(m_lastActorFolder), // directory "EMotion FX Actor Files (*.actor)", - &selectedFilter, - options).toUtf8().data(); + &selectedFilter).toUtf8().data(); GetManager()->SetAvoidRendering(false); @@ -471,14 +470,12 @@ namespace EMStudio { GetManager()->SetAvoidRendering(true); - QFileDialog::Options options; QString selectedFilter; - AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent + AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent "Save", // caption GetLastUsedFolder(m_lastWorkspaceFolder), // directory "EMotionFX Editor Workspace Files (*.emfxworkspace)", - &selectedFilter, - options).toUtf8().data(); + &selectedFilter).toUtf8().data(); GetManager()->SetAvoidRendering(false); @@ -553,14 +550,12 @@ namespace EMStudio { GetManager()->SetAvoidRendering(true); - QFileDialog::Options options; QString selectedFilter; - AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent + AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent "Save", // caption GetLastUsedFolder(m_lastMotionSetFolder), // directory "EMotion FX Motion Set Files (*.motionset)", - &selectedFilter, - options).toUtf8().data(); + &selectedFilter).toUtf8().data(); GetManager()->SetAvoidRendering(false); @@ -632,14 +627,12 @@ namespace EMStudio { GetManager()->SetAvoidRendering(true); - QFileDialog::Options options; QString selectedFilter; - AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent + AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent "Save", // caption GetLastUsedFolder(m_lastAnimGraphFolder), // directory "EMotion FX Anim Graph Files (*.animgraph);;All Files (*)", - &selectedFilter, - options).toUtf8().data(); + &selectedFilter).toUtf8().data(); GetManager()->SetAvoidRendering(false); @@ -675,14 +668,12 @@ namespace EMStudio { GetManager()->SetAvoidRendering(true); - QFileDialog::Options options; QString selectedFilter; - const AZStd::string filename = QFileDialog::getSaveFileName(parent, // parent + const AZStd::string filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent "Save", // caption GetLastUsedFolder(m_lastNodeMapFolder), // directory "Node Map Files (*.nodeMap);;All Files (*)", - &selectedFilter, - options).toUtf8().data(); + &selectedFilter).toUtf8().data(); GetManager()->SetAvoidRendering(false); @@ -737,14 +728,12 @@ namespace EMStudio GetManager()->SetAvoidRendering(true); - QFileDialog::Options options; QString selectedFilter; - QString filename = QFileDialog::getSaveFileName(parent, // parent + QString filename = AzQtComponents::FileDialog::GetSaveFileName(parent, // parent "Save", // caption dir.c_str(), // directory "EMotion FX Blend Config Files (*.cfg);;All Files (*)", - &selectedFilter, - options); + &selectedFilter); GetManager()->SetAvoidRendering(false); diff --git a/Gems/LyShine/Code/Editor/EditorWindow.cpp b/Gems/LyShine/Code/Editor/EditorWindow.cpp index 5ae1eb44b9..663570bbf0 100644 --- a/Gems/LyShine/Code/Editor/EditorWindow.cpp +++ b/Gems/LyShine/Code/Editor/EditorWindow.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #define UICANVASEDITOR_SETTINGS_EDIT_MODE_STATE_KEY (QString("Edit Mode State") + " " + FileHelpers::GetAbsoluteGameDir()) #define UICANVASEDITOR_SETTINGS_EDIT_MODE_GEOM_KEY (QString("Edit Mode Geometry") + " " + FileHelpers::GetAbsoluteGameDir()) @@ -706,7 +706,7 @@ bool EditorWindow::SaveCanvasToXml(UiCanvasMetadata& canvasMetadata, bool forceA dir.append(canvasMetadata.m_canvasDisplayName.c_str()); } - QString filename = QFileDialog::getSaveFileName(nullptr, + QString filename = AzQtComponents::FileDialog::GetSaveFileName(nullptr, QString(), dir, "*." UICANVASEDITOR_CANVAS_EXTENSION, diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index f4241e3545..fbe03ffc0a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -91,6 +90,7 @@ #include #include +#include #include #include @@ -1868,7 +1868,7 @@ namespace ScriptCanvasEditor while (!isValidFileName) { - selectedFile = QFileDialog::getSaveFileName(this, tr("Save As..."), suggestedFilename.data(), filter); + selectedFile = AzQtComponents::FileDialog::GetSaveFileName(this, tr("Save As..."), suggestedFilename.data(), filter); // If the selected file is empty that means we just cancelled. // So we want to break out. diff --git a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp index 61796bde58..f18b69393c 100644 --- a/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp +++ b/Gems/WhiteBox/Code/Source/EditorWhiteBoxComponent.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -513,7 +513,7 @@ namespace WhiteBox WhiteBoxPathAtProjectRoot(GetEntity()->GetName(), ObjExtension); const QString fileFilter = AZStd::string::format("*.%s", ObjExtension).c_str(); - const QString absoluteSaveFilePath = QFileDialog::getSaveFileName( + const QString absoluteSaveFilePath = AzQtComponents::FileDialog::GetSaveFileName( nullptr, "Save As...", QString(initialAbsolutePathToExport.c_str()), fileFilter); const auto absoluteSaveFilePathUtf8 = absoluteSaveFilePath.toUtf8(); @@ -577,7 +577,7 @@ namespace WhiteBox { const QString fileFilter = AZStd::string::format("*.%s", Pipeline::WhiteBoxMeshAssetHandler::AssetFileExtension).c_str(); - const QString absolutePath = QFileDialog::getSaveFileName( + const QString absolutePath = AzQtComponents::FileDialog::GetSaveFileName( nullptr, "Save As Asset...", QString(initialAbsolutePath.c_str()), fileFilter); return AZStd::string(absolutePath.toUtf8()); From 4a33f1187ab15a480975c9c1a0c62f2cc7e55e26 Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Fri, 27 Aug 2021 12:27:51 -0500 Subject: [PATCH 09/13] Re-saved instance_counter script canvas asset Signed-off-by: jckand-amzn --- .../instance_counter.scriptcanvas | 2027 +++++++---------- 1 file changed, 786 insertions(+), 1241 deletions(-) diff --git a/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas b/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas index 0ccd364da5..0e5524273c 100644 --- a/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas +++ b/AutomatedTesting/ScriptCanvas/instance_counter.scriptcanvas @@ -1,1241 +1,786 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "ScriptCanvasData", + "ClassData": { + "m_scriptCanvas": { + "Id": { + "id": 3744110453276 + }, + "Name": "instance_counter", + "Components": { + "Component_[12097559167852379075]": { + "$type": "EditorGraphVariableManagerComponent", + "Id": 12097559167852379075 + }, + "Component_[2729072015511887582]": { + "$type": "{4D755CA9-AB92-462C-B24F-0B3376F19967} Graph", + "Id": 2729072015511887582, + "m_graphData": { + "m_nodes": [ + { + "Id": { + "id": 3752700387868 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[10726023654468379779]": { + "$type": "Print", + "Id": 10726023654468379779, + "Slots": [ + { + "id": { + "m_id": "{14259C44-C324-4F72-93E7-FA49B061F2C7}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + }, + "DynamicTypeOverride": 3, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Value", + "toolTip": "Value which replaces instances of {Value} in the resulting string.", + "DisplayDataType": { + "m_type": 3 + }, + "DisplayGroup": { + "Value": 1015031923 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{BDE3D585-DDD2-4B5E-AB8E-738F07B89A00}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 0.0, + "label": "Value" + } + ], + "m_format": "Instances found in area = {Value}", + "m_numericPrecision": 0, + "m_arrayBindingMap": [ + { + "Key": 1, + "Value": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + } + } + ], + "m_unresolvedString": [ + "Instances found in area = ", + {} + ], + "m_formatSlotMap": { + "Value": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + } + } + } + } + }, + { + "Id": { + "id": 3756995355164 + }, + "Name": "SC-Node(Start)", + "Components": { + "Component_[1402832180862211598]": { + "$type": "Start", + "Id": 1402832180862211598, + "Slots": [ + { + "id": { + "m_id": "{66363B00-927B-4B9C-AF21-C9DDC4BA528D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "toolTip": "Signaled when the entity that owns this graph is fully activated.", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ] + } + } + }, + { + "Id": { + "id": 3765585289756 + }, + "Name": "SC-Node(GetAreaProductCount)", + "Components": { + "Component_[14710093371558461612]": { + "$type": "{E42861BD-1956-45AE-8DD7-CCFC1E3E5ACF} Method", + "Id": 14710093371558461612, + "Slots": [ + { + "id": { + "m_id": "{32D2E25A-834E-48FE-B868-7AB5D78D3A3B}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "EntityID: 0", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{9D282D11-1630-4247-BCA7-001953C7AAEA}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DDBA739C-F8A3-4307-8BEF-494B499DA0DC}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{64B972F8-C880-4BB2-8482-E5F0FDBB692D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Result: Number", + "DisplayDataType": { + "m_type": 3 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 2 + }, + "DataType": 1 + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 1 + }, + "isNullPointer": false, + "$type": "EntityId", + "value": { + "id": 2901262558 + }, + "label": "Source" + } + ], + "methodType": 0, + "methodName": "GetAreaProductCount", + "className": "VegetationSpawnerRequestBus", + "resultSlotIDs": [ + {} + ], + "prettyClassName": "VegetationSpawnerRequestBus" + } + } + }, + { + "Id": { + "id": 3748405420572 + }, + "Name": "SC-Node(TimeDelayNodeableNode)", + "Components": { + "Component_[4183258099933897606]": { + "$type": "TimeDelayNodeableNode", + "Id": 4183258099933897606, + "Slots": [ + { + "id": { + "m_id": "{5B850958-5026-4659-B6C7-0EB4E55205E6}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{DB2A2300-A20D-4DB7-A31B-F4F1B040BB62}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + }, + null + ], + "slotName": "Delay", + "toolTip": "The amount of time to delay before the Done is signalled.", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 1, + "SlotType": 2 + }, + "DataType": 1 + }, + { + "id": { + "m_id": "{27714BA0-DFD3-4813-94BF-12B0ADF2B89F}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "On Start", + "DisplayGroup": { + "Value": 2675529103 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{34BAE377-8B62-4E33-B9AB-0819643950A1}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Done", + "toolTip": "Signaled after waiting for the specified amount of times.", + "DisplayGroup": { + "Value": 271442091 + }, + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + }, + "IsLatent": true + } + ], + "Datums": [ + { + "isOverloadedStorage": false, + "scriptCanvasType": { + "m_type": 3 + }, + "isNullPointer": false, + "$type": "double", + "value": 5.0, + "label": "Delay" + } + ], + "nodeable": { + "m_timeUnits": 2 + }, + "slotExecutionMap": { + "ins": [ + { + "_slotId": { + "m_id": "{5B850958-5026-4659-B6C7-0EB4E55205E6}" + }, + "_inputs": [ + { + "_slotId": { + "m_id": "{DB2A2300-A20D-4DB7-A31B-F4F1B040BB62}" + } + } + ], + "_outs": [ + { + "_slotId": { + "m_id": "{27714BA0-DFD3-4813-94BF-12B0ADF2B89F}" + }, + "_name": "On Start", + "_interfaceSourceId": "{00E45DAC-D501-0000-A050-B80244000000}" + } + ], + "_interfaceSourceId": "{9CCBADAB-917D-0000-0400-000000000000}" + } + ], + "latents": [ + { + "_slotId": { + "m_id": "{34BAE377-8B62-4E33-B9AB-0819643950A1}" + }, + "_name": "Done", + "_interfaceSourceId": "{9CCBADAB-917D-0000-0400-000000000000}" + } + ] + } + } + } + }, + { + "Id": { + "id": 3761290322460 + }, + "Name": "SC-Node(Print)", + "Components": { + "Component_[6291714103869491290]": { + "$type": "Print", + "Id": 6291714103869491290, + "Slots": [ + { + "id": { + "m_id": "{69A4391E-F7BE-4E2E-8FED-474227D660F3}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "In", + "toolTip": "Input signal", + "Descriptor": { + "ConnectionType": 1, + "SlotType": 1 + } + }, + { + "id": { + "m_id": "{5D263368-0096-424D-ACEE-1D658417E00D}" + }, + "contracts": [ + { + "$type": "SlotTypeContract" + } + ], + "slotName": "Out", + "Descriptor": { + "ConnectionType": 2, + "SlotType": 1 + } + } + ], + "m_format": "Delaying for 5 seconds", + "m_unresolvedString": [ + "Delaying for 5 seconds" + ] + } + } + } + ], + "m_connections": [ + { + "Id": { + "id": 3769880257052 + }, + "Name": "srcEndpoint=(On Graph Start: Out), destEndpoint=(TimeDelay: Start)", + "Components": { + "Component_[17168700535869642649]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17168700535869642649, + "sourceEndpoint": { + "nodeId": { + "id": 3756995355164 + }, + "slotId": { + "m_id": "{66363B00-927B-4B9C-AF21-C9DDC4BA528D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3748405420572 + }, + "slotId": { + "m_id": "{5B850958-5026-4659-B6C7-0EB4E55205E6}" + } + } + } + } + }, + { + "Id": { + "id": 3774175224348 + }, + "Name": "srcEndpoint=(TimeDelay: On Start), destEndpoint=(Print: In)", + "Components": { + "Component_[447639101916656835]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 447639101916656835, + "sourceEndpoint": { + "nodeId": { + "id": 3748405420572 + }, + "slotId": { + "m_id": "{27714BA0-DFD3-4813-94BF-12B0ADF2B89F}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3761290322460 + }, + "slotId": { + "m_id": "{69A4391E-F7BE-4E2E-8FED-474227D660F3}" + } + } + } + } + }, + { + "Id": { + "id": 3778470191644 + }, + "Name": "srcEndpoint=(TimeDelay: Done), destEndpoint=(GetAreaProductCount: In)", + "Components": { + "Component_[13322673526483611656]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 13322673526483611656, + "sourceEndpoint": { + "nodeId": { + "id": 3748405420572 + }, + "slotId": { + "m_id": "{34BAE377-8B62-4E33-B9AB-0819643950A1}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3765585289756 + }, + "slotId": { + "m_id": "{9D282D11-1630-4247-BCA7-001953C7AAEA}" + } + } + } + } + }, + { + "Id": { + "id": 3782765158940 + }, + "Name": "srcEndpoint=(GetAreaProductCount: Result: Number), destEndpoint=(Print: Value)", + "Components": { + "Component_[17896973599438945144]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 17896973599438945144, + "sourceEndpoint": { + "nodeId": { + "id": 3765585289756 + }, + "slotId": { + "m_id": "{64B972F8-C880-4BB2-8482-E5F0FDBB692D}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3752700387868 + }, + "slotId": { + "m_id": "{4DE18FB9-E6F3-47B2-B721-AE0A35FC9C5F}" + } + } + } + } + }, + { + "Id": { + "id": 3787060126236 + }, + "Name": "srcEndpoint=(GetAreaProductCount: Out), destEndpoint=(Print: In)", + "Components": { + "Component_[3309014461387913721]": { + "$type": "{64CA5016-E803-4AC4-9A36-BDA2C890C6EB} Connection", + "Id": 3309014461387913721, + "sourceEndpoint": { + "nodeId": { + "id": 3765585289756 + }, + "slotId": { + "m_id": "{DDBA739C-F8A3-4307-8BEF-494B499DA0DC}" + } + }, + "targetEndpoint": { + "nodeId": { + "id": 3752700387868 + }, + "slotId": { + "m_id": "{14259C44-C324-4F72-93E7-FA49B061F2C7}" + } + } + } + } + } + ] + }, + "m_assetType": "{3E2AC8CD-713F-453E-967F-29517F331784}", + "versionData": { + "_grammarVersion": 1, + "_runtimeVersion": 1 + }, + "GraphCanvasData": [ + { + "Key": { + "id": 3744110453276 + }, + "Value": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.9218543514249998, + "AnchorX": 50.98419189453125, + "AnchorY": -272.27728271484375 + } + } + } + } + }, + { + "Key": { + "id": 3748405420572 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 380.0, + 20.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{DB8CFC70-AD18-45D5-8C6C-A39648059134}" + } + } + } + }, + { + "Key": { + "id": 3752700387868 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 1220.0, + 180.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{1811B851-23B5-43C8-B654-9822174090CC}" + } + } + } + }, + { + "Key": { + "id": 3756995355164 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TimeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 160.0, + 60.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{483C126F-701F-492F-8375-15B40F8D0178}" + } + } + } + }, + { + "Key": { + "id": 3761290322460 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "StringNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 700.0, + -160.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{DF1AB898-208E-4EA4-B3A9-202A4DB725EB}" + } + } + } + }, + { + "Key": { + "id": 3765585289756 + }, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "MethodNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 700.0, + 200.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData", + "SubStyle": ".method" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{5724716B-5E80-4BB2-AA9C-3E4916A40BAE}" + } + } + } + } + ], + "StatisticsHelper": { + "InstanceCounter": [ + { + "Key": 4199610336680704683, + "Value": 1 + }, + { + "Key": 6462358712820489356, + "Value": 1 + }, + { + "Key": 10684225535275896474, + "Value": 2 + }, + { + "Key": 13774516461288748354, + "Value": 1 + } + ] + } + } + } + } + } +} \ No newline at end of file From 043b21816582ed76243113ff800b992a1f78c80f Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Fri, 27 Aug 2021 15:44:31 -0500 Subject: [PATCH 10/13] Updated invalid filename warning with more explicit message from PR feedback. Signed-off-by: Chris Galvan --- .../AzQtComponents/Components/Widgets/FileDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp index cdd6a77094..d2d773ff93 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/FileDialog.cpp @@ -38,7 +38,8 @@ namespace AzQtComponents // If the filename had invalid characters, then show a warning message and then we will re-prompt the save filename dialog if (shouldPromptAgain) { - QMessageBox::warning(parent, QObject::tr("Invalid filename"), QObject::tr("The filename contains invalid characters\n\n%1").arg(fileName)); + QMessageBox::warning(parent, QObject::tr("Invalid filename"), + QObject::tr("O3DE assets are restricted to alphanumeric characters, hyphens (-), underscores (_), and dots (.)\n\n%1").arg(fileName)); } } else From b06583745058ced12c325350552489c91149ae98 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 27 Aug 2021 17:44:08 -0700 Subject: [PATCH 11/13] Fix for non-unity file and double declaration of WCHAR (#3657) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt | 2 +- .../Code/Source/Compressors/Compressor.cpp | 1 + .../Code/Source/Compressors/PVRTC.cpp | 10 +--------- .../Code/imageprocessing_files.cmake | 4 ---- .../External/CubeMapGen/CCubeMapProcessor.h | 7 +++---- .../External/CubeMapGen/CImageSurface.h | 5 +++-- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt index 6227d74d7e..dfeee011cc 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/CMakeLists.txt @@ -48,7 +48,7 @@ ly_add_target( PLATFORM_INCLUDE_FILES ${pal_source_dir}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake ${common_source_dir}/${PAL_TRAIT_COMPILER_ID}/imageprocessingatom_editor_static_${PAL_TRAIT_COMPILER_ID_LOWERCASE}.cmake - ${platform_tools_files} + ${platform_tools_files} INCLUDE_DIRECTORIES PUBLIC Include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp index 2cd7ff0e9b..9013bff1db 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/Compressor.cpp @@ -7,6 +7,7 @@ */ +#include #include #include #include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp index 0002ff4678..7c899e4ad2 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Compressors/PVRTC.cpp @@ -7,20 +7,12 @@ */ #include +#include #include #include #include #include -#if AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT -//_WINDLL_IMPORT need to be defined before including PVRTexLib header files to avoid linking error on windows. -#define _WINDLL_IMPORT -// NOMINMAX needs to be defined before including PVRTexLib header files (which include Windows.h) -// so that Windows.h doesn't define min/max. Otherwise, a compile error may arise in Uber builds -#ifndef NOMINMAX -#define NOMINMAX -#endif -#endif #include #include diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake index 29f7a9ca57..55ccdf1d89 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/imageprocessing_files.cmake @@ -136,7 +136,3 @@ set(FILES Source/Thumbnail/ImageThumbnailSystemComponent.cpp Source/Thumbnail/ImageThumbnailSystemComponent.h ) - -set(SKIP_UNITY_BUILD_INCLUSION_FILES - Source/Compressors/PVRTC.cpp -) diff --git a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h index 4a29e8621a..c78bfcfec6 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CCubeMapProcessor.h @@ -14,6 +14,7 @@ #include #include #include +#include #include "VectorMacros.h" #include "CBBoxInt32.h" @@ -22,11 +23,9 @@ //has routines for saving .rgbe files #define CG_RGBE_SUPPORT - -#ifndef WCHAR +#ifndef WCHAR // For non-windows platforms, for Windows-based platforms it will be defined through PlatformIncl.h #define WCHAR wchar_t -#endif //WCHAR - +#endif // WCHAR //used to index cube faces #define CP_FACE_X_POS 0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h index 848cbd1dbe..bbc41e756c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/External/CubeMapGen/CImageSurface.h @@ -14,10 +14,11 @@ #include "VectorMacros.h" #include +#include -#ifndef WCHAR +#ifndef WCHAR // For non-windows platforms, for Windows-based platforms it will be defined through PlatformIncl.h #define WCHAR wchar_t -#endif //WCHAR +#endif // WCHAR #ifndef SAFE_DELETE #define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } } From c32740ad539e387385da0cf8719e7518452623c1 Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Mon, 30 Aug 2021 09:30:13 -0700 Subject: [PATCH 12/13] Removed all preview.png and references of preview.png in all Atom related gems. (#3664) Signed-off-by: qingtao --- Gems/Atom/Asset/ImageProcessingAtom/preview.png | 3 --- Gems/Atom/Asset/Shader/preview.png | 3 --- Gems/Atom/Bootstrap/preview.png | 3 --- Gems/Atom/Component/DebugCamera/preview.png | 3 --- Gems/Atom/Feature/Common/preview.png | 3 --- Gems/Atom/Feature/Mesh/preview.png | 3 --- Gems/Atom/RHI/DX12/preview.png | 3 --- Gems/Atom/RHI/Metal/preview.png | 3 --- Gems/Atom/RHI/Vulkan/preview.png | 3 --- Gems/Atom/RHI/preview.png | 3 --- Gems/Atom/RPI/preview.png | 3 --- Gems/Atom/Tools/AtomToolsFramework/preview.png | 3 --- Gems/Atom/Utils/preview.png | 3 --- Gems/Atom/gem.json | 1 - Gems/AtomContent/ReferenceMaterials/gem.json | 1 - Gems/AtomContent/ReferenceMaterials/preview.png | 3 --- Gems/AtomContent/Sponza/gem.json | 1 - Gems/AtomContent/Sponza/preview.png | 3 --- Gems/AtomContent/gem.json | 1 - Gems/AtomLyIntegration/AtomBridge/preview.png | 3 --- Gems/AtomLyIntegration/AtomImGuiTools/preview.png | 3 --- Gems/AtomLyIntegration/CommonFeatures/preview.png | 3 --- Gems/AtomLyIntegration/ImguiAtom/preview.png | 3 --- .../TechnicalArt/DccScriptingInterface/preview.png | 3 --- Gems/AtomLyIntegration/gem.json | 1 - Gems/AtomTressFX/gem.json | 1 - Gems/AtomTressFX/preview.png | 3 --- 27 files changed, 69 deletions(-) delete mode 100644 Gems/Atom/Asset/ImageProcessingAtom/preview.png delete mode 100644 Gems/Atom/Asset/Shader/preview.png delete mode 100644 Gems/Atom/Bootstrap/preview.png delete mode 100644 Gems/Atom/Component/DebugCamera/preview.png delete mode 100644 Gems/Atom/Feature/Common/preview.png delete mode 100644 Gems/Atom/Feature/Mesh/preview.png delete mode 100644 Gems/Atom/RHI/DX12/preview.png delete mode 100644 Gems/Atom/RHI/Metal/preview.png delete mode 100644 Gems/Atom/RHI/Vulkan/preview.png delete mode 100644 Gems/Atom/RHI/preview.png delete mode 100644 Gems/Atom/RPI/preview.png delete mode 100644 Gems/Atom/Tools/AtomToolsFramework/preview.png delete mode 100644 Gems/Atom/Utils/preview.png delete mode 100644 Gems/AtomContent/ReferenceMaterials/preview.png delete mode 100644 Gems/AtomContent/Sponza/preview.png delete mode 100644 Gems/AtomLyIntegration/AtomBridge/preview.png delete mode 100644 Gems/AtomLyIntegration/AtomImGuiTools/preview.png delete mode 100644 Gems/AtomLyIntegration/CommonFeatures/preview.png delete mode 100644 Gems/AtomLyIntegration/ImguiAtom/preview.png delete mode 100644 Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png delete mode 100644 Gems/AtomTressFX/preview.png diff --git a/Gems/Atom/Asset/ImageProcessingAtom/preview.png b/Gems/Atom/Asset/ImageProcessingAtom/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Asset/ImageProcessingAtom/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/Asset/Shader/preview.png b/Gems/Atom/Asset/Shader/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Asset/Shader/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/Bootstrap/preview.png b/Gems/Atom/Bootstrap/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Bootstrap/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/Component/DebugCamera/preview.png b/Gems/Atom/Component/DebugCamera/preview.png deleted file mode 100644 index 400b6e6e35..0000000000 --- a/Gems/Atom/Component/DebugCamera/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc978169029b8ef4e69ee02abdc7f9bdc970900db90169bbf25d4b201f5c1287 -size 37625 diff --git a/Gems/Atom/Feature/Common/preview.png b/Gems/Atom/Feature/Common/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Feature/Common/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/Feature/Mesh/preview.png b/Gems/Atom/Feature/Mesh/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Feature/Mesh/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/RHI/DX12/preview.png b/Gems/Atom/RHI/DX12/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/RHI/DX12/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/RHI/Metal/preview.png b/Gems/Atom/RHI/Metal/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/RHI/Metal/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/RHI/Vulkan/preview.png b/Gems/Atom/RHI/Vulkan/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/RHI/Vulkan/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/RHI/preview.png b/Gems/Atom/RHI/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/RHI/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/RPI/preview.png b/Gems/Atom/RPI/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/RPI/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/Tools/AtomToolsFramework/preview.png b/Gems/Atom/Tools/AtomToolsFramework/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Tools/AtomToolsFramework/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/Utils/preview.png b/Gems/Atom/Utils/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/Atom/Utils/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/Atom/gem.json b/Gems/Atom/gem.json index f927e42e7e..99ca26025a 100644 --- a/Gems/Atom/gem.json +++ b/Gems/Atom/gem.json @@ -7,7 +7,6 @@ "summary": "The Atom Renderer Gem provides Atom Renderer and its associated tools (such as Material Editor), utilites, libraries, and interfaces.", "canonical_tags": ["Gem"], "user_tags": ["Rendering", "Core"], - "icon_path": "preview.png", "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom/" } diff --git a/Gems/AtomContent/ReferenceMaterials/gem.json b/Gems/AtomContent/ReferenceMaterials/gem.json index cb1d6f7a2e..d66c2fa1db 100644 --- a/Gems/AtomContent/ReferenceMaterials/gem.json +++ b/Gems/AtomContent/ReferenceMaterials/gem.json @@ -7,6 +7,5 @@ "summary": "Atom Asset Gem with a library of reference materials for StandardPBR (and others in the future)", "canonical_tags": ["Gem"], "user_tags": ["Assets"], - "icon_path": "preview.png", "requirements": "" } diff --git a/Gems/AtomContent/ReferenceMaterials/preview.png b/Gems/AtomContent/ReferenceMaterials/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomContent/ReferenceMaterials/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/AtomContent/Sponza/gem.json b/Gems/AtomContent/Sponza/gem.json index ef054ce55a..3fc76927e1 100644 --- a/Gems/AtomContent/Sponza/gem.json +++ b/Gems/AtomContent/Sponza/gem.json @@ -7,6 +7,5 @@ "summary": "A standard test scene for Global Illumination (forked from crytek sponza scene)", "canonical_tags": ["Gem"], "user_tags": ["Assets"], - "icon_path": "preview.png", "requirements": "" } diff --git a/Gems/AtomContent/Sponza/preview.png b/Gems/AtomContent/Sponza/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomContent/Sponza/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/AtomContent/gem.json b/Gems/AtomContent/gem.json index 8161635f43..6fcb8903e4 100644 --- a/Gems/AtomContent/gem.json +++ b/Gems/AtomContent/gem.json @@ -7,7 +7,6 @@ "summary": "The Atom Content Gem provides assets for Atom Renderer and a modified version of the Pixar Look Development Studio.", "canonical_tags": ["Gem"], "user_tags": ["Rendering", "Assets", "Tools"], - "icon_path": "preview.png", "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom-content/" } diff --git a/Gems/AtomLyIntegration/AtomBridge/preview.png b/Gems/AtomLyIntegration/AtomBridge/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomLyIntegration/AtomBridge/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/preview.png b/Gems/AtomLyIntegration/AtomImGuiTools/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomLyIntegration/AtomImGuiTools/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/AtomLyIntegration/CommonFeatures/preview.png b/Gems/AtomLyIntegration/CommonFeatures/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomLyIntegration/CommonFeatures/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/AtomLyIntegration/ImguiAtom/preview.png b/Gems/AtomLyIntegration/ImguiAtom/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomLyIntegration/ImguiAtom/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png deleted file mode 100644 index b48e4907fc..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1bda4365dc85f8abbcb2b08e942ad03e3d7d9dabe555e079185789a2e1b282bf -size 23321 diff --git a/Gems/AtomLyIntegration/gem.json b/Gems/AtomLyIntegration/gem.json index 28faf364db..5af133c8e8 100644 --- a/Gems/AtomLyIntegration/gem.json +++ b/Gems/AtomLyIntegration/gem.json @@ -7,7 +7,6 @@ "summary": "The Atom O3DE Integration Gem provides components, libraries, and functionality to support and integrate Atom Renderer in Open 3D Engine.", "canonical_tags": ["Gem"], "user_tags": ["Rendering", "Core", "Utility"], - "icon_path": "preview.png", "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/atom/atom-ly-integration/" } diff --git a/Gems/AtomTressFX/gem.json b/Gems/AtomTressFX/gem.json index 5f2e25b8a9..f6ff2b41d5 100644 --- a/Gems/AtomTressFX/gem.json +++ b/Gems/AtomTressFX/gem.json @@ -7,7 +7,6 @@ "summary": "The Atom TressFX Gem provides realistic hair and fur simulation and rendering in Atom and Open 3D Engine with AMD TressFX.", "canonical_tags": ["Gem"], "user_tags": ["Rendering", "Physics", "Animation"], - "icon_path": "preview.png", "requirements": "", "documentation_url": "https://o3de.org/docs/user-guide/gems/reference/rendering/amd/atom-tressfx/" } diff --git a/Gems/AtomTressFX/preview.png b/Gems/AtomTressFX/preview.png deleted file mode 100644 index 2f1ed47754..0000000000 --- a/Gems/AtomTressFX/preview.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d6204c6730e5675791765ca194e9b1cbec282208e280507de830afc2805e5fa -size 41127 From f2eb8ff51fac69b65d7bf71311d1d5fa69a2d37c Mon Sep 17 00:00:00 2001 From: Qing Tao <55564570+VickyAtAZ@users.noreply.github.com> Date: Mon, 30 Aug 2021 10:10:22 -0700 Subject: [PATCH 13/13] ATOM-16237 Using setting registry to RPI system settings (#3663) * ATOM-16237 Using setting registry to RPI system settings Changes include: - Remove RHISystemDesriptor since the pre-registered draw list tag is not needed. - Remove EitorContext which was for system component settings. - Add atom_rpi.setreg file - Add getting RPISystemDescriptor from setting registry. Signed-off-by: qingtao --- .../Code/Source/CommonSystemComponent.cpp | 1 + .../Atom/RHI.Reflect/RHISystemDescriptor.h | 31 -------------- .../RHI/Code/Include/Atom/RHI/RHISystem.h | 3 +- .../RHI.Reflect/RHISystemDescriptor.cpp | 40 ------------------- .../RHI.Reflect/ReflectSystemComponent.cpp | 2 - Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp | 10 +---- .../RHI/Code/atom_rhi_reflect_files.cmake | 2 - .../RPI.Reflect/Image/ImageSystemDescriptor.h | 8 ++++ .../Atom/RPI.Reflect/RPISystemDescriptor.h | 3 -- .../Source/RPI.Private/RPISystemComponent.cpp | 11 +++-- .../RPI/Code/Source/RPI.Public/RPISystem.cpp | 4 +- .../Image/ImageSystemDescriptor.cpp | 15 ------- .../RPI.Reflect/RPISystemDescriptor.cpp | 25 +----------- Gems/Atom/RPI/Registry/atom_rpi.setreg | 24 +++++++++++ .../Code/Source/LyShineSystemComponent.cpp | 4 ++ 15 files changed, 50 insertions(+), 133 deletions(-) delete mode 100644 Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RHISystemDescriptor.h delete mode 100644 Gems/Atom/RHI/Code/Source/RHI.Reflect/RHISystemDescriptor.cpp create mode 100644 Gems/Atom/RPI/Registry/atom_rpi.setreg diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index 1500079b00..de03c08c6f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -294,6 +294,7 @@ namespace AZ void CommonSystemComponent::Deactivate() { + m_loadTemplatesHandler.Disconnect(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); AZ::RPI::FeatureProcessorFactory::Get()->UnregisterFeatureProcessor(); diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RHISystemDescriptor.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RHISystemDescriptor.h deleted file mode 100644 index 8c512662e7..0000000000 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/RHISystemDescriptor.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#pragma once - -#include -#include - -namespace AZ -{ - class ReflectContext; - - - namespace RHI - { - class PlatformLimits; - struct RHISystemDescriptor final - { - AZ_TYPE_INFO(RHISystemDescriptor, "{A506DA28-856C-483A-938D-73471D2C5A5B}"); - static void Reflect(AZ::ReflectContext* context); - - //! The set of globally declared draw list tags, which will be registered with the registry at startup. - AZStd::vector m_drawListTags; - }; - } // namespace RHI -} // namespace AZ diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h index 25026b5b87..599108654a 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI/RHISystem.h @@ -14,7 +14,6 @@ #include #include #include -#include namespace AZ { @@ -33,7 +32,7 @@ namespace AZ void InitDevice(); //! This function initializes the rest of the RHI/RHI backend. - void Init(const RHISystemDescriptor& descriptor); + void Init(); void Shutdown(); //! An external callback to build the frame graph. diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/RHISystemDescriptor.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/RHISystemDescriptor.cpp deleted file mode 100644 index 45463c79ac..0000000000 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/RHISystemDescriptor.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ - -#include -#include - -#include -#include - -namespace AZ -{ - namespace RHI - { - void RHISystemDescriptor::Reflect(AZ::ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(4) - ->Field("DrawItemTags", &RHISystemDescriptor::m_drawListTags) - ; - - if (AZ::EditContext* ec = serializeContext->GetEditContext()) - { - ec->Class("RHI Settings", "Settings for runtime RHI system") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &RHISystemDescriptor::m_drawListTags, "Draw List Tags", "The set of globally declared draw list tags, which will be registered with the registry at startup.") - ; - } - } - } - } // namespace RPI -} // namespace AZ diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ReflectSystemComponent.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ReflectSystemComponent.cpp index 691a07b24d..c7f7e777aa 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ReflectSystemComponent.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ReflectSystemComponent.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -161,7 +160,6 @@ namespace AZ TransientAttachmentPoolBudgets::Reflect(context); PlatformLimits::Reflect(context); PlatformLimitsDescriptor::Reflect(context); - RHISystemDescriptor::Reflect(context); Origin::Reflect(context); ReflectVendorIdEnums(context); PhysicalDeviceDriverValidator::Reflect(context); diff --git a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp index ed755c538a..b03cb34140 100644 --- a/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI/RHISystem.cpp @@ -36,7 +36,7 @@ namespace AZ m_device = InitInternalDevice(); } - void RHISystem::Init(const RHISystemDescriptor& descriptor) + void RHISystem::Init() { m_cpuProfiler.Init(); @@ -86,14 +86,6 @@ namespace AZ frameSchedulerDescriptor.m_platformLimitsDescriptor = platformLimitsDescriptor; m_frameScheduler.Init(*m_device, frameSchedulerDescriptor); - - // Register draw list tags declared from content. - for (const Name& drawListName : descriptor.m_drawListTags) - { - RHI::DrawListTag drawListTag = m_drawListTagRegistry->AcquireTag(drawListName); - - AZ_Warning("RHISystem", drawListTag.IsValid(), "Failed to register draw list tag '%s'. Registry at capacity.", drawListName.GetCStr()); - } } RHI::Ptr RHISystem::InitInternalDevice() diff --git a/Gems/Atom/RHI/Code/atom_rhi_reflect_files.cmake b/Gems/Atom/RHI/Code/atom_rhi_reflect_files.cmake index 9c4ca9a60d..e211462eeb 100644 --- a/Gems/Atom/RHI/Code/atom_rhi_reflect_files.cmake +++ b/Gems/Atom/RHI/Code/atom_rhi_reflect_files.cmake @@ -118,9 +118,7 @@ set(FILES Include/Atom/RHI.Reflect/SwapChainDescriptor.h Source/RHI.Reflect/SwapChainDescriptor.cpp Include/Atom/RHI.Reflect/ReflectSystemComponent.h - Include/Atom/RHI.Reflect/RHISystemDescriptor.h Source/RHI.Reflect/ReflectSystemComponent.cpp - Source/RHI.Reflect/RHISystemDescriptor.cpp Include/Atom/RHI.Reflect/AliasedHeapEnums.h Include/Atom/RHI.Reflect/TransientBufferDescriptor.h Include/Atom/RHI.Reflect/TransientImageDescriptor.h diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageSystemDescriptor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageSystemDescriptor.h index 22dec8ce64..e013c1dad1 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageSystemDescriptor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/ImageSystemDescriptor.h @@ -21,8 +21,16 @@ namespace AZ AZ_TYPE_INFO(RPI::ImageSystemDescriptor, "{319D14F6-F7F2-487A-AA6B-5800E328C79B}"); static void Reflect(AZ::ReflectContext* context); + //! The maximum size of the image pool used for system streaming images. + //! Check ImageSystemInterface::GetSystemStreamingPool() for detail of this image pool uint64_t m_systemStreamingImagePoolSize = 128 * 1024 * 1024; + + //! The maximum size of the image pool used for system attachments images. + //! Check ImageSystemInterface::GetSystemAttachmentPool() for detail of this image pool uint64_t m_systemAttachmentImagePoolSize = 512 * 1024 * 1024; + + //! The maximum size of the image pool used for streaming images load from assets + //! Check ImageSystemInterface::GetStreamingPool() for detail of this image pool uint64_t m_assetStreamingImagePoolSize = 2u * 1024u * 1024u * 1024u; }; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/RPISystemDescriptor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/RPISystemDescriptor.h index 2076e72731..1b7b32c1e9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/RPISystemDescriptor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/RPISystemDescriptor.h @@ -10,7 +10,6 @@ #include #include -#include namespace AZ { @@ -31,8 +30,6 @@ namespace AZ AZ_TYPE_INFO(RPISystemDescriptor, "{96DAC3DA-40D4-4C03-8D6A-3181E843262A}"); static void Reflect(AZ::ReflectContext* context); - RHI::RHISystemDescriptor m_rhiSystemDescriptor; - //! The asset cache relative path of the only common shader asset for the RPI system that is used //! as means to load the layout for scene srg and view srg. This is used to create any RPI::Scene. AZStd::string m_commonSrgsShaderAssetPath = "shader/sceneandviewsrgs.azshader"; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Private/RPISystemComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Private/RPISystemComponent.cpp index f73673f0e4..2567d221e5 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Private/RPISystemComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Private/RPISystemComponent.cpp @@ -15,9 +15,11 @@ #include +#include #include #include -#include +#include + #ifdef RPI_EDITOR #include #endif @@ -84,8 +86,11 @@ namespace AZ void RPISystemComponent::Activate() { - // [GFX TODO] [ATOM-1436] this can be removed when setup and save system component's configure from projectConfigure.exe is fixed. - m_rpiDescriptor.m_rhiSystemDescriptor.m_drawListTags.push_back(AZ::Name("forward")); + auto settingsRegistry = AZ::SettingsRegistry::Get(); + if (settingsRegistry) + { + settingsRegistry->GetObject(m_rpiDescriptor, "/O3DE/Atom/RPI/Initialization"); + } m_rpiSystem.Initialize(m_rpiDescriptor); AZ::SystemTickBus::Handler::BusConnect(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp index a9028627a0..66c4f6d20a 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/RPISystem.cpp @@ -372,7 +372,7 @@ namespace AZ return; } - m_rhiSystem.Init(m_descriptor.m_rhiSystemDescriptor); + m_rhiSystem.Init(); m_imageSystem.Init(m_descriptor.m_imageSystemDescriptor); m_bufferSystem.Init(); m_dynamicDraw.Init(m_descriptor.m_dynamicDrawSystemDescriptor); @@ -396,7 +396,7 @@ namespace AZ } //Init rhi/image/buffer systems to match InitializeSystemAssets - m_rhiSystem.Init(m_descriptor.m_rhiSystemDescriptor); + m_rhiSystem.Init(); m_imageSystem.Init(m_descriptor.m_imageSystemDescriptor); m_bufferSystem.Init(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageSystemDescriptor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageSystemDescriptor.cpp index 611a83be93..937daf3f62 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageSystemDescriptor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/ImageSystemDescriptor.cpp @@ -25,21 +25,6 @@ namespace AZ ->Field("SystemStreamingImagePoolSize", &ImageSystemDescriptor::m_systemStreamingImagePoolSize) ->Field("SystemAttachmentImagePoolSize", &ImageSystemDescriptor::m_systemAttachmentImagePoolSize) ; - - if (AZ::EditContext* ec = serializeContext->GetEditContext()) - { - ec->Class("Image System Config", "Settings for RPI Image System") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &ImageSystemDescriptor::m_assetStreamingImagePoolSize, - "Streaming image pool size for assets", "Streaming image pool size in bytes for streaming images created from assets") - ->DataElement(AZ::Edit::UIHandlers::Default, &ImageSystemDescriptor::m_systemStreamingImagePoolSize, - "System streaming image pool size", "Streaming image pool size in bytes for streaming images created in memory") - ->DataElement(AZ::Edit::UIHandlers::Default, &ImageSystemDescriptor::m_systemAttachmentImagePoolSize, - "System attachment image pool size", "Default attachment image pool size in bytes") - ; - } } } } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/RPISystemDescriptor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/RPISystemDescriptor.cpp index 21c6061d8e..dc379396eb 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/RPISystemDescriptor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/RPISystemDescriptor.cpp @@ -25,35 +25,12 @@ namespace AZ ; serializeContext->Class() - ->Version(6) // ATOM-15472 - ->Field("RHISystemDescriptor", &RPISystemDescriptor::m_rhiSystemDescriptor) + ->Version(7) // ATOM-16237 ->Field("CommonSrgsShaderAssetPath", &RPISystemDescriptor::m_commonSrgsShaderAssetPath) ->Field("ImageSystemDescriptor", &RPISystemDescriptor::m_imageSystemDescriptor) ->Field("GpuQuerySystemDescriptor", &RPISystemDescriptor::m_gpuQuerySystemDescriptor) ->Field("DynamicDrawSystemDescriptor", &RPISystemDescriptor::m_dynamicDrawSystemDescriptor) ; - - if (AZ::EditContext* ec = serializeContext->GetEditContext()) - { - ec->Class("Dynamic Draw System Settings", "Settings for the Dynamic Draw System") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &DynamicDrawSystemDescriptor::m_dynamicBufferPoolSize, "Dynamic Buffer Pool Size", "The maxinum size of pool which is used to allocate dynamic buffers") - ; - - ec->Class("RPI Settings", "Settings for runtime RPI system") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_commonSrgsShaderAssetPath, "Common Shader Asset Path For Scene & View SRGs", - "Shader asset path used to get the Scene and View SRGs for all RPI scenes and views respectively") - ->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_rhiSystemDescriptor, "RHI System Config", "Configuration of Render Hardware Interface") - ->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_imageSystemDescriptor, "Image System Config", "Configuration of Image System") - ->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_gpuQuerySystemDescriptor, "Gpu Query System Config", "Configuration of Gpu Query System") - ->DataElement(AZ::Edit::UIHandlers::Default, &RPISystemDescriptor::m_dynamicDrawSystemDescriptor, "Dynamic Draw System Config", "Configuration of Dynamic Draw System") - ; - } } } } // namespace RPI diff --git a/Gems/Atom/RPI/Registry/atom_rpi.setreg b/Gems/Atom/RPI/Registry/atom_rpi.setreg new file mode 100644 index 0000000000..bcbade5d38 --- /dev/null +++ b/Gems/Atom/RPI/Registry/atom_rpi.setreg @@ -0,0 +1,24 @@ +{ + "O3DE": { + "Atom": { + "RPI": { + "Initialization": { + "CommonSrgsShaderAssetPath": "shader/sceneandviewsrgs.azshader", + "ImageSystemDescriptor": { + "AssetStreamingImagePoolSize": 2147483648, // 2 * 1024 * 1024 * 1024 + "SystemStreamingImagePoolSize": 134217728, // 128 * 1024 * 1024 + "SystemAttachmentImagePoolSize": 536870912 // 512 * 1024 * 1024 + }, + "GpuQuerySystemDescriptor": { + "OcclusionQueryCount": 128, + "StatisticsQueryCount": 256, + "TimestampQueryCount": 256 + }, + "DynamicDrawSystemDescriptor": { + "DynamicBufferPoolSize": 50331648 // 3 * 16 * 1024 * 1024 (for 3 frames) + } + } + } + } + } +} diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp index d3d2d5655e..f815e2ddbd 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp @@ -205,6 +205,10 @@ namespace LyShine //////////////////////////////////////////////////////////////////////////////////////////////////// void LyShineSystemComponent::Deactivate() { +#if !defined(LYSHINE_BUILDER) && !defined(LYSHINE_TESTS) + m_loadTemplatesHandler.Disconnect(); +#endif + UiSystemBus::Handler::BusDisconnect(); UiSystemToolsBus::Handler::BusDisconnect(); UiFrameworkBus::Handler::BusDisconnect();