diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/ByteStreamSerializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/ByteStreamSerializer.cpp index 6077a66682..f15178dd00 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/ByteStreamSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/ByteStreamSerializer.cpp @@ -10,91 +10,75 @@ * */ -#include "ByteStreamSerializer.h" - #include #include +#include #include #include namespace AZ { - namespace ByteSerializerInternal - { - static JsonSerializationResult::Result Load(void* outputValue, const rapidjson::Value& inputValue, JsonDeserializerContext& context) - { - using JsonSerializationResult::Outcomes; - using JsonSerializationResult::Tasks; - - AZ_Assert(outputValue, "Expected a valid pointer to load from json value."); - - switch (inputValue.GetType()) - { - case rapidjson::kStringType: { - JsonByteStream buffer; - if (AZ::StringFunc::Base64::Decode(buffer, inputValue.GetString(), inputValue.GetStringLength())) - { - JsonByteStream* valAsByteStream = static_cast(outputValue); - *valAsByteStream = AZStd::move(buffer); - return context.Report(Tasks::ReadField, Outcomes::Success, "Successfully read ByteStream."); - } - return context.Report(Tasks::ReadField, Outcomes::Invalid, "Decode of Base64 encoded ByteStream failed."); - } - case rapidjson::kArrayType: - case rapidjson::kObjectType: - case rapidjson::kNullType: - case rapidjson::kFalseType: - case rapidjson::kTrueType: - case rapidjson::kNumberType: - return context.Report( - Tasks::ReadField, Outcomes::Unsupported, - "Unsupported type. ByteStream values cannot be read from arrays, objects, nulls, booleans or numbers."); - default: - return context.Report(Tasks::ReadField, Outcomes::Unknown, "Unknown json type encountered for ByteStream value."); - } - } - - static JsonSerializationResult::Result StoreWithDefault( - rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, JsonSerializerContext& context) - { - using JsonSerializationResult::Outcomes; - using JsonSerializationResult::Tasks; - - const JsonByteStream& valAsByteStream = *static_cast(inputValue); - if (context.ShouldKeepDefaults() || !defaultValue || (valAsByteStream != *static_cast(defaultValue))) - { - const auto base64ByteStream = AZ::StringFunc::Base64::Encode(valAsByteStream.data(), valAsByteStream.size()); - outputValue.SetString(base64ByteStream.c_str(), base64ByteStream.size(), context.GetJsonAllocator()); - return context.Report(Tasks::WriteValue, Outcomes::Success, "ByteStream successfully stored."); - } - - return context.Report(Tasks::WriteValue, Outcomes::DefaultsUsed, "Default ByteStream used."); - } - } // namespace ByteSerializerInternal - AZ_CLASS_ALLOCATOR_IMPL(JsonByteStreamSerializer, SystemAllocator, 0); JsonSerializationResult::Result JsonByteStreamSerializer::Load( void* outputValue, [[maybe_unused]] const Uuid& outputValueTypeId, const rapidjson::Value& inputValue, JsonDeserializerContext& context) { + using JsonSerializationResult::Outcomes; + using JsonSerializationResult::Tasks; + AZ_Assert( azrtti_typeid() == outputValueTypeId, "Unable to deserialize AZStd::vector> to json because the provided type is %s", outputValueTypeId.ToString().c_str()); + AZ_Assert(outputValue, "Expected a valid pointer to load from json value."); - return ByteSerializerInternal::Load(outputValue, inputValue, context); + switch (inputValue.GetType()) + { + case rapidjson::kStringType: { + JsonByteStream buffer; + if (AZ::StringFunc::Base64::Decode(buffer, inputValue.GetString(), inputValue.GetStringLength())) + { + JsonByteStream* valAsByteStream = static_cast(outputValue); + *valAsByteStream = AZStd::move(buffer); + return context.Report(Tasks::ReadField, Outcomes::Success, "Successfully read ByteStream."); + } + return context.Report(Tasks::ReadField, Outcomes::Invalid, "Decode of Base64 encoded ByteStream failed."); + } + case rapidjson::kArrayType: + case rapidjson::kObjectType: + case rapidjson::kNullType: + case rapidjson::kFalseType: + case rapidjson::kTrueType: + case rapidjson::kNumberType: + return context.Report( + Tasks::ReadField, Outcomes::Unsupported, + "Unsupported type. ByteStream values cannot be read from arrays, objects, nulls, booleans or numbers."); + default: + return context.Report(Tasks::ReadField, Outcomes::Unknown, "Unknown json type encountered for ByteStream value."); + } } JsonSerializationResult::Result JsonByteStreamSerializer::Store( rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue, [[maybe_unused]] const Uuid& valueTypeId, JsonSerializerContext& context) { + using JsonSerializationResult::Outcomes; + using JsonSerializationResult::Tasks; + AZ_Assert( azrtti_typeid() == valueTypeId, "Unable to serialize AZStd::vector to json because the provided type is %s", valueTypeId.ToString().c_str()); - return ByteSerializerInternal::StoreWithDefault(outputValue, inputValue, defaultValue, context); + const JsonByteStream& valAsByteStream = *static_cast(inputValue); + if (context.ShouldKeepDefaults() || !defaultValue || (valAsByteStream != *static_cast(defaultValue))) + { + const auto base64ByteStream = AZ::StringFunc::Base64::Encode(valAsByteStream.data(), valAsByteStream.size()); + outputValue.SetString(base64ByteStream.c_str(), base64ByteStream.size(), context.GetJsonAllocator()); + return context.Report(Tasks::WriteValue, Outcomes::Success, "ByteStream successfully stored."); + } + + return context.Report(Tasks::WriteValue, Outcomes::DefaultsUsed, "Default ByteStream used."); } } // namespace AZ diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ProgressBar.qss b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ProgressBar.qss index 3542aa4764..76f834bf70 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ProgressBar.qss +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ProgressBar.qss @@ -24,5 +24,5 @@ QProgressBar QProgressBar::chunk { - background: #54AFD0; + background: #1E70EB; } diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/PushButtonConfig.ini b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/PushButtonConfig.ini index c88d0f61ee..34c084b0f2 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/PushButtonConfig.ini +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/PushButtonConfig.ini @@ -13,14 +13,14 @@ Width=24; ArrowWidth=10; [PrimaryColorSet] -Disabled\Start=#7092A7 -Disabled\End=#7092A7 -Sunken\Start=#0073BB -Sunken\End=#0073BB -Hovered\Start=#44BAFF -Hovered\End=#4AB2F8 +Disabled\Start=#2A4875 +Disabled\End=#2A4875 +Sunken\Start=#1E70EB +Sunken\End=#1E70EB +Hovered\Start=#4ABAFF +Hovered\End=#94D2FF Normal\Start=#0095F2 -Normal\End=#0073BB +Normal\End=#1E70EB [SecondaryColorSet] Disabled\Start=#666666 @@ -42,10 +42,10 @@ Color=#3D000000 [FocusedBorder] Thickness=1 -Color=#00A1C9 +Color=#4B8CEF [IconButton] -ActiveColor=#00A1C9 +ActiveColor=#1E70EB DisabledColor=#999999 SelectedColor=#FFFFFF diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderConfig.ini b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderConfig.ini index 44f4f6d093..018f29ed41 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderConfig.ini +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/SliderConfig.ini @@ -12,7 +12,7 @@ HandleBorder\Color=#FFFFFF HandleBorder\Radius=1.5 [Slider] -Handle\Color=#0185D7 +Handle\Color=#1E70EB Handle\ColorDisabled=#999999 Handle\Size=12 Handle\SizeMinusMargin=8 diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Text.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Text.cpp index b88209a36b..377f5ecdcf 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Text.cpp +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Text.cpp @@ -46,7 +46,7 @@ namespace AzQtComponents Text::Config Text::defaultConfig() { Config config; - config.hyperlinkColor = QStringLiteral("#44B2F8"); + config.hyperlinkColor = QStringLiteral("#94D2FF"); return config; } diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TextConfig.ini b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TextConfig.ini index 450636e220..3755b61867 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TextConfig.ini +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/TextConfig.ini @@ -1,2 +1,2 @@ [Hyperlink] -Color=#44B2F8 +Color=#94D2FF \ No newline at end of file diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/off-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/off-focus.svg index c7bf13420c..5e862d9604 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/off-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/off-focus.svg @@ -4,7 +4,7 @@ Selection Controls / Checkbox / Off Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-disabled.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-disabled.svg index 020514b9bf..64115f629b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-disabled.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-disabled.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-focus.svg index 03971b4ea2..b3b05d969b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on-focus.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on.svg index 8c2f963403..315d34f8cb 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/on.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-disabled.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-disabled.svg index b0bca84b49..1d409abff8 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-disabled.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-disabled.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-focus.svg index dd789a8782..d5e4faaaf6 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected-focus.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected.svg index 643f35f357..58c853e9db 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/checkbox/partial-selected.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-disabled.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-disabled.svg index 3c05726f2d..8f289a1830 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-disabled.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-disabled.svg @@ -4,7 +4,7 @@ Selection Controls / Radio Button / On - Disabled Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-focus.svg index a533b695b0..d50ffa172d 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked-focus.svg @@ -4,7 +4,7 @@ Selection Controls / Radio Button / On-focus Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked.svg index 40d64f6a8c..b151a8aae3 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/checked.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/unchecked-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/unchecked-focus.svg index e636dc38cd..818416abb7 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/unchecked-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/radiobutton/unchecked-focus.svg @@ -4,7 +4,7 @@ Selection Controls / Radio Button / Off-focus Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-disabled.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-disabled.svg index c1582c8cdf..0c869ef0ce 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-disabled.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-disabled.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-focus.svg index c28ccf7b0c..9f4f07f804 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked-focus.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked.svg index 9a5b898e9c..11048a512a 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/checked.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/unchecked-focus.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/unchecked-focus.svg index 046789536b..981467aa3b 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/unchecked-focus.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toggleswitch/unchecked-focus.svg @@ -5,7 +5,7 @@ Created with Sketch. - + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/loading.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/loading.svg index d24c0c2b12..7f6fcc2175 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/loading.svg +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/loading.svg @@ -1,6 +1,6 @@ - + GetPixmap(size).scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); + const QPixmap pixmap = thumbnail->GetPixmap().scaled(size, Qt::KeepAspectRatio, Qt::SmoothTransformation); const QSize sizeDelta = size - pixmap.size(); const QPoint pointDelta = QPoint(sizeDelta.width() / 2, sizeDelta.height() / 2); painter->drawPixmap(point + pointDelta, pixmap); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialBrowserComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialBrowserComponent.cpp index 3a6ed1c241..f64d4af23d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialBrowserComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialBrowserComponent.cpp @@ -36,8 +36,7 @@ namespace AzToolsFramework using namespace Thumbnailer; using namespace AssetBrowser; const char* contextName = "MaterialBrowser"; - int thumbnailSize = qApp->style()->pixelMetric(QStyle::PM_SmallIconSize); - ThumbnailerRequestsBus::Broadcast(&ThumbnailerRequests::RegisterContext, contextName, thumbnailSize); + ThumbnailerRequestsBus::Broadcast(&ThumbnailerRequests::RegisterContext, contextName); ThumbnailerRequestsBus::Broadcast(&ThumbnailerRequests::RegisterThumbnailProvider, MAKE_TCACHE(FolderThumbnailCache), contextName); ThumbnailerRequestsBus::Broadcast(&ThumbnailerRequests::RegisterThumbnailProvider, MAKE_TCACHE(SourceThumbnailCache), contextName); ThumbnailerRequestsBus::Broadcast(&ThumbnailerRequests::RegisterThumbnailProvider, MAKE_TCACHE(MaterialThumbnailCache), contextName); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.cpp index 30e7f4d6cb..e04df8937c 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.cpp @@ -24,8 +24,8 @@ namespace AzToolsFramework ////////////////////////////////////////////////////////////////////////// // MaterialThumbnail ////////////////////////////////////////////////////////////////////////// - MaterialThumbnail::MaterialThumbnail(Thumbnailer::SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) + MaterialThumbnail::MaterialThumbnail(Thumbnailer::SharedThumbnailKey key) + : Thumbnail(key) { auto productKey = azrtti_cast(m_key.data()); AZ_Assert(productKey, "Incorrect key type, excpected ProductThumbnailKey"); @@ -34,7 +34,8 @@ namespace AzToolsFramework MaterialBrowserRequestBus::BroadcastResult(multiMat, &MaterialBrowserRequests::IsMultiMaterial, productKey->GetAssetId()); QString iconPath = multiMat ? MultiMaterialIconPath : SimpleMaterialIconPath; - m_pixmap = QPixmap(iconPath).scaled(m_thumbnailSize, m_thumbnailSize, Qt::KeepAspectRatio); + m_pixmap.load(iconPath); + m_state = m_pixmap.isNull() ? State::Failed : State::Ready; } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.h b/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.h index f7873ef765..60a2bb11e5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/MaterialBrowser/MaterialThumbnail.h @@ -28,7 +28,7 @@ namespace AzToolsFramework { Q_OBJECT public: - MaterialThumbnail(Thumbnailer::SharedThumbnailKey key, int thumbnailSize); + MaterialThumbnail(Thumbnailer::SharedThumbnailKey key); }; namespace diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp index 0664c63a5b..2db93a92f3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.cpp @@ -18,13 +18,15 @@ namespace AzToolsFramework { namespace Thumbnailer { + static constexpr const int LoadingThumbnailSize = 128; + ////////////////////////////////////////////////////////////////////////// // LoadingThumbnail ////////////////////////////////////////////////////////////////////////// static const char* LoadingIconPath = "Editor/Icons/AssetBrowser/in_progress.gif"; - LoadingThumbnail::LoadingThumbnail(int thumbnailSize) - : Thumbnail(MAKE_TKEY(ThumbnailKey), thumbnailSize) + LoadingThumbnail::LoadingThumbnail() + : Thumbnail(MAKE_TKEY(ThumbnailKey)) , m_angle(0) { const char* engineRoot = nullptr; @@ -34,7 +36,7 @@ namespace AzToolsFramework AZ::StringFunc::Path::Join(engineRoot, LoadingIconPath, iconPath); m_loadingMovie.setFileName(iconPath.c_str()); m_loadingMovie.setCacheMode(QMovie::CacheMode::CacheAll); - m_loadingMovie.setScaledSize(QSize(m_thumbnailSize, m_thumbnailSize)); + m_loadingMovie.setScaledSize(QSize(LoadingThumbnailSize, LoadingThumbnailSize)); m_loadingMovie.start(); m_pixmap = m_loadingMovie.currentPixmap(); m_state = State::Ready; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.h index c9a2e88dfe..b8f50278b8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/LoadingThumbnail.h @@ -29,7 +29,7 @@ namespace AzToolsFramework { Q_OBJECT public: - explicit LoadingThumbnail(int thumbnailSize); + LoadingThumbnail(); ~LoadingThumbnail() override; void UpdateTime(float /*deltaTime*/) override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp index 06921f2606..2bdec58392 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.cpp @@ -18,11 +18,11 @@ namespace AzToolsFramework { static const char* MISSING_ICON_PATH = "Editor/Icons/AssetBrowser/Default_16.svg"; - MissingThumbnail::MissingThumbnail(int thumbnailSize) - : Thumbnail(MAKE_TKEY(ThumbnailKey), thumbnailSize) + MissingThumbnail::MissingThumbnail() + : Thumbnail(MAKE_TKEY(ThumbnailKey)) { - m_icon = QIcon(MISSING_ICON_PATH); - m_state = State::Ready; + m_pixmap.load(MISSING_ICON_PATH); + m_state = m_pixmap.isNull() ? State::Failed : State::Ready; } } // namespace Thumbnailer diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.h index 5858c759c9..e5712c514a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/MissingThumbnail.h @@ -24,7 +24,7 @@ namespace AzToolsFramework { Q_OBJECT public: - explicit MissingThumbnail(int thumbnailSize); + MissingThumbnail(); }; } // namespace Thumbnailer } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.cpp index 705ce5f71b..ce6e04e105 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.cpp @@ -69,8 +69,8 @@ namespace AzToolsFramework bool SourceControlThumbnail::m_readyForUpdate = true; - SourceControlThumbnail::SourceControlThumbnail(SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) + SourceControlThumbnail::SourceControlThumbnail(SharedThumbnailKey key) + : Thumbnail(key) { const char* engineRoot = nullptr; AzFramework::ApplicationRequests::Bus::BroadcastResult(engineRoot, &AzFramework::ApplicationRequests::GetEngineRoot); @@ -122,16 +122,16 @@ namespace AzToolsFramework { if (fileInfo.HasFlag(AzToolsFramework::SCF_Writeable)) { - m_icon = QIcon(m_writableIconPath.c_str()); + m_pixmap.load(m_writableIconPath.c_str()); } else { - m_icon = QIcon(m_nonWritableIconPath.c_str()); + m_pixmap.load(m_nonWritableIconPath.c_str()); } } else { - m_icon = QIcon(); + m_pixmap = QPixmap(); } m_readyForUpdate = true; emit Updated(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.h index 03b04a3fd9..23fded57f4 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/SourceControlThumbnail.h @@ -55,7 +55,7 @@ namespace AzToolsFramework { Q_OBJECT public: - SourceControlThumbnail(SharedThumbnailKey key, int thumbnailSize); + SourceControlThumbnail(SharedThumbnailKey key); ~SourceControlThumbnail() override; ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.cpp index 2892e4efce..499f508dcd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.cpp @@ -24,8 +24,6 @@ namespace AzToolsFramework { namespace Thumbnailer { - static const int DefaultIconSize = 16; - ////////////////////////////////////////////////////////////////////////// // ThumbnailKey ////////////////////////////////////////////////////////////////////////// @@ -54,10 +52,9 @@ namespace AzToolsFramework ////////////////////////////////////////////////////////////////////////// // Thumbnail ////////////////////////////////////////////////////////////////////////// - Thumbnail::Thumbnail(SharedThumbnailKey key, int thumbnailSize) + Thumbnail::Thumbnail(SharedThumbnailKey key) : QObject() , m_state(State::Unloaded) - , m_thumbnailSize(thumbnailSize) , m_key(key) { connect(&m_watcher, &QFutureWatcher::finished, this, [this]() @@ -91,19 +88,9 @@ namespace AzToolsFramework } } - QPixmap Thumbnail::GetPixmap() const + const QPixmap& Thumbnail::GetPixmap() const { - return GetPixmap(QSize(DefaultIconSize, DefaultIconSize)); - } - - QPixmap Thumbnail::GetPixmap(const QSize& size) const - { - if (m_icon.isNull()) - { - return m_pixmap; - } - - return m_icon.pixmap(size); + return m_pixmap; } SharedThumbnailKey Thumbnail::GetKey() const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.h index 671960bea5..a517625e61 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.h @@ -19,7 +19,6 @@ AZ_PUSH_DISABLE_WARNING(4127 4251 4800, "-Wunknown-warning-option") // 4127: con // 4800: 'int': forcing value to bool 'true' or 'false' (performance warning) #include #include -#include #include AZ_POP_DISABLE_WARNING #endif @@ -86,12 +85,11 @@ namespace AzToolsFramework Failed }; - Thumbnail(SharedThumbnailKey key, int thumbnailSize); + Thumbnail(SharedThumbnailKey key); ~Thumbnail() override; bool operator == (const Thumbnail& other) const; void Load(); - virtual QPixmap GetPixmap() const; - virtual QPixmap GetPixmap(const QSize& size) const; + const QPixmap& GetPixmap() const; virtual void UpdateTime(float /*deltaTime*/) {} SharedThumbnailKey GetKey() const; State GetState() const; @@ -105,10 +103,8 @@ namespace AzToolsFramework protected: QFutureWatcher m_watcher; State m_state; - int m_thumbnailSize; SharedThumbnailKey m_key; QPixmap m_pixmap; - QIcon m_icon; virtual void LoadThread() {} }; @@ -122,7 +118,6 @@ namespace AzToolsFramework ThumbnailProvider() = default; virtual ~ThumbnailProvider() = default; virtual bool GetThumbnail(SharedThumbnailKey key, SharedThumbnail& thumbnail) = 0; - virtual void SetThumbnailSize(int thumbnailSize) = 0; //! Priority identifies ThumbnailProvider order in ThumbnailContext //! Higher priority means this ThumbnailProvider will take precedence in generating a thumbnail when //! a supplied ThumbnailKey is supported by multiple providers. @@ -185,10 +180,7 @@ namespace AzToolsFramework bool GetThumbnail(SharedThumbnailKey key, SharedThumbnail& thumbnail) override; - void SetThumbnailSize(int thumbnailSize) override; - protected: - int m_thumbnailSize; AZStd::unordered_map m_cache; //! Check if thumbnail key is handled by this provider, overload in derived class diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.inl index 3182248017..b121f56a75 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.inl +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/Thumbnail.inl @@ -18,7 +18,6 @@ namespace AzToolsFramework { template ThumbnailCache::ThumbnailCache() - : m_thumbnailSize(0) { BusConnect(); } @@ -49,17 +48,11 @@ namespace AzToolsFramework } if (IsSupportedThumbnail(key)) { - thumbnail = QSharedPointer(new ThumbnailType(key, m_thumbnailSize)); + thumbnail = QSharedPointer(new ThumbnailType(key)); m_cache[key] = thumbnail; return true; } return false; } - - template - void ThumbnailCache::SetThumbnailSize(int thumbnailSize) - { - m_thumbnailSize = thumbnailSize; - } } // namespace Thumbnailer } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.cpp index ae6d7c1178..1cee6946e7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.cpp @@ -24,10 +24,9 @@ namespace AzToolsFramework { namespace Thumbnailer { - ThumbnailContext::ThumbnailContext(int thumbnailSize) - : m_missingThumbnail(new MissingThumbnail(thumbnailSize)) - , m_loadingThumbnail(new LoadingThumbnail(thumbnailSize)) - , m_thumbnailSize(thumbnailSize) + ThumbnailContext::ThumbnailContext() + : m_missingThumbnail(new MissingThumbnail()) + , m_loadingThumbnail(new LoadingThumbnail()) , m_threadPool(this) { ThumbnailContextRequestBus::Handler::BusConnect(); @@ -120,7 +119,6 @@ namespace AzToolsFramework return; } - providerToAdd->SetThumbnailSize(m_thumbnailSize); m_providers.insert(providerToAdd); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.h index 6ba3d637f6..0267d76365 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailContext.h @@ -45,9 +45,9 @@ namespace AzToolsFramework { Q_OBJECT public: - AZ_CLASS_ALLOCATOR(ThumbnailContext, AZ::SystemAllocator, 0) + AZ_CLASS_ALLOCATOR(ThumbnailContext, AZ::SystemAllocator, 0); - explicit ThumbnailContext(int thumbnailSize); + ThumbnailContext(); ~ThumbnailContext() override; //! Is the thumbnail currently loading or is about to load. @@ -82,8 +82,6 @@ namespace AzToolsFramework SharedThumbnail m_missingThumbnail; //! Default loading thumbnail used when thumbnail is found by is not yet generated SharedThumbnail m_loadingThumbnail; - //! Thumbnail size (width and height in pixels) - int m_thumbnailSize; //! There is only a limited number of threads on global threadPool, because there can be many thumbnails rendering at once //! an individual threadPool is needed to avoid deadlocks QThreadPool m_threadPool; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerBus.h index 02264e61f8..d191d9c043 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerBus.h @@ -40,7 +40,7 @@ namespace AzToolsFramework { public: //! Add thumbnail context - virtual void RegisterContext(const char* contextName, int thumbnailSize) = 0; + virtual void RegisterContext(const char* contextName) = 0; //! Remove thumbnail context and all associated ThumbnailProviders virtual void UnregisterContext(const char* contextName) = 0; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.cpp index 044f995a5a..36c9e35314 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.cpp @@ -32,8 +32,7 @@ namespace AzToolsFramework void ThumbnailerComponent::Activate() { - int thumbnailSize = qApp->style()->pixelMetric(QStyle::PM_SmallIconSize); - RegisterContext(ThumbnailContext::DefaultContext, thumbnailSize); + RegisterContext(ThumbnailContext::DefaultContext); BusConnect(); } @@ -62,10 +61,10 @@ namespace AzToolsFramework provided.push_back(AZ_CRC("ThumbnailerService", 0x65422b97)); } - void ThumbnailerComponent::RegisterContext(const char* contextName, int thumbnailSize) + void ThumbnailerComponent::RegisterContext(const char* contextName) { AZ_Assert(m_thumbnails.find(contextName) == m_thumbnails.end(), "Context %s already registered", contextName); - m_thumbnails[contextName] = AZStd::make_shared(thumbnailSize); + m_thumbnails[contextName] = AZStd::make_shared(); } void ThumbnailerComponent::UnregisterContext(const char* contextName) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.h index 814781ea9a..6575f277e9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Thumbnails/ThumbnailerComponent.h @@ -43,7 +43,7 @@ namespace AzToolsFramework ////////////////////////////////////////////////////////////////////////// // ThumbnailerRequests ////////////////////////////////////////////////////////////////////////// - void RegisterContext(const char* contextName, int thumbnailSize) override; + void RegisterContext(const char* contextName) override; void UnregisterContext(const char* contextName) override; bool HasContext(const char* contextName) const override; void RegisterThumbnailProvider(SharedThumbnailProvider provider, const char* contextName) override; diff --git a/Code/Framework/AzToolsFramework/Tests/ThumbnailerTests.cpp b/Code/Framework/AzToolsFramework/Tests/ThumbnailerTests.cpp index 2c17334043..195e9c54cc 100644 --- a/Code/Framework/AzToolsFramework/Tests/ThumbnailerTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/ThumbnailerTests.cpp @@ -85,8 +85,6 @@ namespace UnitTest { constexpr const char* contextName1 = "Context1"; constexpr const char* contextName2 = "Context2"; - constexpr int thumbnailSize1 = 128; - constexpr int thumbnailSize2 = 256; auto checkHasContext = [](const char* contextName) { @@ -98,12 +96,12 @@ namespace UnitTest EXPECT_FALSE(checkHasContext(contextName1)); EXPECT_FALSE(checkHasContext(contextName2)); - AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1, thumbnailSize1); + AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1); EXPECT_TRUE(checkHasContext(contextName1)); EXPECT_FALSE(checkHasContext(contextName2)); - AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName2, thumbnailSize2); + AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName2); EXPECT_TRUE(checkHasContext(contextName1)); EXPECT_TRUE(checkHasContext(contextName2)); @@ -123,8 +121,6 @@ namespace UnitTest { constexpr const char* contextName1 = "Context1"; constexpr const char* contextName2 = "Context2"; - constexpr int thumbnailSize1 = 128; - constexpr int thumbnailSize2 = 256; auto checkHasContext = [](const char* contextName) { @@ -133,8 +129,8 @@ namespace UnitTest return hasContext; }; - AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1, thumbnailSize1); - AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName2, thumbnailSize2); + AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1); + AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName2); EXPECT_TRUE(checkHasContext(contextName1)); EXPECT_TRUE(checkHasContext(contextName2)); @@ -149,12 +145,11 @@ namespace UnitTest TEST_F(ThumbnailerTests, ThumbnailerComponent_RegisterContextTwice_Assert) { constexpr const char* contextName1 = "Context1"; - constexpr int thumbnailSize1 = 128; - AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1, thumbnailSize1); + AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1); AZ_TEST_START_TRACE_SUPPRESSION; - AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1, thumbnailSize1); + AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Broadcast(&AzToolsFramework::Thumbnailer::ThumbnailerRequests::RegisterContext, contextName1); AZ_TEST_STOP_TRACE_SUPPRESSION(1); } diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index 36d6a432f5..93b5079929 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -46,6 +45,23 @@ extern "C" void CreateStaticModules(AZStd::vector& modulesOut); namespace { + void ExecuteConsoleCommandFile(AzFramework::Application& application) + { + const AZStd::string_view customConCmdKey = "console-command-file"; + const AZ::CommandLine* commandLine = application.GetCommandLine(); + AZStd::size_t numSwitchValues = commandLine->GetNumSwitchValues(customConCmdKey); + if (numSwitchValues > 0) + { + // The expectations for command line parameters is that the "last one wins" + // That way it allows users and test scripts to override previous command line options by just listing them later on the invocation line + const AZStd::string& consoleCmd = commandLine->GetSwitchValue(customConCmdKey, numSwitchValues - 1); + if (!consoleCmd.empty()) + { + AZ::Interface::Get()->ExecuteConfigFile(consoleCmd.c_str()); + } + } + } + #if AZ_TRAIT_LAUNCHER_USE_CRY_DYNAMIC_MODULE_HANDLE // mimics AZ::DynamicModuleHandle but uses CryLibrary under the hood, // which is necessary to properly load legacy Cry libraries on some platforms @@ -637,7 +653,11 @@ namespace O3DELauncher if (gEnv && gEnv->pConsole) { // Execute autoexec.cfg to load the initial level - gEnv->pConsole->ExecuteString("exec autoexec.cfg"); + AZ::Interface::Get()->ExecuteConfigFile("autoexec.cfg"); + + // Find out if console command file was passed + // via --console-command-file=%filename% and execute it + ExecuteConsoleCommandFile(gameApplication); gEnv->pSystem->ExecuteCommandLine(false); diff --git a/Code/Sandbox/Editor/EditorViewportWidget.cpp b/Code/Sandbox/Editor/EditorViewportWidget.cpp index 6a32a6abb1..da56c887a4 100644 --- a/Code/Sandbox/Editor/EditorViewportWidget.cpp +++ b/Code/Sandbox/Editor/EditorViewportWidget.cpp @@ -1509,10 +1509,10 @@ bool EditorViewportWidget::AddCameraMenuItems(QMenu* menu) } action = customCameraMenu->addAction(tr("Look through entity")); - AzToolsFramework::EntityIdList selectedEntityList; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntityList, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - action->setCheckable(selectedEntityList.size() > 0 || m_viewSourceType == ViewSourceType::AZ_Entity); - action->setEnabled(selectedEntityList.size() > 0 || m_viewSourceType == ViewSourceType::AZ_Entity); + bool areAnyEntitiesSelected = false; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(areAnyEntitiesSelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected); + action->setCheckable(areAnyEntitiesSelected || m_viewSourceType == ViewSourceType::AZ_Entity); + action->setEnabled(areAnyEntitiesSelected || m_viewSourceType == ViewSourceType::AZ_Entity); action->setChecked(m_viewSourceType == ViewSourceType::AZ_Entity); connect(action, &QAction::triggered, this, [this](bool isChecked) { diff --git a/Code/Sandbox/Editor/EditorViewportWidget.h b/Code/Sandbox/Editor/EditorViewportWidget.h index 1244e61242..b0dd2a286c 100644 --- a/Code/Sandbox/Editor/EditorViewportWidget.h +++ b/Code/Sandbox/Editor/EditorViewportWidget.h @@ -234,11 +234,8 @@ public: QPoint ViewportToWidget(const QPoint& point) const; QSize WidgetToViewport(const QSize& size) const; - /// Take raw input and create a final mouse interaction. - /// @attention Do not map **point** from widget to viewport explicitly, - /// this is handled internally by BuildMouseInteraction - just pass directly. AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteraction( - Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point); + Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point) override; void SetPlayerPos() { diff --git a/Code/Sandbox/Editor/MainWindow.cpp b/Code/Sandbox/Editor/MainWindow.cpp index 902b04f266..2915ca9c2e 100644 --- a/Code/Sandbox/Editor/MainWindow.cpp +++ b/Code/Sandbox/Editor/MainWindow.cpp @@ -756,6 +756,7 @@ void MainWindow::InitActions() am->AddAction(ID_TOOLBAR_WIDGET_SNAP_GRID, QString()); am->AddAction(ID_TOOLBAR_WIDGET_ENVIRONMENT_MODE, QString()); am->AddAction(ID_TOOLBAR_WIDGET_DEBUG_MODE, QString()); + am->AddAction(ID_TOOLBAR_WIDGET_SPACER_RIGHT, QString()); // File actions am->AddAction(ID_FILE_NEW, tr("New Level")) @@ -1170,14 +1171,17 @@ void MainWindow::InitActions() am->AddAction(ID_AUDIO_REFRESH_AUDIO_SYSTEM, tr("Refresh Audio")) .Connect(&QAction::triggered, this, &MainWindow::OnRefreshAudioSystem); - // Fame actions + // Game actions am->AddAction(ID_VIEW_SWITCHTOGAME, tr("Play &Game")) + .SetIcon(QIcon(":/stylesheet/img/UI20/toolbar/Play.svg")) .SetShortcut(tr("Ctrl+G")) .SetToolTip(tr("Play Game (Ctrl+G)")) .SetStatusTip(tr("Activate the game input mode")) .SetApplyHoverEffect() .SetCheckable(true) .RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdatePlayGame); + am->AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, tr("Play Console")) + .SetText(tr("Play Console")); am->AddAction(ID_SWITCH_PHYSICS, tr("Simulate")) .SetShortcut(tr("Ctrl+P")) .SetToolTip(tr("Simulate (Ctrl+P)")) @@ -1489,6 +1493,14 @@ QToolButton* MainWindow::CreateDebugModeButton() return debugModeButton; } +QWidget* MainWindow::CreateSpacerRightWidget() +{ + QWidget* spacer = new QWidget(); + spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + spacer->setVisible(true); + return spacer; +} + void MainWindow::InitEnvironmentModeMenu(CVarMenu* environmentModeMenu) { environmentModeMenu->clear(); @@ -2395,6 +2407,9 @@ QWidget* MainWindow::CreateToolbarWidget(int actionId) case ID_TOOLBAR_WIDGET_DEBUG_MODE: w = CreateDebugModeButton(); break; + case ID_TOOLBAR_WIDGET_SPACER_RIGHT: + w = CreateSpacerRightWidget(); + break; default: qWarning() << Q_FUNC_INFO << "Unknown id " << actionId; return nullptr; diff --git a/Code/Sandbox/Editor/MainWindow.h b/Code/Sandbox/Editor/MainWindow.h index 3e652888fe..cafa719589 100644 --- a/Code/Sandbox/Editor/MainWindow.h +++ b/Code/Sandbox/Editor/MainWindow.h @@ -215,6 +215,7 @@ private: QWidget* CreateSnapToGridWidget(); QWidget* CreateSnapToAngleWidget(); + QWidget* CreateSpacerRightWidget(); QToolButton* CreateUndoRedoButton(int command); diff --git a/Code/Sandbox/Editor/RenderViewport.h b/Code/Sandbox/Editor/RenderViewport.h index 664ed73abc..2edbd86770 100644 --- a/Code/Sandbox/Editor/RenderViewport.h +++ b/Code/Sandbox/Editor/RenderViewport.h @@ -238,11 +238,8 @@ public: QPoint ViewportToWidget(const QPoint& point) const; QSize WidgetToViewport(const QSize& size) const; - /// Take raw input and create a final mouse interaction. - /// @attention Do not map **point** from widget to viewport explicitly, - /// this is handled internally by BuildMouseInteraction - just pass directly. AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteraction( - Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point); + Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point) override; void SetPlayerPos() { diff --git a/Code/Sandbox/Editor/Resource.h b/Code/Sandbox/Editor/Resource.h index 8c4b09ae67..143b4fc0c4 100644 --- a/Code/Sandbox/Editor/Resource.h +++ b/Code/Sandbox/Editor/Resource.h @@ -397,4 +397,6 @@ #define ID_TOOLBAR_WIDGET_SNAP_GRID 50008 #define ID_TOOLBAR_WIDGET_ENVIRONMENT_MODE 50011 #define ID_TOOLBAR_WIDGET_DEBUG_MODE 50012 +#define ID_TOOLBAR_WIDGET_SPACER_RIGHT 50013 +#define ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL 50014 #define ID_TOOLBAR_WIDGET_LAST 50020 diff --git a/Code/Sandbox/Editor/ToolbarManager.cpp b/Code/Sandbox/Editor/ToolbarManager.cpp index 6977121933..c1758405ca 100644 --- a/Code/Sandbox/Editor/ToolbarManager.cpp +++ b/Code/Sandbox/Editor/ToolbarManager.cpp @@ -511,6 +511,7 @@ void ToolbarManager::InitializeStandardToolbars() m_standardToolbars.reserve(5 + macroToolbars.size()); m_standardToolbars.push_back(GetEditModeToolbar()); m_standardToolbars.push_back(GetObjectToolbar()); + m_standardToolbars.push_back(GetPlayConsoleToolbar()); IPlugin* pGamePlugin = GetIEditor()->GetPluginManager()->GetPluginByGUID("{71CED8AB-54E2-4739-AA78-7590A5DC5AEB}"); IPlugin* pDescriptionEditorPlugin = GetIEditor()->GetPluginManager()->GetPluginByGUID("{4B9B7074-2D58-4AFD-BBE1-BE469D48456A}"); @@ -591,8 +592,6 @@ AmazonToolbar ToolbarManager::GetEditModeToolbar() const t.AddAction(ID_EDITMODE_ROTATE, ORIGINAL_TOOLBAR_VERSION); t.AddAction(ID_EDITMODE_SCALE, ORIGINAL_TOOLBAR_VERSION); - t.AddAction(ID_VIEW_SWITCHTOGAME, TOOLBARS_WITH_PLAY_GAME); - t.AddAction(ID_TOOLBAR_SEPARATOR, ORIGINAL_TOOLBAR_VERSION); t.AddAction(ID_TOOLBAR_WIDGET_SNAP_GRID, ORIGINAL_TOOLBAR_VERSION); t.AddAction(ID_TOOLBAR_WIDGET_SNAP_ANGLE, ORIGINAL_TOOLBAR_VERSION); @@ -622,6 +621,18 @@ AmazonToolbar ToolbarManager::GetObjectToolbar() const return t; } +AmazonToolbar ToolbarManager::GetPlayConsoleToolbar() const +{ + AmazonToolbar t = AmazonToolbar("PlayConsole", QObject::tr("Play Console")); + t.SetMainToolbar(true); + + t.AddAction(ID_TOOLBAR_WIDGET_SPACER_RIGHT, ORIGINAL_TOOLBAR_VERSION); + t.AddAction(ID_TOOLBAR_SEPARATOR, ORIGINAL_TOOLBAR_VERSION); + t.AddAction(ID_TOOLBAR_WIDGET_PLAYCONSOLE_LABEL, ORIGINAL_TOOLBAR_VERSION); + t.AddAction(ID_VIEW_SWITCHTOGAME, TOOLBARS_WITH_PLAY_GAME); + return t; +} + AmazonToolbar ToolbarManager::GetEditorsToolbar() const { AmazonToolbar t = AmazonToolbar("Editors", QObject::tr("Editors Toolbar")); @@ -753,7 +764,7 @@ void ToolbarManager::InstantiateToolbars() for (int i = 0; i < numToolbars; ++i) { InstantiateToolbar(i); - if (i == 1) + if (i == 2) { // Hack. Just copying how it was m_mainWindow->addToolBarBreak(); diff --git a/Code/Sandbox/Editor/ToolbarManager.h b/Code/Sandbox/Editor/ToolbarManager.h index a0a9c83029..70228636f5 100644 --- a/Code/Sandbox/Editor/ToolbarManager.h +++ b/Code/Sandbox/Editor/ToolbarManager.h @@ -167,6 +167,7 @@ public: AmazonToolbar GetObjectToolbar() const; AmazonToolbar GetEditorsToolbar() const; AmazonToolbar GetMiscToolbar() const; + AmazonToolbar GetPlayConsoleToolbar() const; private: Q_DISABLE_COPY(ToolbarManager); diff --git a/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp b/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp index a7a801e35a..06184c0fc3 100644 --- a/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp +++ b/Code/Sandbox/Editor/TrackView/TrackViewDialog.cpp @@ -807,18 +807,11 @@ void CTrackViewDialog::UpdateActions() m_actions[ID_TRACKVIEW_MUTE_ALL]->setEnabled(true); m_actions[ID_ADDSCENETRACK]->setEnabled(true); - AzToolsFramework::EntityIdList entityIds; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( - entityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + bool areAnyEntitiesSelected = false; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult( + areAnyEntitiesSelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected); - if (entityIds.empty()) - { - m_actions[ID_ADDNODE]->setEnabled(false); - } - else - { - m_actions[ID_ADDNODE]->setEnabled(true); - } + m_actions[ID_ADDNODE]->setEnabled(areAnyEntitiesSelected); } else { @@ -1569,12 +1562,12 @@ void CTrackViewDialog::OnAddSelectedNode() sequence->MarkAsModified(); } - AzToolsFramework::EntityIdList entityIds; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( - entityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + int selectedEntitiesCount = 0; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult( + selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount); // check to make sure all nodes were added and notify user if they weren't - if (addedNodes.GetCount() != entityIds.size()) + if (addedNodes.GetCount() != selectedEntitiesCount) { IMovieSystem* movieSystem = GetIEditor()->GetMovieSystem(); diff --git a/Code/Sandbox/Editor/TrackView/TrackViewNodes.cpp b/Code/Sandbox/Editor/TrackView/TrackViewNodes.cpp index 268ae229b5..3979bf3cca 100644 --- a/Code/Sandbox/Editor/TrackView/TrackViewNodes.cpp +++ b/Code/Sandbox/Editor/TrackView/TrackViewNodes.cpp @@ -1137,12 +1137,12 @@ void CTrackViewNodesCtrl::OnNMRclick(QPoint point) CTrackViewAnimNodeBundle addedNodes = groupNode->AddSelectedEntities(m_pTrackViewDialog->GetDefaultTracksForEntityNode()); undoBatch.MarkEntityDirty(groupNode->GetSequence()->GetSequenceComponentEntityId()); - AzToolsFramework::EntityIdList entityIds; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( - entityIds, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); + int selectedEntitiesCount = 0; + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult( + selectedEntitiesCount, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntitiesCount); // check to make sure all nodes were added and notify user if they weren't - if (addedNodes.GetCount() != entityIds.size()) + if (addedNodes.GetCount() != selectedEntitiesCount) { IMovieSystem* movieSystem = GetIEditor()->GetMovieSystem(); diff --git a/Code/Sandbox/Editor/Viewport.cpp b/Code/Sandbox/Editor/Viewport.cpp index 1041a4f086..37a9ee5f29 100644 --- a/Code/Sandbox/Editor/Viewport.cpp +++ b/Code/Sandbox/Editor/Viewport.cpp @@ -21,6 +21,9 @@ // AzQtComponents #include +#include +#include + // Editor #include "ViewManager.h" #include "Include/ITransformManipulator.h" @@ -1091,6 +1094,13 @@ void QtViewport::SetAxisConstrain(int axis) m_activeAxis = axis; }; +AzToolsFramework::ViewportInteraction::MouseInteraction QtViewport::BuildMouseInteraction( + [[maybe_unused]] Qt::MouseButtons buttons, [[maybe_unused]] Qt::KeyboardModifiers modifiers, [[maybe_unused]] const QPoint& point) +{ + // Implemented by sub-class + return AzToolsFramework::ViewportInteraction::MouseInteraction(); +} + ////////////////////////////////////////////////////////////////////////// bool QtViewport::HitTest(const QPoint& point, HitContext& hitInfo) { @@ -1103,7 +1113,51 @@ bool QtViewport::HitTest(const QPoint& point, HitContext& hitInfo) hitInfo.bUseSelectionHelpers = true; } - return GetIEditor()->GetObjectManager()->HitTest(hitInfo); + const int viewportId = GetViewportId(); + + AzToolsFramework::EntityIdList visibleEntityIds; + AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Event( + viewportId, + &AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequests::FindVisibleEntities, + visibleEntityIds); + + // Look through all visible entities to find the closest one to the specified mouse point + using namespace AzToolsFramework::ViewportInteraction; + AZ::EntityId entityIdUnderCursor; + float closestDistance = std::numeric_limits::max(); + MouseInteraction mouseInteraction = BuildMouseInteraction(QGuiApplication::mouseButtons(), + QGuiApplication::queryKeyboardModifiers(), + point); + for (auto entityId : visibleEntityIds) + { + using AzFramework::ViewportInfo; + // Check if components provide an aabb + if (const AZ::Aabb aabb = AzToolsFramework::CalculateEditorEntitySelectionBounds(entityId, ViewportInfo{ viewportId }); + aabb.IsValid()) + { + // Coarse grain check + if (AzToolsFramework::AabbIntersectMouseRay(mouseInteraction, aabb)) + { + // If success, pick against specific component + if (AzToolsFramework::PickEntity( + entityId, mouseInteraction, + closestDistance, viewportId)) + { + entityIdUnderCursor = entityId; + } + } + } + } + + // If we hit a valid Entity, then store the distance in the HitContext + // so that the caller can use this for calculations + if (entityIdUnderCursor.IsValid()) + { + hitInfo.dist = closestDistance; + return true; + } + + return false; } ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Sandbox/Editor/Viewport.h b/Code/Sandbox/Editor/Viewport.h index 9979a3bb0a..bd7c749573 100644 --- a/Code/Sandbox/Editor/Viewport.h +++ b/Code/Sandbox/Editor/Viewport.h @@ -17,6 +17,7 @@ #pragma once #if !defined(Q_MOC_RUN) +#include #include #include #include "IPostRenderer.h" @@ -405,6 +406,12 @@ public: void SetAxisConstrain(int axis); + /// Take raw input and create a final mouse interaction. + /// @attention Do not map **point** from widget to viewport explicitly, + /// this is handled internally by BuildMouseInteraction - just pass directly. + virtual AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteraction( + Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, const QPoint& point); + ////////////////////////////////////////////////////////////////////////// // Selection. ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp index e270a9133b..29a0570d39 100644 --- a/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp @@ -44,7 +44,4 @@ ConnectionUnitTest::~ConnectionUnitTest() } - - -REGISTER_UNIT_TEST(ConnectionUnitTest) - +// REGISTER_UNIT_TEST(ConnectionUnitTest) // disabling due to intermittent test failure - LYN-3368 diff --git a/Code/Tools/Standalone/Source/ThumbnailerNullComponent.cpp b/Code/Tools/Standalone/Source/ThumbnailerNullComponent.cpp index 0818291a33..e33cb8aa51 100644 --- a/Code/Tools/Standalone/Source/ThumbnailerNullComponent.cpp +++ b/Code/Tools/Standalone/Source/ThumbnailerNullComponent.cpp @@ -20,10 +20,8 @@ namespace LUAEditor { namespace Thumbnailer { - const int DEFAULT_THUMBNAIL_SIZE = 100; - ThumbnailerNullComponent::ThumbnailerNullComponent() : - m_nullThumbnail(new AzToolsFramework::Thumbnailer::MissingThumbnail(DEFAULT_THUMBNAIL_SIZE)) + m_nullThumbnail(new AzToolsFramework::Thumbnailer::MissingThumbnail()) { } @@ -53,7 +51,7 @@ namespace LUAEditor services.push_back(AZ_CRC("ThumbnailerService", 0x65422b97)); } - void ThumbnailerNullComponent::RegisterContext(const char* /*contextName*/, int /*thumbnailSize*/) + void ThumbnailerNullComponent::RegisterContext(const char* /*contextName*/) { } diff --git a/Code/Tools/Standalone/Source/ThumbnailerNullComponent.h b/Code/Tools/Standalone/Source/ThumbnailerNullComponent.h index bb56a27e8f..9d0c638305 100644 --- a/Code/Tools/Standalone/Source/ThumbnailerNullComponent.h +++ b/Code/Tools/Standalone/Source/ThumbnailerNullComponent.h @@ -42,7 +42,7 @@ namespace LUAEditor ////////////////////////////////////////////////////////////////////////// // ThumbnailerRequests ////////////////////////////////////////////////////////////////////////// - void RegisterContext(const char* contextName, int thumbnailSize) override; + void RegisterContext(const char* contextName) override; void UnregisterContext(const char* contextName) override; bool HasContext(const char* contextName) const override; void RegisterThumbnailProvider(AzToolsFramework::Thumbnailer::SharedThumbnailProvider provider, const char* contextName) override; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.cpp index a586de9724..dda4587588 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.cpp @@ -22,13 +22,13 @@ namespace ImageProcessingAtom { namespace Thumbnails { - const int ImageThumbnailSize = 200; + static constexpr const int ImageThumbnailSize = 256; ////////////////////////////////////////////////////////////////////////// // ImageThumbnail ////////////////////////////////////////////////////////////////////////// - ImageThumbnail::ImageThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) + ImageThumbnail::ImageThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key) + : Thumbnail(key) { auto sourceKey = azrtti_cast(key.data()); if (sourceKey) @@ -66,7 +66,7 @@ namespace ImageProcessingAtom AzToolsFramework::Thumbnailer::ThumbnailerRendererRequestBus::QueueEvent( AZ::RPI::StreamingImageAsset::RTTI_Type(), &AzToolsFramework::Thumbnailer::ThumbnailerRendererRequests::RenderThumbnail, m_key, - m_thumbnailSize); + ImageThumbnailSize); // wait for response from thumbnail renderer m_renderWait.acquire(); } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.h index 85ce9d59e6..a73a742b83 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Thumbnail/ImageThumbnail.h @@ -34,7 +34,7 @@ namespace ImageProcessingAtom { Q_OBJECT public: - ImageThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key, int thumbnailSize); + ImageThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key); ~ImageThumbnail() override; //! AzToolsFramework::ThumbnailerRendererNotificationBus::Handler overrides... diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp index 0dec1c6d23..3c4134b7e0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialBrowserWidget.cpp @@ -110,30 +110,19 @@ namespace MaterialEditor { using namespace AzToolsFramework::AssetBrowser; - // Material Browser uses the following filters: - // 1. [All source files (no products) that contain products matching the assetType specified by searchWidget (default is materials and textures)] - // 2. [All folders (including empty folders)] - // 3. [All Sources and folders matching the search text typed in search widget] - // Final filter = ((1 OR 2) AND 3) - QSharedPointer sourceFilter(new EntryTypeFilter); sourceFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Source); - QSharedPointer assetTypeFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::AND)); - assetTypeFilter->AddFilter(sourceFilter); - assetTypeFilter->AddFilter(m_ui->m_searchWidget->GetTypesFilter()); - QSharedPointer folderFilter(new EntryTypeFilter); folderFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Folder); QSharedPointer sourceOrFolderFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::OR)); - sourceOrFolderFilter->AddFilter(assetTypeFilter); + sourceOrFolderFilter->AddFilter(sourceFilter); sourceOrFolderFilter->AddFilter(folderFilter); QSharedPointer finalFilter(new CompositeFilter(CompositeFilter::LogicOperatorType::AND)); finalFilter->AddFilter(sourceOrFolderFilter); - finalFilter->AddFilter(m_ui->m_searchWidget->GetStringFilter()); - finalFilter->SetFilterPropagation(AssetBrowserEntryFilter::PropagateDirection::Down); + finalFilter->AddFilter(m_ui->m_searchWidget->GetFilter()); return finalFilter; } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.cpp index 21f592db4a..b0b9a39780 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.cpp @@ -21,13 +21,13 @@ namespace AZ { namespace Thumbnails { - const int MaterialThumbnailSize = 200; + static constexpr const int MaterialThumbnailSize = 512; // 512 is the default size in render to texture pass ////////////////////////////////////////////////////////////////////////// // MaterialThumbnail ////////////////////////////////////////////////////////////////////////// - MaterialThumbnail::MaterialThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) + MaterialThumbnail::MaterialThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key) + : Thumbnail(key) { m_assetId = GetAssetId(key, RPI::MaterialAsset::RTTI_Type()); if (!m_assetId.IsValid()) @@ -47,7 +47,7 @@ namespace AZ RPI::MaterialAsset::RTTI_Type(), &AzToolsFramework::Thumbnailer::ThumbnailerRendererRequests::RenderThumbnail, m_key, - m_thumbnailSize); + MaterialThumbnailSize); // wait for response from thumbnail renderer m_renderWait.acquire(); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.h index 249426dfe8..612e44fb98 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/MaterialThumbnail.h @@ -36,7 +36,7 @@ namespace AZ { Q_OBJECT public: - MaterialThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key, int thumbnailSize); + MaterialThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key); ~MaterialThumbnail() override; //! AzToolsFramework::ThumbnailerRendererNotificationBus::Handler overrides... diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.cpp index 315eb2a892..fed46f4608 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.cpp @@ -22,13 +22,13 @@ namespace AZ { namespace Thumbnails { - const int MeshThumbnailSize = 200; + static constexpr const int MeshThumbnailSize = 512; // 512 is the default size in render to texture pass ////////////////////////////////////////////////////////////////////////// // MeshThumbnail ////////////////////////////////////////////////////////////////////////// - MeshThumbnail::MeshThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key, int thumbnailSize) - : Thumbnail(key, thumbnailSize) + MeshThumbnail::MeshThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key) + : Thumbnail(key) { m_assetId = GetAssetId(key, RPI::ModelAsset::RTTI_Type()); if (!m_assetId.IsValid()) @@ -48,7 +48,7 @@ namespace AZ RPI::ModelAsset::RTTI_Type(), &AzToolsFramework::Thumbnailer::ThumbnailerRendererRequests::RenderThumbnail, m_key, - m_thumbnailSize); + MeshThumbnailSize); // wait for response from thumbnail renderer m_renderWait.acquire(); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.h index 68c7825aaa..75b6c8cf68 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshThumbnail.h @@ -35,7 +35,7 @@ namespace AZ { Q_OBJECT public: - MeshThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key, int thumbnailSize); + MeshThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey key); ~MeshThumbnail() override; //! AzToolsFramework::ThumbnailerRendererNotificationBus::Handler overrides... diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/CommonThumbnailRenderer.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/CommonThumbnailRenderer.cpp index 6dff92c170..06d54a20b3 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/CommonThumbnailRenderer.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/CommonThumbnailRenderer.cpp @@ -82,8 +82,9 @@ namespace AZ return m_data; } - void CommonThumbnailRenderer::RenderThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey, [[maybe_unused]] int thumbnailSize) + void CommonThumbnailRenderer::RenderThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey, int thumbnailSize) { + m_data->m_thumbnailSize = thumbnailSize; m_data->m_thumbnailQueue.push(thumbnailKey); if (m_currentStep == Step::None) { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererData.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererData.h index 8a7bace6aa..28e98082d0 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererData.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererData.h @@ -52,6 +52,7 @@ namespace AZ double m_simulateTime = 0.0f; float m_deltaTime = 0.0f; + int m_thumbnailSize = 512; //! Incoming thumbnail requests are appended to this queue and processed one at a time in OnTick function. AZStd::queue m_thumbnailQueue; diff --git a/Gems/Multiplayer/Code/Include/IMultiplayer.h b/Gems/Multiplayer/Code/Include/IMultiplayer.h index 67776e15be..47d0d5a05e 100644 --- a/Gems/Multiplayer/Code/Include/IMultiplayer.h +++ b/Gems/Multiplayer/Code/Include/IMultiplayer.h @@ -74,6 +74,10 @@ namespace Multiplayer //! @param handler The SessionShutdownEvent handler to add virtual void AddSessionShutdownHandler(SessionShutdownEvent::Handler& handler) = 0; + //! Sends a packet telling if entity update messages can be sent + //! @param readyForEntityUpdates Ready for entity updates or not + virtual void SendReadyForEntityUpdates(bool readyForEntityUpdates) = 0; + //! Returns the gem name associated with the provided component index. //! @param netComponentId the componentId to return the gem name of //! @return the name of the gem that contains the requested component diff --git a/Gems/Multiplayer/Code/Include/MultiplayerTypes.h b/Gems/Multiplayer/Code/Include/MultiplayerTypes.h index ca3734e4f0..5c690958b5 100644 --- a/Gems/Multiplayer/Code/Include/MultiplayerTypes.h +++ b/Gems/Multiplayer/Code/Include/MultiplayerTypes.h @@ -73,6 +73,12 @@ namespace Multiplayer True }; + enum class AutoActivate : uint8_t + { + DoNotActivate, + Activate + }; + // This is just a placeholder // The level/prefab cooking will devise the actual solution for identifying a dynamically spawnable entity within a prefab struct PrefabEntityId diff --git a/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml b/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml index 95204a3c3f..5de466899c 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml +++ b/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml @@ -14,6 +14,10 @@ + + + + diff --git a/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.h b/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.h index b63ffee9a3..76a809b351 100644 --- a/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.h +++ b/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.h @@ -33,10 +33,10 @@ namespace Multiplayer AzNetworking::IConnection* GetConnection() const override; EntityReplicationManager& GetReplicationManager() override; void Update(AZ::TimeMs serverGameTimeMs) override; + bool CanSendUpdates() const override; + void SetCanSendUpdates(bool canSendUpdates) override; //! @} - bool CanSendUpdates(); - private: EntityReplicationManager m_entityReplicationManager; AzNetworking::IConnection* m_connection = nullptr; diff --git a/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.inl b/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.inl index 1ee5711341..6d4a332b6e 100644 --- a/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.inl +++ b/Gems/Multiplayer/Code/Source/ConnectionData/ClientToServerConnectionData.inl @@ -12,8 +12,13 @@ namespace Multiplayer { - inline bool ClientToServerConnectionData::CanSendUpdates() + inline bool ClientToServerConnectionData::CanSendUpdates() const { return m_canSendUpdates; } + + inline void ClientToServerConnectionData::SetCanSendUpdates(bool canSendUpdates) + { + m_canSendUpdates = canSendUpdates; + } } diff --git a/Gems/Multiplayer/Code/Source/ConnectionData/IConnectionData.h b/Gems/Multiplayer/Code/Source/ConnectionData/IConnectionData.h index ebff75fd9b..a7ceffd289 100644 --- a/Gems/Multiplayer/Code/Source/ConnectionData/IConnectionData.h +++ b/Gems/Multiplayer/Code/Source/ConnectionData/IConnectionData.h @@ -44,5 +44,13 @@ namespace Multiplayer //! Creates and manages sending updates to the remote endpoint. //! @param serverGameTimeMs current server game time in milliseconds virtual void Update(AZ::TimeMs serverGameTimeMs) = 0; + + //! Returns whether update messages can be sent to the connection. + //! @return true if update messages can be sent + virtual bool CanSendUpdates() const = 0; + + //! Sets the state of connection whether update messages can be sent or not. + //! @param canSendUpdates the state value + virtual void SetCanSendUpdates(bool canSendUpdates) = 0; }; } diff --git a/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.h b/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.h index 02b045e63f..7ea62b15fd 100644 --- a/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.h +++ b/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.h @@ -34,10 +34,10 @@ namespace Multiplayer AzNetworking::IConnection* GetConnection() const override; EntityReplicationManager& GetReplicationManager() override; void Update(AZ::TimeMs serverGameTimeMs) override; + bool CanSendUpdates() const override; + void SetCanSendUpdates(bool canSendUpdates) override; //! @} - bool CanSendUpdates(); - NetworkEntityHandle GetPrimaryPlayerEntity(); const NetworkEntityHandle& GetPrimaryPlayerEntity() const; @@ -51,7 +51,7 @@ namespace Multiplayer EntityStopEvent::Handler m_controlledEntityRemovedHandler; EntityMigrationEvent::Handler m_controlledEntityMigrationHandler; AzNetworking::IConnection* m_connection = nullptr; - bool m_canSendUpdates = true; + bool m_canSendUpdates = false; }; } diff --git a/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.inl b/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.inl index 07bfb51536..0a4215a363 100644 --- a/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.inl +++ b/Gems/Multiplayer/Code/Source/ConnectionData/ServerToClientConnectionData.inl @@ -12,11 +12,17 @@ namespace Multiplayer { - inline bool ServerToClientConnectionData::CanSendUpdates() + inline bool ServerToClientConnectionData::CanSendUpdates() const { return m_canSendUpdates; } + inline void ServerToClientConnectionData::SetCanSendUpdates(bool canSendUpdates) + { + m_canSendUpdates = canSendUpdates; + } + + inline NetworkEntityHandle ServerToClientConnectionData::GetPrimaryPlayerEntity() { return m_controlledEntity; diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index 2756bb649a..03c661ab03 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -384,6 +384,19 @@ namespace Multiplayer return false; } + bool MultiplayerSystemComponent::HandleRequest( AzNetworking::IConnection* connection, + [[maybe_unused]] const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet) + { + IConnectionData* connectionData = reinterpret_cast(connection->GetUserData()); + if (connectionData) + { + connectionData->SetCanSendUpdates(packet.GetReadyForEntityUpdates()); + return true; + } + + return false; + } + ConnectResult MultiplayerSystemComponent::ValidateConnect ( [[maybe_unused]] const IpAddress& remoteAddress, @@ -506,6 +519,15 @@ namespace Multiplayer handler.Connect(m_shutdownEvent); } + void MultiplayerSystemComponent::SendReadyForEntityUpdates(bool readyForEntityUpdates) + { + IConnectionSet& connectionSet = m_networkInterface->GetConnectionSet(); + connectionSet.VisitConnections([readyForEntityUpdates](IConnection& connection) + { + connection.SendReliablePacket(MultiplayerPackets::ReadyForEntityUpdates(readyForEntityUpdates)); + }); + } + const char* MultiplayerSystemComponent::GetComponentGemName(NetComponentId netComponentId) const { return GetMultiplayerComponentRegistry()->GetComponentGemName(netComponentId); diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index f8d56e0408..f25e530b61 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -71,6 +71,7 @@ namespace Multiplayer bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ClientMigration& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::NotifyClientMigration& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::EntityMigration& packet); + bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet); //! IConnectionListener interface //! @{ @@ -88,6 +89,7 @@ namespace Multiplayer void AddConnectionAcquiredHandler(ConnectionAcquiredEvent::Handler& handler) override; void AddSessionInitHandler(SessionInitEvent::Handler& handler) override; void AddSessionShutdownHandler(SessionShutdownEvent::Handler& handler) override; + void SendReadyForEntityUpdates(bool readyForEntityUpdates) override; const char* GetComponentGemName(NetComponentId netComponentId) const override; const char* GetComponentName(NetComponentId netComponentId) const override; const char* GetComponentPropertyName(NetComponentId netComponentId, PropertyIndex propertyIndex) const override; diff --git a/Gems/Multiplayer/Code/Source/MultiplayerTypes.h b/Gems/Multiplayer/Code/Source/MultiplayerTypes.h index ca3734e4f0..5c690958b5 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerTypes.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerTypes.h @@ -73,6 +73,12 @@ namespace Multiplayer True }; + enum class AutoActivate : uint8_t + { + DoNotActivate, + Activate + }; + // This is just a placeholder // The level/prefab cooking will devise the actual solution for identifying a dynamically spawnable entity within a prefab struct PrefabEntityId diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp index 938e3b2c23..74bdcd5cf0 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp @@ -543,11 +543,8 @@ namespace Multiplayer // Create an entity if we don't have one if (createEntity) { - // @pereslav - //replicatorEntity = GetNetworkEntityManager()->CreateSingleEntityImmediateInternal(prefabEntityId, EntitySpawnType::Replicate, AutoActivate::DoNotActivate, netEntityId, localNetworkRole, AZ::Transform::Identity()); INetworkEntityManager::EntityList entityList = GetNetworkEntityManager()->CreateEntitiesImmediate( - prefabEntityId, netEntityId, localNetworkRole, - AZ::Transform::Identity()); + prefabEntityId, netEntityId, localNetworkRole, AutoActivate::DoNotActivate, AZ::Transform::Identity()); if (entityList.size() == 1) { diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/INetworkEntityManager.h b/Gems/Multiplayer/Code/Source/NetworkEntity/INetworkEntityManager.h index da6d9a4cbe..891a4606ea 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/INetworkEntityManager.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/INetworkEntityManager.h @@ -60,7 +60,8 @@ namespace Multiplayer //! Creates new entities of the given archetype //! @param prefabEntryId the name of the spawnable to spawn virtual EntityList CreateEntitiesImmediate( - const PrefabEntityId& prefabEntryId, NetEntityId netEntityId, NetEntityRole netEntityRole, const AZ::Transform& transform) = 0; + const PrefabEntityId& prefabEntryId, NetEntityId netEntityId, NetEntityRole netEntityRole, AutoActivate autoActivate, + const AZ::Transform& transform) = 0; //! Returns an ConstEntityPtr for the provided entityId. //! @param netEntityId the netEntityId to get an ConstEntityPtr for diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp index ca1b40ca9b..d1701bbb89 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp @@ -11,19 +11,19 @@ */ #include -#include -#include -#include + +#include #include #include +#include #include #include +#include #include #include -#include #include #include -#include +#include namespace Multiplayer { @@ -361,7 +361,7 @@ namespace Multiplayer INetworkEntityManager::EntityList NetworkEntityManager::CreateEntitiesImmediate( const PrefabEntityId& prefabEntryId, NetEntityId netEntityId, NetEntityRole netEntityRole, - const AZ::Transform& transform) + AutoActivate autoActivate, const AZ::Transform& transform) { INetworkEntityManager::EntityList returnList; @@ -407,6 +407,11 @@ namespace Multiplayer transformComponent->SetWorldTM(transform); } + if (autoActivate == AutoActivate::DoNotActivate) + { + clone->SetRuntimeActiveByDefault(false); + } + AzFramework::GameEntityContextRequestBus::Broadcast( &AzFramework::GameEntityContextRequestBus::Events::AddGameEntity, clone); @@ -462,7 +467,9 @@ namespace Multiplayer m_rootSpawnableAsset = netSpawnableAsset; - const auto agentType = AZ::Interface::Get()->GetAgentType(); + auto* multiplayer = AZ::Interface::Get(); + + const auto agentType = multiplayer->GetAgentType(); const bool spawnImmediately = (agentType == MultiplayerAgentType::ClientServer || agentType == MultiplayerAgentType::DedicatedServer); @@ -470,6 +477,12 @@ namespace Multiplayer { CreateEntitiesImmediate(*netSpawnable, NetEntityRole::Authority); } + else + { + // If we don't spawn net entities immediately (i.e. it is a client), + // tell the server/host it can start sending updates that will instantiate entities. + multiplayer->SendReadyForEntityUpdates(true); + } } void NetworkEntityManager::OnRootSpawnableReleased([[maybe_unused]] uint32_t generation) diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h index 46f59f3762..142730188b 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h @@ -50,7 +50,7 @@ namespace Multiplayer EntityList CreateEntitiesImmediate( const PrefabEntityId& prefabEntryId, NetEntityId netEntityId, NetEntityRole netEntityRole, - const AZ::Transform& transform) override; + AutoActivate autoActivate, const AZ::Transform& transform) override; uint32_t GetEntityCount() const override; NetworkEntityHandle AddEntityToEntityMap(NetEntityId netEntityId, AZ::Entity* entity) override; diff --git a/Gems/WhiteBox/Assets/materials/DefaultPBR.material b/Gems/WhiteBox/Assets/materials/DefaultPBR.material new file mode 100644 index 0000000000..f0990f148c --- /dev/null +++ b/Gems/WhiteBox/Assets/materials/DefaultPBR.material @@ -0,0 +1,4 @@ +{ + "materialType": "Materials/Types/StandardPBR.materialtype", + "parentMaterial": "Materials/Presets/PBR/default_grid.material" +}